/* ============================================================
   caijo — Auth Stylesheet v5
   Design language: dark, elegant, premium, purple palette.
   Matches the dashboard design system.
   ============================================================ */


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:       #07060f;
    --purple:   #8b5cf6;
    --lpurple:  #a78bfa;
    --ppurple:  #c084fc;
    --violet:   #7c3aed;
    --cream:    #fdfbd4;
    --tw:       #f5f3ff;
    --tm:       rgba(245,243,255,.52);
    --td:       rgba(245,243,255,.24);
    --surface:  rgba(139,92,246,.06);
    --border:   rgba(139,92,246,.14);
    --bhl:      rgba(139,92,246,.38);
    --blue:     #00A5FE;
    --navy:     #1b2340;
    --error:    #f87171;
    --success:  #34d399;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

html, body {
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--tw);
    -webkit-font-smoothing: antialiased;
}

/* ── Grid texture overlay ───────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(139,92,246,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139,92,246,.025) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* ── Page wrapper ───────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ── Glow blob ──────────────────────────────────────────────── */
.auth-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(139,92,246,.07);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: blur(80px);
    z-index: 0;
}

/* ── Auth shell — split layout ──────────────────────────────── */
.auth-shell {
    width: 100%;
    max-width: 1080px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .auth-shell {
        flex-direction: row;
        min-height: 620px;
    }
}

/* ── Left brand panel ───────────────────────────────────────── */
.auth-left {
    background: rgba(139,92,246,.05);
    border-right: 1px solid var(--border);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .auth-left {
        width: 44%;
        flex-shrink: 0;
        padding: 4rem 3rem;
    }
}

/* Left panel glow */
.auth-left::before {
    content: '';
    position: absolute;
    top: -120px; right: -80px;
    width: 340px; height: 340px;
    border-radius: 50%;
    background: rgba(139,92,246,.08);
    filter: blur(50px);
    pointer-events: none;
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(192,132,252,.05);
    filter: blur(40px);
    pointer-events: none;
}

.auth-logo {
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.auth-logo img { width: 100px; height: auto; }

.auth-left-content {
    position: relative;
    z-index: 1;
    max-width: 320px;
}

/* Eyebrow */
.left-eyebrow {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--purple);
    margin-bottom: 1rem;
}

/* Heading — DM Serif, cream + white mix */
.left-h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    color: var(--cream);
    line-height: 1.25;
    margin-bottom: .375rem;
}

.left-h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    color: var(--tw);
    line-height: 1.25;
    margin-bottom: 1rem;
}

@media (min-width: 1024px) {
    .left-h1, .left-h2 { font-size: 2rem; }
}

.left-sub {
    font-size: .875rem;
    color: var(--tm);
    line-height: 1.75;
    margin-bottom: 2rem;
}

/* Feature list */
.feature-list {
    display: none;
    flex-direction: column;
    gap: .625rem;
    align-items: center;
    list-style: none;
}

@media (min-width: 640px) { .feature-list { display: flex; } }

.feature-list li {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .8125rem;
    color: var(--tm);
}

.feature-list li svg {
    width: 14px;
    height: 14px;
    color: var(--purple);
    flex-shrink: 0;
}

/* Mobile pill tags */
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .375rem;
    margin-top: .5rem;
}

@media (min-width: 640px) { .feature-tags { display: none; } }

.feature-tag {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .625rem;
    color: var(--tm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .2rem .5rem;
}

.feature-tag svg { width: 10px; height: 10px; color: var(--purple); flex-shrink: 0; }

/* Left panel quote */
.left-quote {
    display: none;
}

@media (min-width: 1024px) {
    .left-quote {
        display: block;
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
        text-align: center;
        position: relative;
        z-index: 1;
        max-width: 320px;
    }
}

.left-quote .q-text {
    font-size: .8125rem;
    color: var(--lpurple);
    line-height: 1.7;
    font-style: italic;
    display: block;
    margin-bottom: .5rem;
}

.left-quote .q-attr {
    font-size: 14px;
    font-style: normal;
    color: var(--lpurple);
    display: block;
}

/* ── Right form panel ───────────────────────────────────────── */
.auth-right {
    flex: 1;
    background: rgba(7,6,15,.7);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 640px)  { .auth-right { padding: 3rem 2.5rem; } }
@media (min-width: 1024px) { .auth-right { padding: 4rem 3.5rem; } }

/* ── Form header ────────────────────────────────────────────── */
.form-header { margin-bottom: 2rem; text-align: center; }

.form-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.625rem;
    color: var(--tw);
    margin-bottom: .375rem;
    line-height: 1.25;
    text-align: center;
}

.form-header p { font-size: .9rem; color: var(--td); }

/* ── Google button ──────────────────────────────────────────── */
.btn-google {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--tw);
    font-family: 'Outfit', sans-serif;
    font-size: .9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.btn-google:hover { background: rgba(139,92,246,.1); border-color: var(--bhl); }
.btn-google svg  { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Divider ────────────────────────────────────────────────── */
.form-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.form-divider-line { flex: 1; height: 1px; background: var(--border); }
.form-divider span { font-size: .8rem; color: var(--td); white-space: nowrap; }

/* ── Form fields ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.125rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 1.125rem;
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-row .form-group { margin-bottom: 1.125rem; }
}

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--tm);
    margin-bottom: .4rem;
    letter-spacing: .01em;
}

.form-input {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(139,92,246,.04);
    color: var(--tw);
    font-family: 'Outfit', sans-serif;
    font-size: .9375rem;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    appearance: none;
}

.form-input::placeholder { color: var(--td); }

.form-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

.form-input.is-error { border-color: var(--error); }

.field-error {
    font-size: .78rem;
    color: var(--error);
    margin-top: .375rem;
    display: block;
}

/* ── Password toggle ────────────────────────────────────────── */
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper .form-input { padding-right: 2.75rem; width: 100%; }

.toggle-password {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--td);
    transition: color .15s;
    line-height: 0;
}

