/* ============================================================
   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; }
}

/* ── Registration success page ─────────────────────────────── */
.register-success-card {
    max-width: 720px;
    padding: 3rem 2rem 2rem;
}

@media (min-width: 640px) {
    .register-success-card {
        padding: 3.25rem 3rem 2.5rem;
    }
}

.register-success-logo {
    margin-bottom: 1.4rem;
}

.register-success-title {
    margin-bottom: 1.3rem;
}

.register-success-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.register-success-copy p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--tm);
    text-align: left;
}

.register-success-copy strong {
    color: var(--tw);
    font-weight: 600;
}

.register-signoff {
    padding-top: .25rem;
}

.register-signature {
    color: var(--tw) !important;
    font-weight: 500;
}

.register-success-copy-google p {
    text-align: center;
}

.register-success-actions {
    margin-top: 1.5rem;
}

.register-success-footer-note {
    margin-top: 1.5rem;
    font-size: .82rem;
    line-height: 1.7;
    color: var(--td);
    text-align: left;
}

.success-inline-link {
    color: var(--lpurple);
    text-decoration: none;
    text-underline-offset: 2px;
}

.success-inline-link:hover {
    text-decoration: underline;
}

.success-modal[hidden] {
    display: none;
}

.success-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.success-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 6, 15, .8);
    backdrop-filter: blur(6px);
}

.success-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 520px);
    margin: 10vh auto 0;
    background: rgba(19, 14, 39, .94);
    border: 1px solid var(--bhl);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .45);
}

.success-modal__close {
    position: absolute;
    top: .9rem;
    right: .95rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(139,92,246,.05);
    color: var(--tw);
    font-size: 1.2rem;
    cursor: pointer;
}

.success-modal__close:hover {
    border-color: var(--bhl);
}

.success-modal__header {
    margin-bottom: 1rem;
}

.success-modal__header--center {
    text-align: center;
}

.success-modal__dialog h4 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    color: var(--tw);
    margin-bottom: .4rem;
    text-align: inherit;
}

.success-modal__helper {
    color: var(--tm);
    font-size: .92rem;
    line-height: 1.7;
    margin-bottom: 0;
    text-align: inherit;
}

.success-modal__form {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.success-modal__form .btn-primary[hidden] {
    display: none;
}

.success-modal__current-email {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    margin-bottom: .25rem;
    padding: .75rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(139,92,246,.04);
    text-align: center;
}

.success-modal__current-label {
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--td);
}

.success-modal__current-email strong {
    color: var(--tw);
    font-size: .98rem;
    word-break: break-word;
}

.success-modal__label {
    color: var(--tw);
    font-size: .9rem;
    font-weight: 500;
}

.success-modal__input {
    width: 100%;
    min-height: 50px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(139,92,246,.03);
    color: var(--tw);
    padding: 0 1rem;
    outline: none;
}

.success-modal__input:focus {
    border-color: var(--bhl);
    box-shadow: 0 0 0 3px rgba(139,92,246,.08);
}

.success-modal__message {
    min-height: 1.2rem;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--tm);
}

.success-modal__message.is-error {
    color: var(--error);
}

.success-modal__message.is-success {
    color: var(--success);
}

.success-modal__cooldown,
.success-modal__support {
    font-size: .85rem;
    line-height: 1.7;
    color: var(--tm);
}

.success-modal__cooldown span {
    color: var(--tw);
    font-weight: 600;
}

#resend-email-button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}
