/*!
 * ITZ Adarsh — auth screens (login / register / reset)
 * Shared shell: split card, gradient brand panel, themed inputs.
 * Theme comes from html[data-theme] with a light fallback.
 */

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

.auth-page {
    --a-bg: #eef4f2;
    --a-bg-2: #e3ece9;
    --a-card: #ffffff;
    --a-panel: #ffffff;
    --a-ink: #0b2b27;
    --a-ink-soft: #5b6b67;
    --a-muted: #7b8a86;
    --a-line: #dbe4e1;
    --a-line-strong: #c6d3cf;
    --a-input: #f7faf9;
    --a-brand: #095650;
    --a-brand-2: #0f766e;
    --a-accent: #14b8a6;
    --a-danger: #dc2626;
    --a-danger-bg: rgba(220, 38, 38, .08);
    --a-ok: #047857;
    --a-ok-bg: rgba(16, 185, 129, .12);
    --a-shadow: 0 30px 80px rgba(9, 86, 80, .16), 0 2px 8px rgba(9, 86, 80, .06);
    --a-focus: rgba(20, 184, 166, .38);
    --a-brand-ink: #ffffff;
    --a-brand-soft: rgba(255, 255, 255, .78);

    margin: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--a-ink);
    background: var(--a-bg);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

html[data-theme="dark"] .auth-page {
    --a-bg: #060a0a;
    --a-bg-2: #0a1211;
    --a-card: #0e1615;
    --a-panel: #0e1615;
    --a-ink: #eef6f4;
    --a-ink-soft: #a7b6b2;
    --a-muted: #859792;
    --a-line: #1e2b29;
    --a-line-strong: #2a3a37;
    --a-input: #0a1211;
    --a-brand: #0f766e;
    --a-brand-2: #14b8a6;
    --a-accent: #2dd4bf;
    --a-danger: #f87171;
    --a-danger-bg: rgba(248, 113, 113, .12);
    --a-ok: #34d399;
    --a-ok-bg: rgba(52, 211, 153, .14);
    --a-shadow: 0 30px 90px rgba(0, 0, 0, .6);
    --a-brand-soft: rgba(255, 255, 255, .72);
    --a-brand-ink: #04100f;
}

/* ---------- animated background ---------- */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(20, 184, 166, .22), transparent 60%),
        radial-gradient(900px 600px at 100% 0%, rgba(9, 86, 80, .18), transparent 55%),
        radial-gradient(800px 800px at 50% 120%, rgba(16, 185, 129, .14), transparent 60%),
        linear-gradient(180deg, var(--a-bg) 0%, var(--a-bg-2) 100%);
}

.auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(9, 86, 80, .06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(9, 86, 80, .06) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
}

html[data-theme="dark"] .auth-bg {
    background:
        radial-gradient(1000px 620px at 10% -10%, rgba(20, 184, 166, .16), transparent 62%),
        radial-gradient(900px 620px at 100% 0%, rgba(15, 118, 110, .2), transparent 58%),
        radial-gradient(760px 760px at 50% 120%, rgba(45, 212, 191, .12), transparent 60%),
        linear-gradient(180deg, var(--a-bg) 0%, var(--a-bg-2) 100%);
}

html[data-theme="dark"] .auth-bg::after {
    background-image:
        linear-gradient(to right, rgba(45, 212, 191, .07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(45, 212, 191, .07) 1px, transparent 1px);
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(58px);
    opacity: .55;
    animation: auth-float 16s ease-in-out infinite;
}

.auth-orb-1 {
    width: 380px;
    height: 380px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(20, 184, 166, .55), transparent 65%);
}

.auth-orb-2 {
    width: 460px;
    height: 460px;
    bottom: -160px;
    right: -120px;
    background: radial-gradient(circle, rgba(9, 86, 80, .45), transparent 65%);
    animation-delay: -7s;
}

@keyframes auth-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -26px, 0) scale(1.06); }
}

/* ---------- theme switch ---------- */
.auth-theme {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid var(--a-line-strong);
    background: color-mix(in srgb, var(--a-card) 88%, transparent);
    color: var(--a-ink);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(9, 86, 80, .12);
    transition: transform .16s ease, border-color .16s ease;
}

.auth-theme:hover {
    transform: translateY(-1px);
    border-color: var(--a-accent);
}

.auth-theme i {
    font-size: 15px;
    color: var(--a-brand-2);
}

