:root {
    --ink: #07060c;
    --ink-2: #100e18;
    --fog: #f4f0e8;
    --fog-dim: rgba(244, 240, 232, 0.58);
    --line: rgba(244, 240, 232, 0.12);
    --signal: #d6ff3f;
    --signal-deep: #9dcc14;
    --violet: #8b7cff;
    --magenta: #ff4d9a;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-2: rgba(255, 255, 255, 0.07);
    --danger: #ff6b7a;
    --ok: #b8ff6a;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --mx: 50%;
    --my: 40%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

html {
    color-scheme: dark;
}

body.login-body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: var(--ink);
    color: var(--fog);
    font-family: Outfit, system-ui, sans-serif;
    overflow: hidden;
}

.login-stage {
    position: relative;
    min-height: 100dvh;
    display: grid;
    isolation: isolate;
}

.login-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px circle at var(--mx) var(--my), rgba(214, 255, 63, 0.09), transparent 42%),
        radial-gradient(70% 80% at 12% 18%, rgba(139, 124, 255, 0.22), transparent 55%),
        radial-gradient(55% 60% at 88% 82%, rgba(255, 77, 154, 0.14), transparent 50%),
        linear-gradient(180deg, #08070d 0%, #0b1220 100%);
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

.orb-a {
    width: 38vw;
    height: 38vw;
    max-width: 520px;
    max-height: 520px;
    left: -8%;
    top: -12%;
    background: radial-gradient(circle, rgba(214, 255, 63, 0.45), transparent 68%);
    animation: drift 16s var(--ease) infinite alternate;
}

.orb-b {
    width: 42vw;
    height: 42vw;
    max-width: 560px;
    max-height: 560px;
    right: -10%;
    bottom: -18%;
    background: radial-gradient(circle, rgba(139, 124, 255, 0.5), transparent 70%);
    animation: drift 22s ease-in-out infinite alternate-reverse;
}

.orb-c {
    width: 24vw;
    height: 24vw;
    max-width: 280px;
    max-height: 280px;
    left: 42%;
    top: 58%;
    background: radial-gradient(circle, rgba(255, 77, 154, 0.28), transparent 70%);
    animation: drift 18s ease-in-out infinite alternate;
}

.grain,
.grid-floor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.grain {
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.grid-floor {
    top: auto;
    height: 48%;
    background-image:
        linear-gradient(rgba(214, 255, 63, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(214, 255, 63, 0.09) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: perspective(520px) rotateX(62deg);
    transform-origin: bottom center;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 78%);
}

.login-shell {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 100dvh;
}

.login-brand,
.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
}

.login-brand {
    padding: 2.4rem 3.4rem 2rem;
    justify-content: space-between;
    overflow: hidden;
}

.brand-top,
.login-panel-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(214, 255, 63, 0.12);
    border: 1px solid rgba(214, 255, 63, 0.28);
    box-shadow: 0 0 28px rgba(214, 255, 63, 0.12);
}

.mark svg {
    width: 22px;
    height: 22px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-lockup strong {
    font-family: Syne, sans-serif;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.brand-lockup span {
    margin-top: 0.2rem;
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--fog-dim);
}

.brand-logo {
    height: 42px;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.live-chip {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fog-dim);
}

.live-chip i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 12px var(--signal);
    animation: pulse 2.2s ease-in-out infinite;
}

.brand-copy {
    max-width: 640px;
    padding: 2rem 0 3rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--signal);
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--signal);
}

.brand-copy h1 {
    margin: 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.6rem, 5.4vw, 5.1rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
}

.brand-copy h1 em {
    font-style: italic;
    color: var(--signal);
}

.brand-copy p {
    max-width: 34rem;
    margin: 1.5rem 0 0;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--fog-dim);
    font-weight: 300;
}

.signals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2.1rem;
}

.signals span {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1rem;
}

.ticker {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--fog-dim);
}

.ticker-track {
    display: inline-flex;
    gap: 1.6rem;
    white-space: nowrap;
    animation: marquee 28s linear infinite;
}

.stamp {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fog-dim);
}

.login-panel {
    justify-content: center;
    padding: 2.4rem 3.2rem;
}

