/* ═══════════════════════════════════════════════════════════
   AUTH PAGES — Login, Signup, Verify, Profile, Reset password.
   Use with design-system.css. Load on auth/*.html only.
   ═══════════════════════════════════════════════════════════ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-3);
    background: linear-gradient(160deg, #f8faff 0%, #faf5ff 50%, #f0f9ff 100%);
    font-family: var(--ds-font-sans);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
    padding: var(--ds-space-6);
    animation: ds-fade-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ds-text);
    text-align: center;
    margin-bottom: var(--ds-space-1);
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--ds-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--ds-space-5);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-3);
}

.auth-form label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ds-text);
    display: block;
    margin-bottom: 6px;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--ds-font-sans);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    background: var(--ds-surface);
    color: var(--ds-text);
    transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-form input::placeholder {
    color: var(--ds-text-subtle);
}

/* Phone input wrapper for intl-tel-input */
.auth-phone-wrap {
    width: 100%;
}
.auth-phone-wrap .iti {
    width: 100%;
}
.auth-phone-wrap .iti input {
    padding-left: 52px;
}

.auth-submit {
    width: 100%;
    margin-top: var(--ds-space-2);
    padding: 14px;
    font-size: 1rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    margin: var(--ds-space-3) 0;
    color: var(--ds-text-subtle);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ds-border);
}

.auth-links {
    text-align: center;
    font-size: 0.9375rem;
    margin-top: var(--ds-space-4);
}

.auth-links a {
    color: var(--ds-primary);
    text-decoration: none;
    font-weight: 600;
}

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

.auth-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--ds-radius);
    color: var(--ds-error);
    font-size: 0.875rem;
    margin-bottom: var(--ds-space-2);
}

.auth-success {
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--ds-radius);
    color: var(--ds-success);
    font-size: 0.875rem;
    margin-bottom: var(--ds-space-2);
}

/* OTP input */
.auth-otp-wrap {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: var(--ds-space-4) 0;
}

.auth-otp-wrap input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* Profile page */
.auth-profile-page {
    display: block;
    min-height: 100vh;
    margin: 0;
    padding: 20px 24px 64px;
    box-sizing: border-box;
    background:
        radial-gradient(circle at 12% 8%, rgba(99, 102, 241, 0.14), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(160deg, #f8faff 0%, #faf5ff 50%, #f0f9ff 100%);
}

.auth-profile-page *,
.auth-profile-page *::before,
.auth-profile-page *::after {
    box-sizing: border-box;
}

.auth-profile-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 18px;
    padding: 4px 2px;
}

.auth-profile-close {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 24px rgba(30, 41, 59, 0.08);
    color: var(--ds-text);
    text-decoration: none;
    font-size: 1.1rem;
}

.auth-profile-close:hover {
    color: var(--ds-primary);
    transform: translateY(-1px);
}

.auth-profile-title {
    font-weight: 750;
    font-size: 1rem;
    color: var(--ds-text);
    letter-spacing: -0.01em;
}

.auth-profile-home-txt {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ds-primary);
    text-decoration: none;
}

.auth-profile-card {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px;
    border-color: rgba(99, 102, 241, 0.14);
    box-shadow: 0 28px 70px rgba(45, 55, 100, 0.14);
}

.auth-profile-intro {
    padding-bottom: 26px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--ds-border);
}

.auth-profile-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--ds-primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-profile-card h1 {
    margin: 0 0 8px;
    text-align: left;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -0.045em;
}

.auth-profile-card .auth-profile-sub {
    max-width: 620px;
    margin: 0;
    text-align: left;
    font-size: 0.95rem;
}

#profileContent {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 18px;
    align-items: stretch;
}

.auth-profile-row,
.auth-profile-block {
    border: 1px solid var(--ds-border);
    border-radius: 18px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.72);
}

.auth-profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(145deg, #312e81, #4f46e5);
    border-color: transparent;
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.2);
}

.auth-profile-row .auth-profile-info h2,
.auth-profile-row .auth-profile-info p {
    color: #fff;
}

.auth-profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
}

.auth-profile-info {
    min-width: 0;
}

.auth-profile-info h2 {
    overflow: hidden;
    margin: 0 0 3px;
    font-size: 1.15rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-profile-info p {
    overflow: hidden;
    margin: 0 0 8px;
    font-size: 0.85rem;
    opacity: 0.78;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-profile-block {
    margin: 0;
}

.auth-profile-block-title {
    margin: 0 0 6px;
    color: var(--ds-text);
    font-size: 1rem;
    font-weight: 750;
}

.auth-profile-block-text {
    margin: 0 0 14px;
    color: var(--ds-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

#progressSection {
    grid-column: 2;
    grid-row: 1 / span 3;
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(238, 242, 255, 0.9), rgba(255, 255, 255, 0.76));
}

.auth-upgrade-btn {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    text-align: center;
}

.auth-upgrade-monthly {
    padding: 12px;
    border: none;
    border-radius: var(--ds-radius);
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.auth-profile-logout {
    margin: 0;
    padding: 2px 4px;
    text-align: left;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--ds-radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.auth-badge-free {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-badge-pro {
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-accent));
    color: #fff;
}

.auth-back-home {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ds-text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    margin: 0;
}

.auth-back-home:hover {
    color: var(--ds-primary);
}

.auth-form button,
.auth-back-home,
.auth-card a {
    border-radius: var(--ds-radius);
}

.auth-form button:focus-visible,
.auth-back-home:focus-visible,
.auth-card a:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 3px;
}

.auth-otp-wrap {
    max-width: 100%;
}

@media (max-width: 480px) {
    .auth-page {
        padding: 64px 16px 24px;
        align-items: flex-start;
    }
    .auth-card {
        padding: var(--ds-space-4);
        border-radius: 18px;
    }
    .auth-back-home {
        top: 14px;
        left: 16px;
        font-size: 0.85rem;
    }
    .auth-otp-wrap input {
        width: 42px;
        height: 48px;
        font-size: 1.1rem;
    }
}

@media (max-width: 760px) {
    .auth-profile-page {
        padding: 14px 16px 36px;
    }
    .auth-profile-header-bar {
        margin-bottom: 10px;
    }
    .auth-profile-card {
        padding: 24px 18px;
        border-radius: 22px;
    }
    .auth-profile-intro {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    #profileContent {
        grid-template-columns: minmax(0, 1fr);
    }
    #progressSection {
        grid-column: 1;
        grid-row: auto;
    }
    .auth-profile-row,
    .auth-profile-block {
        padding: 18px;
    }
}
