/* ── Override light body background on auth pages ─────────────── */
body:has(.auth-page) {
    background-color: #0a0b18;
}

body:has(.auth-page) .page-scroll-container {
    background:
        radial-gradient(ellipse 80% 50% at 15% 18%, rgba(102, 126, 234, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse 65% 55% at 85% 82%, rgba(118, 75, 162, 0.13) 0%, transparent 50%),
        #0a0b18;
}

/* ── Auth page shell ───────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - 4.5rem);
    display: grid;
    place-items: center;
    padding: 0 1rem 3.5rem;
}

/* ── Card ──────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 30rem;
    background: linear-gradient(160deg, #13152e 0%, #0e1026 100%);
    border: 1px solid rgba(131, 151, 255, 0.16);
    border-radius: 1.25rem;
    padding: 2rem 2rem 1.75rem;
    box-shadow:
        0 0 0 1px rgba(102, 126, 234, 0.06),
        0 24px 60px rgba(4, 5, 20, 0.55),
        0 0 80px rgba(102, 126, 234, 0.07);
}

/* ── Heading ───────────────────────────────────────────────────── */
.auth-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    font-weight: 700;
    color: #eef0ff;
    text-align: center;
    letter-spacing: -0.3px;
}

.auth-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.auth-title span {
    background: linear-gradient(135deg, #667eea 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title-icon {
    width: 1.8rem;
    height: 1.8rem;
}

.auth-subtitle {
    margin: 0 0 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: center;
}

/* ── Social buttons ────────────────────────────────────────────── */
.social-row {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.2rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid rgba(150, 164, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #c8ceee;
    border-radius: 0.75rem;
    padding: 0.72rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.social-btn:hover {
    border-color: rgba(150, 164, 255, 0.38);
    background: rgba(255, 255, 255, 0.08);
}

.social-btn.is-disabled,
.social-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.social-btn.is-disabled:hover,
.social-btn:disabled:hover {
    border-color: rgba(150, 164, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.social-btn-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Divider ───────────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0 1rem;
    color: #505675;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid rgba(131, 151, 255, 0.12);
}

/* ── Form fields ───────────────────────────────────────────────── */
.auth-form {
    display: grid;
    gap: 0.45rem;
}

.auth-form label {
    margin-top: 0.5rem;
    color: #a8b0d8;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.auth-form input {
    width: 100%;
    border: 1px solid rgba(131, 151, 255, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #eef0ff;
    border-radius: 0.75rem;
    padding: 0.78rem 0.9rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input::placeholder {
    color: #404670;
}

.auth-form input:focus {
    border-color: rgba(148, 170, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(108, 130, 241, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

/* Keep dark styling when browser autofills saved credentials. */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #eef0ff;
    caret-color: #eef0ff;
    -webkit-box-shadow: 0 0 0 1000px #141629 inset;
    box-shadow: 0 0 0 1000px #141629 inset;
    border-color: rgba(131, 151, 255, 0.22);
    transition: background-color 5000s ease-in-out 0s;
}

.auth-form input:autofill {
    color: #eef0ff;
    caret-color: #eef0ff;
    background: #141629;
}

/* ── Submit button ─────────────────────────────────────────────── */
.primary-btn {
    margin-top: 1.1rem;
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 0.8rem;
    padding: 0.85rem 1rem;
    font-size: 0.97rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.28);
    transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.primary-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0);
    filter: brightness(0.97);
}

/* ── Validation messages ───────────────────────────────────────── */
.field-error {
    color: #ff8fa3;
    font-size: 0.82rem;
    padding-left: 0.2rem;
}

.form-alert {
    color: #ffb7c3;
    font-size: 0.86rem;
    border: 1px solid rgba(255, 135, 158, 0.3);
    background: rgba(255, 100, 130, 0.08);
    border-radius: 0.65rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.2rem;
}

/* ── Footer link ───────────────────────────────────────────────── */
.auth-footer {
    margin: 1.25rem 0 0;
    color: #5a6080;
    font-size: 0.88rem;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: .6rem;
}

.auth-footer a {
    color: #9ba8f0;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-footer a:hover {
    color: #c4ccff;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .auth-page {
        padding: 1.5rem 0.75rem 2.5rem;
        align-items: flex-start;
    }

    .auth-card {
        padding: 1.5rem 1.25rem 1.4rem;
        border-radius: 1rem;
    }

    .auth-card h1 {
        font-size: 1.35rem;
    }
}
