/* =========================================================================
   LOGIN — operator console sign-in

   A single card over an animated energy field. The card is opaque and
   high-contrast so the moving background behind it never costs legibility:
   the animation is atmosphere, the form is the job.

   Reuses the instrument design tokens, so this reads as the same system's
   front door rather than a separate product.
   ========================================================================= */

.login {
    margin: 0;
    min-height: 100vh;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--f-ui);
    overflow: hidden;
}

/* The animated canvas sits behind everything and takes no input. */
.login__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* A vignette pulls focus to the middle and keeps the wave traces from
   crowding the card's edges. */
.login__stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: radial-gradient(
        ellipse 70% 60% at 50% 50%,
        transparent 0%,
        color-mix(in srgb, var(--ground) 72%, transparent) 62%,
        var(--ground) 100%
    );
}

/* -------------------------------------------------------------------------
   CARD
   ------------------------------------------------------------------------- */
.login__card {
    position: relative;
    width: 100%;
    max-width: 396px;
    padding: 26px 26px 20px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    box-shadow:
        0 24px 64px -20px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Machined bracket marks, as on the dashboard's instrument panels. */
.login__card::before,
.login__card::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    border-color: var(--live);
    border-style: solid;
    pointer-events: none;
    opacity: 0.55;
}
.login__card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.login__card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* -------------------------------------------------------------------------
   BRAND
   ------------------------------------------------------------------------- */
.login__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.login__bolt {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid var(--live-dim);
    border-radius: 4px;
    background: var(--live-wash);
    color: var(--live);
    box-shadow: 0 0 18px -6px var(--live-glow);
}

.login__title {
    margin: 0;
    font-family: var(--f-read);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    line-height: 1.15;
}

.login__sub {
    margin: 2px 0 0;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* Energised rule under the brand, as on a panel header. */
.login__rule {
    height: 1px;
    margin-bottom: 20px;
    background: linear-gradient(
        90deg,
        var(--live),
        color-mix(in srgb, var(--live) 22%, transparent) 42%,
        transparent 78%
    );
    opacity: 0.6;
}

/* -------------------------------------------------------------------------
   FORM
   ------------------------------------------------------------------------- */
.login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.login__input {
    width: 100%;
    padding: 11px 12px;
    background: var(--recess);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    color: var(--ink);
    font-family: var(--f-ui);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login__input::placeholder { color: var(--ink-4); }

.login__input:focus {
    outline: none;
    border-color: var(--live);
    box-shadow: 0 0 0 3px var(--live-wash);
}

/* Password field with its reveal control. */
.login__wrap { position: relative; }
.login__wrap .login__input { padding-right: 42px; }

.login__peek {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
}
.login__peek:hover { color: var(--ink); background: var(--panel-3); }
.login__peek--on { color: var(--live); }

.login__remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
}

.login__remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--live);
    cursor: pointer;
}

.login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    border: 1px solid var(--live);
    border-radius: 3px;
    background: var(--live);
    color: #0f1115;
    font-family: var(--f-read);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.login__submit:hover {
    background: color-mix(in srgb, var(--live) 86%, #fff);
    box-shadow: 0 0 22px -6px var(--live-glow);
}

.login__submit:active { transform: translateY(1px); }

.login__submit svg { transition: transform 0.18s ease; }
.login__submit:hover svg { transform: translateX(3px); }

/* -------------------------------------------------------------------------
   ERROR
   ------------------------------------------------------------------------- */
.login__alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--crit) 42%, transparent);
    border-radius: 3px;
    background: var(--crit-wash);
    color: var(--crit);
    font-size: 12.5px;
    line-height: 1.4;
}

.login__alert svg { flex: none; }

/* -------------------------------------------------------------------------
   FOOT
   ------------------------------------------------------------------------- */
.login__foot {
    margin: 18px 0 0;
    text-align: center;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
}

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .login__card { padding: 20px 18px 16px; }
    .login__title { font-size: 16px; }
    .login__bolt { width: 34px; height: 34px; }
}

/* The canvas already draws a static frame under a reduced-motion preference;
   this only removes the interface's own transitions. */
@media (prefers-reduced-motion: reduce) {
    .login__submit,
    .login__submit svg,
    .login__input { transition: none; }
}