.panel-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    padding: 2.1rem 2rem 1.6rem;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.panel-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(214, 255, 63, 0.55), rgba(255, 255, 255, 0.08) 38%, rgba(139, 124, 255, 0.45));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none;
}

.panel-card.is-error {
    animation: shake 0.42s var(--ease);
}

.panel-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--signal);
}

.panel-card h2 {
    margin: 0 0 0.4rem;
    font-family: Syne, sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.panel-card > p.lead {
    margin: 0 0 1.6rem;
    color: var(--fog-dim);
    font-size: 0.92rem;
    line-height: 1.5;
}

.login-alert {
    display: none;
    margin-bottom: 1.15rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.login-alert.is-visible {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.login-alert.is-ok {
    background: rgba(184, 255, 106, 0.1);
    color: var(--ok);
    border: 1px solid rgba(184, 255, 106, 0.28);
}

.login-alert.is-bad,
.login-alert.is-warn {
    background: rgba(255, 107, 122, 0.1);
    color: #ffc4cb;
    border: 1px solid rgba(255, 107, 122, 0.28);
}

.field {
    margin-bottom: 0.95rem;
}

.field-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fog-dim);
}

.control {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 0.85rem 0 2.7rem;
    border-radius: 16px;
    background: rgba(7, 6, 12, 0.45);
    border: 1px solid var(--line);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.control:focus-within {
    border-color: rgba(214, 255, 63, 0.55);
    background: rgba(214, 255, 63, 0.05);
    box-shadow: 0 0 0 4px rgba(214, 255, 63, 0.08);
}

.control i.lead-icon {
    position: absolute;
    left: 0.95rem;
    font-size: 1rem;
    color: rgba(244, 240, 232, 0.42);
}

.control input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--fog);
    font: 500 0.98rem/1 Outfit, sans-serif;
}

.control input::placeholder {
    color: rgba(244, 240, 232, 0.32);
}

.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--fog);
    caret-color: var(--fog);
    transition: background-color 9999s ease-out;
    box-shadow: 0 0 0 1000px rgba(7, 6, 12, 0.85) inset;
}

.toggle-pass {
    flex: none;
    width: 36px;
    height: 36px;
    margin-right: -0.25rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(244, 240, 232, 0.5);
    cursor: pointer;
}

.toggle-pass:hover {
    color: var(--fog);
    background: rgba(255, 255, 255, 0.05);
}

.btn-enter {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 0.55rem;
    min-height: 56px;
    border: 0;
    border-radius: 16px;
    background: var(--signal);
    color: #111409;
    font-family: Syne, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
    box-shadow: 0 12px 32px rgba(214, 255, 63, 0.18);
}

.btn-enter::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.45), transparent 55%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease);
}

.btn-enter:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 18px 40px rgba(214, 255, 63, 0.28);
}

.btn-enter:hover::after {
    transform: translateX(120%);
}

.btn-enter:active {
    transform: translateY(0);
}

.btn-enter:disabled {
    cursor: wait;
    transform: none;
    filter: saturate(0.7);
}

.panel-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.35rem;
    font-size: 0.72rem;
    color: var(--fog-dim);
}

.panel-meta b {
    color: var(--fog);
    font-weight: 600;
}

.hint {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    color: rgba(244, 240, 232, 0.38);
    text-align: center;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(4%, 6%, 0) scale(1.08); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-copy,
.panel-card {
    animation: rise 0.8s var(--ease) both;
}

.panel-card {
    animation-delay: 0.12s;
}

@media (max-width: 980px) {
    body.login-body {
        overflow: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .grid-floor {
        display: none;
    }

    .login-brand {
        min-height: auto;
        padding: 1.4rem 1.4rem 0.4rem;
    }

    .brand-copy {
        padding: 1.4rem 0 1.2rem;
    }

    .brand-copy h1 {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
    }

    .brand-copy p,
    .live-chip,
    .brand-footer {
        display: none;
    }

    .login-panel {
        padding: 0.8rem 1.15rem 2rem;
        justify-content: flex-start;
    }

    .panel-card {
        margin: 0 auto;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .orb,
    .ticker-track,
    .live-chip i,
    .brand-copy,
    .panel-card,
    .btn-enter::after {
        animation: none !important;
        transition: none !important;
    }
}
