/* ── Shared Auth Page Styles ───────────────────────────────────────── */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem 1rem;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--mb-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    animation: authFadeIn 0.35s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ────────────────────────────────────────────────────────── */

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo .logo-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.25rem;
}

.auth-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

/* ── Headings ────────────────────────────────────────────────────── */

.auth-heading {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 0.25rem 0;
}

.auth-subheading {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1.75rem 0;
}

/* ── Form Fields ─────────────────────────────────────────────────── */

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.auth-field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1a1a2e;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.auth-field input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
    background: #ffffff;
}

.auth-field input.field-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error-text {
    color: #ef4444;
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

/* ── Password Strength Indicator ─────────────────────────────────── */

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--mb-color-border);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-fill.weak { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: #10b981; }

.strength-label {
    font-size: 0.72rem;
    font-weight: 500;
}

.strength-label.weak { color: #ef4444; }
.strength-label.medium { color: #f59e0b; }
.strength-label.strong { color: #10b981; }

/* ── Buttons ─────────────────────────────────────────────────────── */

.auth-btn {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.auth-btn:active {
    transform: scale(0.985);
}

.auth-btn-primary {
    background: #0078d4;
    color: #ffffff;
}

.auth-btn-primary:hover {
    background: #006abc;
}

.auth-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    transform: none;
}

/* ── Social Login ────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.social-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    text-decoration: none;
}

.social-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.social-btn-apple {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.social-btn-apple:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.social-btn .coming-soon-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

.social-btn:hover .coming-soon-tooltip {
    display: block;
}

/* ── Links ───────────────────────────────────────────────────────── */

.auth-links {
    text-align: center;
    margin-top: 1.25rem;
}

.auth-links a, .auth-links button.link-btn {
    color: #0078d4;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.auth-links a:hover, .auth-links button.link-btn:hover {
    text-decoration: underline;
}

.auth-link-secondary {
    color: #64748b !important;
    font-weight: 400 !important;
}

/* ── Checkbox ────────────────────────────────────────────────────── */

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 16px;
    height: 16px;
    accent-color: #0078d4;
    cursor: pointer;
}

.auth-checkbox label {
    font-size: 0.825rem;
    color: #4b5563;
    cursor: pointer;
    line-height: 1.4;
}

.auth-checkbox label a {
    color: #0078d4;
    text-decoration: none;
}

.auth-checkbox label a:hover {
    text-decoration: underline;
}

/* ── Alert Messages ──────────────────────────────────────────────── */

.auth-alert {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.auth-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* ── Centred info page (verify-email-sent, etc.) ─────────────────── */

.auth-info-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.auth-info-text {
    text-align: center;
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

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

/* ── Profile page ────────────────────────────────────────────────── */

.profile-page {
    max-width: 640px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #0078d4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
}

.profile-meta h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    color: #1a1a2e;
}

.profile-meta p {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

.profile-section {
    background: #ffffff;
    border: 1px solid var(--mb-color-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.profile-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row-label {
    font-size: 0.85rem;
    color: #64748b;
}

.profile-row-value {
    font-size: 0.85rem;
    color: #1a1a2e;
    font-weight: 500;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--mb-radius-xl);
    font-size: 0.78rem;
    font-weight: 600;
}

.tier-free   { background: #f3f4f6; color: var(--mb-color-muted); }
.tier-pro    { background: #eff6ff; color: #2563eb; }
.tier-ai     { background: #faf5ff; color: #7c3aed; }

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.profile-btn {
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #374151;
    transition: background 0.15s;
}

.profile-btn:hover {
    background: #f8fafc;
}

.profile-btn-primary {
    background: #0078d4;
    color: #fff;
    border-color: #0078d4;
}

.profile-btn-primary:hover {
    background: #006abc;
}

.profile-btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.profile-btn-danger:hover {
    background: #fef2f2;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 12px;
    }

    .social-buttons {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
