/* 認證 & 支付 Modal 樣式 */

/* 導航列認證區 — nav-bar 基礎樣式由 style.css 提供 */

.auth-user {
    color: #e2e8f0;
    font-size: 0.85rem;
}

.auth-btn {
    padding: 5px 14px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.auth-admin-btn {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.5);
    color: #d4af37;
    text-decoration: none;
    display: inline-block;
}

.auth-admin-btn:hover {
    background: rgba(212, 175, 55, 0.4);
    color: #f5d76e;
}

/* Modal 共用 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 400px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

/* 登入/註冊 Tab */
.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.modal-tab.active {
    color: #1a1a2e;
    font-weight: 600;
    border-bottom-color: #1a1a2e;
}

/* 表單欄位 */
.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.modal-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.modal-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-error {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 8px;
}

.modal-submit {
    width: 100%;
    padding: 10px;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-submit:hover {
    background: #16213e;
}

/* 支付 Modal */
.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    text-align: center;
}

.payment-info {
    margin-bottom: 20px;
    text-align: center;
}

.price-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.price-list span {
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #374151;
}

.price-highlight {
    background: #dbeafe !important;
    color: #1e40af !important;
    font-weight: 600;
}

.price-note {
    font-size: 0.8rem;
    color: #6b7280;
}

.payment-status {
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 24px;
}

.payment-status.success {
    color: #059669;
    font-weight: 600;
}

.payment-status.error {
    color: #ef4444;
}

.payment-fallback {
    text-align: center;
    color: #6b7280;
    padding: 20px;
}

/* 分析鎖定區 */
.analysis-locked {
    margin-top: 24px;
}

.analysis-locked h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.locked-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #f0f9ff);
    border: 1px dashed #93c5fd;
    border-radius: 12px;
}

.locked-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.locked-text {
    flex: 1;
}

.locked-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.locked-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
}

.locked-quota {
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
}

.btn-unlock {
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-unlock:hover {
    background: #2563eb;
}

/* 靈棋經配額顯示 */
.quota-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #374151;
}

.quota-text strong {
    color: #1a1a2e;
}

.quota-sep {
    color: #d1d5db;
    margin: 0 4px;
}

.btn-buy-quota {
    padding: 4px 12px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.82rem;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s;
}

.btn-buy-quota:hover {
    background: #d97706;
}

/* RWD */
@media (max-width: 640px) {
    .modal-box {
        padding: 24px;
        width: 95vw;
    }

    .locked-card {
        flex-direction: column;
        text-align: center;
    }

    .auth-area {
        gap: 10px;
    }

    .auth-user {
        font-size: 0.78rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
