:root {
    --auth-ink: #0f1e3d;
    --auth-muted: #6b7690;
    --auth-green: #2563eb;
    --auth-green-dark: #1d4ed8;
    --auth-lime: #4ade80;
    --auth-mint: #eaf2ff;
    --auth-line: #e3e9f4;
    --auth-danger: #ef4444;
    --auth-gold: #c9a24b;
    --auth-navy: #0e1e3d;
    --auth-shadow: 0 24px 60px rgba(10, 23, 48, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: #eef3fb; }
body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    background: #eef3fb;
    font: 16px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: var(--auth-green); }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(350px, .82fr) minmax(540px, 1.18fr);
    min-height: 100vh;
}

.auth-story {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(32px, 5vw, 72px);
    color: #fff;
    background:
        radial-gradient(circle at 83% 16%, rgba(74,222,128,.18) 0 12%, transparent 12.3%),
        radial-gradient(circle at 18% 82%, rgba(255,255,255,.07) 0 17%, transparent 17.3%),
        linear-gradient(145deg, #0e1e3d 0%, #142b55 50%, #0a1730 100%);
}
.auth-story::before, .auth-story::after {
    position: absolute;
    z-index: -1;
    content: "";
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
}
.auth-story::before {
    width: 520px;
    height: 520px;
    right: -280px;
    top: 25%;
    box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018);
}
.auth-story::after { width: 180px; height: 180px; left: -100px; bottom: 14%; }

.auth-brand, .auth-mobile-brand {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.04em;
    text-decoration: none;
}
.auth-brand-logo { width: 176px; height: 96px; object-fit: contain; object-position: left center; padding: 4px 7px; border-radius: 12px; background: rgba(255,255,255,.96); }
.auth-mobile-brand .auth-brand-logo { width: 142px; height: 74px; }
.auth-brand > span:last-child > span, .auth-mobile-brand > span:last-child > span { color: var(--auth-lime); }
.auth-brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.12);
}
.auth-brand-mark svg { width: 34px; height: 34px; fill: var(--auth-lime); }
.auth-brand-mark .auth-brand-cross { fill: var(--auth-navy); }

.auth-story-copy { max-width: 550px; margin: auto 0; padding: 60px 0; }
.auth-kicker, .auth-eyebrow {
    display: block;
    margin: 0 0 12px;
    color: var(--auth-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.auth-story h2 {
    margin: 0;
    font: 700 clamp(36px, 4.4vw, 62px)/1.08 "Playfair Display", Georgia, "Times New Roman", serif;
    letter-spacing: -.035em;
}
.auth-story-copy > p {
    max-width: 500px;
    margin: 26px 0 30px;
    color: rgba(255,255,255,.72);
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.7;
}
.auth-trust-row { display: flex; flex-wrap: wrap; gap: 22px; color: rgba(255,255,255,.88); font-size: 14px; font-weight: 600; }
.auth-trust-row span { display: inline-flex; align-items: center; gap: 8px; }
.auth-trust-row i {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: var(--auth-navy);
    background: var(--auth-lime);
    font-size: 12px;
    font-style: normal;
}
.auth-story-footer { margin: 0; color: rgba(255,255,255,.5); font-size: 13px; }
.auth-story-footer span { padding: 0 7px; }

.auth-workspace {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 60px clamp(28px, 6vw, 96px) 88px;
    background:
        linear-gradient(rgba(255,255,255,.75), rgba(255,255,255,.75)),
        repeating-linear-gradient(135deg, transparent 0 28px, rgba(37,99,235,.035) 28px 29px),
        #eef3fb;
}
.auth-mobile-brand { display: none; }
.auth-card {
    width: min(100%, 510px);
    padding: clamp(32px, 4vw, 50px);
    border: 1px solid var(--auth-line);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--auth-shadow);
    animation: auth-card-in .55s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes auth-card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.auth-card-header { margin-bottom: 30px; }
.auth-card-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 22px;
    place-items: center;
    border: 1px solid #d8e3f5;
    border-radius: 12px;
    color: var(--auth-green);
    background: var(--auth-mint);
}
.auth-card-icon svg { width: 25px; height: 25px; fill: currentColor; }
.auth-card-header .auth-eyebrow { margin-bottom: 8px; color: var(--auth-green); }
.auth-card-header h1 {
    margin: 0 0 11px;
    color: var(--auth-ink);
    font: 700 clamp(27px, 3vw, 35px)/1.18 "Playfair Display", Georgia, "Times New Roman", serif;
    letter-spacing: -.02em;
}
.auth-card-header > p:last-child { max-width: 430px; margin: 0; color: var(--auth-muted); line-height: 1.65; }
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 30px;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s ease, transform .2s ease;
}
.auth-back:hover { color: var(--auth-green); transform: translateX(-2px); }