/* ---------- shell ---------- */
.auth-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1040px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    border-radius: 26px;
    overflow: hidden;
    background: var(--a-card);
    border: 1px solid var(--a-line);
    box-shadow: var(--a-shadow);
}

/* ---------- brand panel ---------- */
.auth-brand {
    position: relative;
    padding: 42px 40px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    color: #ffffff;
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(20, 184, 166, .55), transparent 55%),
        linear-gradient(155deg, #0b6b62 0%, #095650 45%, #063f3a 100%);
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: auto -60px -90px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 62%);
}

html[data-theme="dark"] .auth-brand {
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(45, 212, 191, .35), transparent 55%),
        linear-gradient(155deg, #0a3f3b 0%, #072e2b 48%, #041c1a 100%);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo img {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: #ffffff;
    padding: 5px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}

.auth-logo span {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.auth-brand-copy h2 {
    margin: 0 0 10px;
    font-size: 27px;
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-brand-copy p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--a-brand-soft);
    max-width: 34ch;
}

.auth-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .92);
}

.auth-points i {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-top: -1px;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
}

.auth-brand-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: 12px;
    color: rgba(255, 255, 255, .78);
}

.auth-brand-foot i {
    font-size: 14px;
    color: #6ee7b7;
}

/* ---------- form panel ---------- */
.auth-panel {
    padding: 42px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    background: var(--a-panel);
}

.auth-panel-head h1 {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--a-ink);
}

.auth-panel-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--a-ink-soft);
}

.auth-form {
    display: grid;
    gap: 15px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-field>label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--a-ink);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap>i.bi {
    position: absolute;
    left: 14px;
    font-size: 15px;
    color: var(--a-muted);
    pointer-events: none;
    transition: color .16s ease;
}

.auth-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 46px 0 42px;
    border-radius: 12px;
    border: 1px solid var(--a-line-strong);
    background: var(--a-input);
    color: var(--a-ink);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.auth-input-wrap input::placeholder {
    color: var(--a-muted);
}

.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--a-accent);
    background: var(--a-card);
    box-shadow: 0 0 0 4px var(--a-focus);
}

.auth-input-wrap input:focus~i.bi,
.auth-input-wrap:focus-within>i.bi {
    color: var(--a-brand-2);
}

/* password reveal */
.auth-reveal {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--a-muted);
    cursor: pointer;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
}

.auth-reveal:hover {
    background: color-mix(in srgb, var(--a-brand-2) 12%, transparent);
    color: var(--a-brand-2);
}

/* row: remember / forgot */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12.5px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--a-ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--a-brand-2);
    cursor: pointer;
}

.auth-link {
    color: var(--a-brand-2);
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* buttons */
.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    margin-top: 2px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--a-brand-2) 0%, var(--a-brand) 100%);
    color: var(--a-brand-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(9, 86, 80, .22);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(9, 86, 80, .28);
    filter: brightness(1.04);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit i {
    font-size: 16px;
}

html[data-theme="dark"] .auth-submit {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    color: #04211f;
    box-shadow: 0 10px 26px rgba(20, 184, 166, .24);
}

/* alerts */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.auth-alert i {
    font-size: 15px;
    margin-top: 1px;
}

.auth-alert-error {
    background: var(--a-danger-bg);
    border-color: color-mix(in srgb, var(--a-danger) 35%, transparent);
    color: var(--a-danger);
}

.auth-alert-success {
    background: var(--a-ok-bg);
    border-color: color-mix(in srgb, var(--a-ok) 35%, transparent);
    color: var(--a-ok);
}

/* footer switch */
.auth-switch {
    margin: 2px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--a-ink-soft);
}

.auth-switch a {
    color: var(--a-brand-2);
    font-weight: 700;
    text-decoration: none;
}

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

.auth-note {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--a-muted);
}

.auth-note code {
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 11px;
    background: color-mix(in srgb, var(--a-brand-2) 12%, transparent);
    color: var(--a-brand-2);
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 26px 26px 22px;
        gap: 16px;
    }

    .auth-brand-copy h2 {
        font-size: 21px;
    }

    .auth-brand-copy p,
    .auth-points {
        display: none;
    }

    .auth-panel {
        padding: 26px 24px 30px;
    }
}

@media (max-width: 520px) {
    .auth-page {
        padding: 16px 12px;
    }

    .auth-card {
        border-radius: 20px;
    }

    .auth-theme {
        top: 10px;
        right: 10px;
        height: 38px;
        padding: 0 12px;
    }

    .auth-theme span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-orb {
        animation: none;
    }
}
