/*
 * Login and registration: one card with Log in / Create account tabs over an animated,
 * illustrated aerial. The scene is drawn in SVG, so no map tiles are requested here.
 */
body.shell.ws.ws-auth {
    --auth-navy: #0b1430;
    --auth-blue: #2563eb;
    --auth-blue-dark: #1d4ed8;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #dfe5ee;
    position: relative;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--auth-navy);
    color: #e8eef8;
    font-family: var(--ws-font);
}

/* Scene */
.auth-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.auth-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(8, 15, 38, 0.86) 0%, rgba(8, 15, 38, 0.55) 34%, rgba(8, 15, 38, 0.08) 58%, rgba(8, 15, 38, 0.5) 100%),
        linear-gradient(180deg, rgba(8, 15, 38, 0.45) 0%, transparent 22%, transparent 78%, rgba(8, 15, 38, 0.7) 100%);
}
.sp-scene {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    display: block;
    animation: sp-drift 38s ease-in-out infinite alternate;
    transform-origin: 30% 70%;
}
@keyframes sp-drift {
    from { transform: scale(1) translate(0, 0); }
    to { transform: scale(1.07) translate(-1.6%, -1.2%); }
}
.sp-traffic { animation: sp-flow 3.2s linear infinite; opacity: 0.85; }
.sp-traffic.is-back { animation-duration: 4.4s; animation-direction: reverse; opacity: 0.6; }
@keyframes sp-flow { to { stroke-dashoffset: -216; } }

.sp-ring, .sp-ring-static { fill: none; stroke: #fff; }
.sp-ring {
    stroke-width: 2.5;
    transform-box: view-box;
    transform-origin: 400px 760px;
    animation: sp-ring 5.4s cubic-bezier(.2, .6, .3, 1) infinite;
    opacity: 0;
}
.sp-ring.is-2 { animation-delay: 1.8s; }
.sp-ring.is-3 { animation-delay: 3.6s; }
.sp-ring-static { stroke-width: 2; stroke-dasharray: 10 10; opacity: 0.55; }
@keyframes sp-ring {
    0% { transform: scale(0.35); opacity: 0.9; }
    100% { transform: scale(2.3); opacity: 0; }
}

.sp-parcel {
    fill: rgba(255, 59, 48, 0.22);
    stroke: #ff3b30;
    stroke-width: 4;
    stroke-linejoin: round;
    stroke-dasharray: 560;
    stroke-dashoffset: 560;
    animation: sp-draw 1.4s 0.3s ease-out forwards;
}
@keyframes sp-draw { to { stroke-dashoffset: 0; } }

.sp-plate text {
    fill: #fff;
    font: 700 15px/1 Inter, Arial, sans-serif;
    letter-spacing: 0.06em;
}
.sp-plate { opacity: 0; animation: sp-fade 0.6s 0.5s ease-out forwards; }

.sp-leader {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
    animation: sp-draw 0.8s var(--d) ease-out forwards;
}
.sp-dot { fill: #fff; opacity: 0; animation: sp-fade 0.3s calc(var(--d) + 0.6s) forwards; }

.sp-card {
    transform-box: fill-box;
    transform-origin: center;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
    opacity: 0;
    animation:
        sp-pop 0.55s var(--d) cubic-bezier(.2, 1.4, .4, 1) forwards,
        sp-float 5.5s calc(var(--d) + 0.6s) ease-in-out infinite alternate;
}
.sp-card text { fill: #0f172a; font: 700 17px/1 Inter, Arial, sans-serif; }
@keyframes sp-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.6); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sp-float {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-7px); }
}