.auth-form { display: grid; gap: 21px; }
.auth-field { min-width: 0; }
.auth-field label, .auth-label-row { color: var(--auth-ink); font-size: 14px; font-weight: 700; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; }
.auth-label-row a { color: var(--auth-green); font-size: 13px; font-weight: 700; text-decoration: none; }
.auth-input-wrap { position: relative; margin-top: 8px; }
.auth-input-wrap input {
    width: 100%;
    height: 56px;
    padding: 0 50px 0 48px;
    border: 1px solid #ccd6e7;
    border-radius: 10px;
    outline: none;
    color: var(--auth-ink);
    background: #fbfcff;
    box-shadow: 0 1px 2px rgba(15,30,61,.03);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-input-wrap input::placeholder { color: #98a4bb; }
.auth-input-wrap input:hover { border-color: #9eb1d0; }
.auth-input-wrap input:focus { border-color: var(--auth-green); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.auth-input-icon { position: absolute; z-index: 1; width: 20px; height: 20px; left: 17px; top: 18px; fill: #7888a8; pointer-events: none; }

.password-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--auth-green); background: var(--auth-mint); outline: none; }
.password-toggle svg { width: 21px; height: 21px; fill: currentColor; }
.password-toggle.is-visible::after {
    position: absolute;
    width: 23px;
    height: 2px;
    content: "";
    transform: rotate(-42deg);
    border-radius: 2px;
    background: currentColor;
}

.auth-check { display: inline-flex; width: max-content; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 14px; cursor: pointer; }
.auth-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.auth-check > span { display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid #b7c2d8; border-radius: 5px; background: #fff; }
.auth-check input:checked + span { border-color: var(--auth-green); background: var(--auth-green); }
.auth-check input:checked + span::after { width: 5px; height: 9px; content: ""; transform: translateY(-1px) rotate(45deg); border: solid #fff; border-width: 0 2px 2px 0; }
.auth-check input:focus-visible + span { box-shadow: 0 0 0 4px rgba(37,99,235,.12); }

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 22px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 10px 22px rgba(37,99,235,.22);
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(37,99,235,.28); filter: saturate(1.08); }
.auth-submit:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 3px; }
.auth-submit:disabled { transform: none; opacity: .75; cursor: wait; }
.auth-submit svg { width: 20px; height: 20px; fill: currentColor; }
.auth-submit.is-loading svg { width: 18px; height: 18px; animation: auth-spin .8s linear infinite; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; fill: transparent; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.field-validation, .validation-summary { color: var(--auth-danger); font-size: 13px; }
.field-validation:not(:empty) { display: block; margin-top: 6px; }
.validation-summary:empty, .validation-summary-valid, .field-validation-valid { display: none; }
.validation-summary ul { margin: 0; padding: 12px 12px 12px 34px; border-radius: 10px; background: #fff1f2; }
.auth-input-wrap input.input-validation-error { border-color: var(--auth-danger); background: #fffafa; }

.auth-alert { display: flex; align-items: flex-start; gap: 11px; margin: -8px 0 24px; padding: 13px 14px; border: 1px solid #fecaca; border-radius: 12px; color: #b91c1c; background: #fef2f2; }
.auth-alert > span, .auth-info-strip > span { display: grid; flex: 0 0 auto; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--auth-danger); font-size: 13px; font-weight: 800; }
.auth-alert strong, .auth-alert small { display: block; }
.auth-alert small { margin-top: 2px; color: #dc2626; }
.auth-info-strip { display: flex; align-items: flex-start; gap: 11px; margin-top: 25px; padding: 15px; border-radius: 13px; color: #334066; background: #eaf2ff; font-size: 13px; }
.auth-info-strip > span { background: var(--auth-green); }
.auth-info-strip p { margin: 0; }
.auth-info-strip strong { display: block; color: var(--auth-ink); }
.auth-security-note { margin: 24px 0 0; color: #8290aa; font-size: 12px; text-align: center; }
.auth-security-note span { padding-right: 5px; color: var(--auth-green); font-size: 10px; }

.password-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.password-strength > span { height: 4px; border-radius: 999px; background: #e3e9f4; transition: background .2s ease; }
.password-strength small { grid-column: 1 / -1; margin-top: 3px; color: #8190aa; font-size: 12px; }
.password-strength[data-level="1"] > span:nth-child(-n+1) { background: #d86464; }
.password-strength[data-level="2"] > span:nth-child(-n+2) { background: #e2a63b; }
.password-strength[data-level="3"] > span:nth-child(-n+3) { background: #16a34a; }
.password-strength[data-level="4"] > span:nth-child(-n+4) { background: var(--auth-green); }

.auth-help { position: absolute; right: 0; bottom: 24px; left: 0; margin: 0; color: #8190aa; font-size: 13px; text-align: center; }
.auth-help a { font-weight: 700; text-decoration: none; }

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-story { display: none; }
    .auth-workspace { padding-top: 112px; }
    .auth-mobile-brand { position: absolute; top: 30px; left: 50%; display: inline-flex; transform: translateX(-50%); color: var(--auth-ink); }
    .auth-mobile-brand .auth-brand-mark { background: var(--auth-mint); }
    .auth-mobile-brand .auth-brand-cross { fill: var(--auth-navy); }
}

@media (max-width: 600px) {
    .auth-workspace { display: block; padding: 96px 16px 72px; background: #eef3fb; }
    .auth-mobile-brand { top: 23px; font-size: 21px; }
    .auth-mobile-brand .auth-brand-mark { width: 38px; height: 38px; }
    .auth-card { width: 100%; padding: 27px 22px; border-radius: 16px; box-shadow: 0 18px 45px rgba(10,23,48,.11); }
    .auth-card-header { margin-bottom: 25px; }
    .auth-card-icon { width: 47px; height: 47px; margin-bottom: 18px; }
    .auth-card-header h1 { font-size: 27px; }
    .auth-label-row { align-items: flex-start; }
    .auth-help { bottom: 18px; }
}

@media (max-height: 780px) and (min-width: 981px) {
    .auth-workspace { align-items: flex-start; padding-top: 32px; padding-bottom: 60px; }
    .auth-card { padding-top: 32px; padding-bottom: 32px; }
    .auth-card-header { margin-bottom: 23px; }
    .auth-card-icon { margin-bottom: 16px; }
    .auth-form { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