.toggle-password:hover { color: var(--tm); }
.toggle-password svg   { width: 17px; height: 17px; display: block; }
.toggle-password .eye-closed { display: none; }

.forgot-link {
    display: block;
    text-align: right;
    font-size: .8rem;
    color: var(--lpurple);
    text-decoration: none;
    margin-top: .375rem;
    transition: color .15s;
}

.forgot-link:hover { color: var(--ppurple); }

/* ── Primary button ─────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: .875rem;
    border-radius: var(--radius-md);
    border: none;
    background: var(--purple);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    margin-top: 1.375rem;
    margin-bottom: 1.375rem;
    letter-spacing: .01em;
}

.btn-primary:hover   { background: var(--violet); }
.btn-primary:active  { transform: scale(0.99); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    font-size: .875rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.alert-error   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); color: #fca5a5; }
.alert-success { background: rgba(52,211,153,.08);  border: 1px solid rgba(52,211,153,.2);  color: #6ee7b7; }

/* ── Form footer ────────────────────────────────────────────── */
.form-footer { text-align: center; font-size: .875rem; color: var(--td); }
.form-footer a { color: var(--lpurple); text-decoration: none; font-weight: 500; }
.form-footer a:hover { color: var(--ppurple); }

/* ── Terms note ─────────────────────────────────────────────── */
.terms-note {
    margin-top: 1.25rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: .8rem;
    color: var(--td);
    text-align: center;
    line-height: 1.6;
}

.terms-note a { color: var(--lpurple); text-decoration: none; }
.terms-note a:hover { text-decoration: underline; }

/* ── Password strength ──────────────────────────────────────── */
.password-strength { margin-top: .5rem; display: flex; gap: .25rem; }
.strength-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background .3s; }
.strength-bar.active-weak   { background: var(--error); }
.strength-bar.active-fair   { background: #fbbf24; }
.strength-bar.active-good   { background: var(--success); }
.strength-bar.active-strong { background: var(--success); }
.strength-label { font-size: .75rem; color: var(--td); margin-top: .25rem; min-height: 1em; display: block; }

/* ── Compact card page (forgot-password, reset, sent) ───────── */
.auth-page-compact {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    gap: 0;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(139,92,246,.04);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 640px) { .auth-card { padding: 3rem 2.5rem; } }

.auth-card-logo { display: flex; justify-content: center; margin-bottom: 2rem; }
.auth-card-logo img { width: 90px; height: auto; }

.auth-card-icon {
    width: 54px; height: 54px;
    border-radius: var(--radius-lg);
    background: rgba(139,92,246,.1);
    border: 1px solid var(--bhl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-card-icon svg { width: 24px; height: 24px; color: var(--lpurple); }

.auth-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--tw);
    margin-bottom: .5rem;
    text-align: center;
    line-height: 1.25;
}

.auth-card .subtext {
    font-size: .9rem;
    color: var(--td);
    text-align: center;
    line-height: 1.65;
    margin-bottom: 2rem;
}

/* ── Forgot sent / confirmed state ──────────────────────────── */
.confirmed-icon {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: rgba(139,92,246,.1);
    border: 1px solid var(--bhl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.confirmed-icon svg { width: 26px; height: 26px; color: var(--lpurple); }

.confirmed-h {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--tw);
    text-align: center;
    margin-bottom: 1.25rem;
}

.confirmed-p {
    font-size: .9rem;
    color: var(--tm);
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}

.confirmed-p strong { color: var(--tw); font-weight: 500; }

.confirmed-options {
    font-size: .9rem;
    color: var(--tm);
    line-height: 1.8;
    text-align: left;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: .5rem;
}

.confirmed-options a {
    color: var(--lpurple);
    font-weight: 600;
    text-decoration: none;
}

.confirmed-options a:hover { text-decoration: underline; }

/* ── Back link ──────────────────────────────────────────────── */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    font-size: .875rem;
    color: var(--td);
    text-decoration: none;
    margin-top: 1.5rem;
    transition: color .15s;
}

.back-link:hover { color: var(--lpurple); }
.back-link svg { width: 14px; height: 14px; }

/* ── Quote below compact card ───────────────────────────────── */
.page-quote { display: none; }

@media (min-width: 1024px) {
    .page-quote {
        display: block;
        width: 100%;
        max-width: 480px;
        margin-top: 1.75rem;
        text-align: center;
        position: relative;
        z-index: 1;
    }
}

.page-quote .q-text {
    font-size: .875rem;
    color: var(--lpurple);
    line-height: 1.7;
    font-style: italic;
    display: block;
    margin-bottom: .5rem;
}

.page-quote .q-attr {
    font-size: 14px;
    font-style: normal;
    color: var(--lpurple);
    display: block;
}

/* ── Mobile left panel adjustments ─────────────────────────── */
@media (max-width: 639px) {
    .auth-left { padding: 1.5rem 1.25rem; }
    .left-sub  { display: none; }
    .left-h1, .left-h2 { font-size: 1.25rem; }
    .auth-logo { margin-bottom: .875rem; }
}