.sp-pin {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: sp-drop 0.9s 0.2s cubic-bezier(.3, 1.5, .5, 1) both, sp-bob 2.6s 1.2s ease-in-out infinite;
    filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
@keyframes sp-drop {
    from { transform: translateY(-120px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes sp-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.sp-subject-label { opacity: 0; animation: sp-fade 0.5s 1s forwards; }
.sp-subject-label text,
.sp-traffic-pill text { font: 800 13px/1 Inter, Arial, sans-serif; letter-spacing: 0.08em; }
.sp-subject-label text { fill: #fff; }
.sp-traffic-pill text { fill: #13254f; }
.sp-traffic-pill { opacity: 0; animation: sp-fade 0.6s 1.9s forwards; }
@keyframes sp-fade { to { opacity: 1; } }

/* Page frame */
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 22px clamp(18px, 4vw, 56px) 18px;
}
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.auth-brand:hover { color: #fff; }
.auth-brand strong { font: 800 23px/1 var(--ws-font); letter-spacing: -0.02em; color: #fff; }
.auth-brand svg { filter: drop-shadow(0 4px 10px rgba(47, 99, 196, 0.55)); }
.auth-top-link {
    color: #dbe5f6;
    font: 600 13px/1 var(--ws-font);
    text-decoration: none;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(11, 20, 48, 0.35);
    backdrop-filter: blur(6px);
    transition: background 160ms ease, border-color 160ms ease;
}
.auth-top-link:hover { color: #fff; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.4); }

body.shell.ws.ws-auth main.auth-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 452px);
    gap: clamp(28px, 6vw, 96px);
    align-items: center;
}

/* Pitch */
.auth-pitch { display: grid; gap: 18px; align-content: start; align-self: start; padding-top: 2vh; max-width: 640px; }
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(142, 182, 255, 0.35);
    color: #c9dbff;
    font: 700 11px/1 var(--ws-font);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.auth-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); animation: auth-live 2s infinite; }
@keyframes auth-live {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.auth-pitch h1 {
    margin: 0;
    color: #fff;
    font: 800 clamp(28px, 3vw, 42px)/1.1 var(--ws-font);
    letter-spacing: -0.035em;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.auth-pitch h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #8eb6ff, #ffd60a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-lede { margin: 0; max-width: 560px; color: #c5d3ea; font: 400 15px/1.6 var(--ws-font); }
.auth-flow { list-style: none; max-width: 520px; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.auth-flow li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(11, 20, 48, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}
.auth-flow li > span {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--auth-blue);
    color: #fff;
    font: 700 12px/1 var(--ws-font);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}
.auth-flow strong { display: block; color: #fff; font: 700 13px/1.2 var(--ws-font); }
.auth-flow small { display: block; color: #9fb0cc; font: 500 11.5px/1.3 var(--ws-font); }
/* Card */
.auth-card {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 28px 28px 24px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--auth-ink);
    box-shadow: 0 30px 70px rgba(2, 8, 28, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    animation: auth-rise 0.6s cubic-bezier(.2, .9, .3, 1) both;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 24px auto;
    height: 4px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, #2563eb, #5b8ee6 45%, #ffd60a 100%);
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.auth-card-head { display: grid; gap: 6px; }
.auth-card-head h2 { margin: 0; color: var(--auth-ink); font: 800 26px/1.15 var(--ws-font); letter-spacing: -0.025em; }
.auth-card-head p { margin: 0; color: var(--auth-muted); font: 400 14px/1.45 var(--ws-font); }

.auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: 14px;
    background: #eef2f8;
    border: 1px solid #e2e8f1;
}
.auth-tabs a {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    height: 40px;
    border-radius: 10px;
    color: #475569;
    font: 700 14px/1 var(--ws-font);
    text-decoration: none;
    transition: color 200ms ease;
}
.auth-tabs a:hover { color: var(--auth-ink); }
.auth-tabs a[aria-selected="true"] { color: var(--auth-blue-dark); }
.auth-tabs-thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.12);
    transition: transform 320ms cubic-bezier(.3, .9, .3, 1);
}
.auth-card[data-tab="register"] .auth-tabs-thumb { transform: translateX(100%); }

.auth-pane { display: grid; gap: 14px; margin: 0; animation: auth-pane 0.35s ease-out both; }
.auth-pane[hidden] { display: none; }
@keyframes auth-pane {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.auth-field { display: grid; gap: 6px; margin: 0; color: #334155; font: 600 12.5px/1.3 var(--ws-font); }
.auth-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.auth-field-head label { margin: 0; color: #334155; font: 600 12.5px/1.3 var(--ws-font); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-input { position: relative; display: block; }
.auth-input > svg {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 160ms ease;
}
body.shell.ws.ws-auth .auth-input input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 40px;
    border: 1.5px solid var(--auth-line);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--auth-ink);
    font: 500 14.5px/1 var(--ws-font);
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
body.shell.ws.ws-auth .auth-input input::placeholder { color: #a3afc0; font-weight: 400; }
body.shell.ws.ws-auth .auth-input input:hover { border-color: #c7d2e2; }
body.shell.ws.ws-auth .auth-input input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}
.auth-input:focus-within > svg { color: var(--auth-blue); }
.auth-input:has(.auth-reveal) input { padding-right: 70px; }
body.shell.ws.ws-auth .auth-reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-blue);
    font: 700 12px/1 var(--ws-font);
    box-shadow: none;
    cursor: pointer;
}
body.shell.ws.ws-auth .auth-reveal:hover { background: #eaf1ff; color: var(--auth-blue-dark); transform: translateY(-50%); box-shadow: none; }

.auth-link, .auth-switch a, .auth-check a { color: var(--auth-blue); font-weight: 700; text-decoration: none; }
.auth-link { font: 700 12px/1 var(--ws-font); }
.auth-link:hover, .auth-switch a:hover, .auth-check a:hover { color: var(--auth-blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: #334155;
    font: 500 13px/1.45 var(--ws-font);
    cursor: pointer;
}
body.shell.ws.ws-auth .auth-check input { flex: none; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--auth-blue); }

body.shell.ws.ws-auth .auth-submit {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 2px;
    padding: 0 20px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 45%, #1e40af 100%);
    color: #fff;
    font: 700 15px/1 var(--ws-font);
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}
body.shell.ws.ws-auth .auth-submit svg { width: 18px; height: 18px; transition: transform 200ms ease; }
body.shell.ws.ws-auth .auth-submit::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    transition: left 600ms ease;
}
body.shell.ws.ws-auth .auth-submit:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
body.shell.ws.ws-auth .auth-submit:hover::after { left: 120%; }
body.shell.ws.ws-auth .auth-submit:hover svg { transform: translateX(4px); }
body.shell.ws.ws-auth .auth-submit:active { transform: translateY(0); }

.auth-switch { margin: 0; text-align: center; color: var(--auth-muted); font: 500 13px/1.4 var(--ws-font); }
.auth-notice { margin: 0; padding: 10px 12px; border-radius: 10px; font: 600 13px/1.4 var(--ws-font); }
.auth-notice.is-bad { color: #b42318; background: #fdecec; border: 1px solid #f7c9c4; }
.auth-notice.is-ok { color: #146c3c; background: #e9f8ef; border: 1px solid #bfe5cc; }
.auth-notice.is-info { color: #1d4ed8; background: #eaf1ff; border: 1px solid #cddcff; }

.auth-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    color: #94a3c2;
    font: 500 12.5px/1.4 var(--ws-font);
}
.auth-foot a { color: #b8c6de; text-decoration: none; }
.auth-foot a:hover { color: #fff; }

@media (max-width: 960px) {
    body.shell.ws.ws-auth main.auth-main { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; }
    .auth-pitch { padding-top: 0; max-width: 560px; text-align: center; justify-items: center; }
    .auth-flow { display: none; }
    .auth-pitch h1 br { display: none; }
    .auth-card { width: min(460px, 100%); }
    .auth-scene::after { background: rgba(8, 15, 38, 0.62); }
}
@media (max-width: 520px) {
    .auth-shell { padding: 16px 14px; }
    .auth-pitch h1 { font-size: 30px; }
    .auth-lede { display: none; }
    .auth-card { padding: 24px 18px 20px; border-radius: 18px; }
    .auth-row { grid-template-columns: 1fr; }
    .auth-top-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-scene *, .sp-scene, .auth-card, .auth-pane, .auth-live-dot { animation: none !important; }
    .sp-parcel, .sp-leader { stroke-dashoffset: 0; }
    .sp-card, .sp-dot, .sp-plate, .sp-subject-label, .sp-traffic-pill { opacity: 1; }
    .sp-ring { opacity: 0.4; }
}
