:root {
  --bg: #020711;
  --bg-deep: #01040a;
  --text: #dceaf5;
  --muted: #61758a;

  --blue: #56c8ff;
  --blue-soft: rgba(86, 200, 255, 0.18);
  --blue-line: rgba(86, 200, 255, 0.36);
  --blue-focus: rgba(152, 226, 255, 0.95);

  --pad-x: clamp(24px, 5vw, 84px);
  --pad-y: clamp(24px, 5vh, 58px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
}

input,
button {
  font: inherit;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;

  background:
    radial-gradient(
      circle at 78% 24%,
      rgba(29, 126, 205, 0.08),
      transparent 26%
    ),
    radial-gradient(
      circle at 18% 82%,
      rgba(32, 114, 197, 0.05),
      transparent 24%
    ),
    linear-gradient(
      140deg,
      #061427 0%,
      #020914 48%,
      #01040b 100%
    );
}


/* =========================================================
   BACKGROUND 404
   ========================================================= */

.ghost-404 {
  position: absolute;
  z-index: -3;
  left: -0.035em;
  top: 47%;
  transform: translateY(-50%);

  margin: 0;

  font-size: clamp(240px, 34vw, 650px);
  line-height: 0.72;
  font-weight: 800;
  letter-spacing: -0.085em;

  color: transparent;
  -webkit-text-stroke: 1px rgba(104, 194, 255, 0.11);

  text-shadow:
    0 0 60px rgba(44, 138, 220, 0.035);

  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.ghost-404::after {
  content: "404";
  position: absolute;
  inset: 0;

  color: rgba(22, 69, 112, 0.045);
  -webkit-text-stroke: 0;

  filter: blur(1px);
}

.scanline {
  position: absolute;
  z-index: -2;

  top: 0;
  right: 7.5vw;

  width: 1px;
  height: 100%;

  background:
    linear-gradient(
      180deg,
      transparent 5%,
      rgba(90, 197, 255, 0.16) 24%,
      rgba(116, 215, 255, 0.56) 51%,
      rgba(59, 157, 239, 0.12) 78%,
      transparent 96%
    );

  box-shadow:
    0 0 12px rgba(90, 197, 255, 0.24),
    0 0 44px rgba(41, 136, 224, 0.10);

  pointer-events: none;
}


/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
  position: absolute;
  z-index: 4;

  top: max(var(--pad-y), env(safe-area-inset-top));
  left: var(--pad-x);
  right: var(--pad-x);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-mark {
  display: block;

  width: clamp(140px, 11vw, 190px);
  height: auto;

  /* darker electric-blue body */
  color: #0b5980;
  fill: currentColor;

  opacity: 0.28;

  /* bright cyan electric halo around the darker logo */
  filter:
    drop-shadow(0 0 1px rgba(170, 235, 255, 0.95))
    drop-shadow(0 0 2px rgba(86, 200, 255, 0.85))
    drop-shadow(0 0 3px rgba(49, 165, 255, 0.48))
    drop-shadow(0 0 3px rgba(27, 117, 230, 0.24));
}

.timecode {
  color: #61758a;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;

  font-size: 11px;
  letter-spacing: 0.22em;
}


/* =========================================================
   CONTENT
   ========================================================= */

.content {
  position: relative;
  z-index: 2;

  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  align-items: center;

  padding:
    max(96px, calc(var(--pad-y) + 54px))
    var(--pad-x)
    max(56px, env(safe-area-inset-bottom));
}

.error-block {
  width: min(100%, 680px);
  margin-left: clamp(0px, 5vw, 86px);
}

.status-row {
  display: flex;
  align-items: baseline;
  gap: 16px;

  margin: 0 0 18px;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
}

.status-code {
  color: #407d94;

  font-size: clamp(26px, 2.2vw, 38px);
  font-weight: 700;
  line-height: 1;

  letter-spacing: -0.03em;

  text-shadow:
    0 0 1px rgba(86, 200, 255, 0.55),
    0 0 6px rgba(86, 200, 255, 0.18);
}

.status-text {
  color: #7890a4;

  font-size: clamp(11px, 0.8vw, 13px);
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;

  color: #e5f1f9;

  font-size: clamp(44px, 6vw, 92px);
  line-height: 0.95;
  font-weight: 300;
  letter-spacing: -0.045em;
}

.message {
  margin: 22px 0 0;

  color: #667d91;

  font-size: clamp(14px, 1.05vw, 17px);
  font-weight: 350;
  letter-spacing: 0.005em;
}


/* =========================================================
   LOGIN FIELDS
   ========================================================= */

.login-form {
  width: min(100%, 510px);

  margin-top: clamp(44px, 6vh, 76px);

  display: grid;
  gap: 22px;
}

.field-wrap {
  position: relative;
}

.field {
  appearance: none;
  -webkit-appearance: none;

  display: block;

  width: 100%;
  height: 48px;

  border: 0;
  border-bottom: 1px solid rgba(100, 158, 196, 0.38);
  border-radius: 0;
  outline: none;

  padding: 0 2px;

  background: transparent;

  color: #edf8ff;
  caret-color: var(--blue);

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;

  font-size: 15px;
  letter-spacing: 0.04em;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field-wrap::after {
  content: "";

  position: absolute;

  left: 0;
  right: 100%;
  bottom: 0;

  height: 1px;

  background: var(--blue);

  box-shadow:
    0 0 8px rgba(86, 200, 255, 0.70),
    0 0 22px rgba(86, 200, 255, 0.24);

  transition: right 180ms ease;

  pointer-events: none;
}

.field-wrap:focus-within::after {
  right: 0;
}

.field:focus {
  border-bottom-color: rgba(137, 221, 255, 0.56);
}

.field::selection {
  background: rgba(86, 200, 255, 0.22);
}

.hint {
  margin-top: 1px;

  color: #3f5568;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;

  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;

  user-select: none;
}


/* =========================================================
   BOTTOM META
   ========================================================= */

.bottom-meta {
  position: absolute;
  z-index: 4;

  right: var(--pad-x);
  bottom: max(var(--pad-y), env(safe-area-inset-bottom));

  display: flex;
  align-items: center;
  gap: 12px;

  color: #43586a;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;

  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.bottom-meta::before {
  content: "";

  width: 28px;
  height: 1px;

  background: rgba(86, 200, 255, 0.46);

  box-shadow:
    0 0 7px rgba(86, 200, 255, 0.24);
}


/* =========================================================
   ACCESSIBILITY HELPERS
   ========================================================= */

.hidden-submit,
.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;

  opacity: 0;

  pointer-events: none;
}

.sr-only {
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* =========================================================
   LARGE / ULTRAWIDE
   ========================================================= */

@media (min-width: 1700px) {
  .error-block {
    margin-left: clamp(80px, 8vw, 180px);
  }

  .ghost-404 {
    font-size: min(35vw, 720px);
  }

  .brand-mark {
    width: clamp(160px, 9vw, 210px);
  }
}


/* =========================================================
   TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 1000px) {
  .error-block {
    margin-left: 0;
    width: min(100%, 620px);
  }

  .ghost-404 {
    left: -0.12em;
    font-size: clamp(230px, 42vw, 430px);
  }

  .scanline {
    right: 5vw;
  }

  .brand-mark {
    width: clamp(135px, 16vw, 175px);
  }
}


/* =========================================================
   TABLET PORTRAIT / LARGE PHONES
   ========================================================= */

@media (max-width: 760px) {
  body {
    overflow-y: auto;
  }

  .topbar {
    top: max(22px, env(safe-area-inset-top));
    left: 22px;
    right: 22px;
  }

  .brand-mark {
    width: 135px;
  }

  .timecode {
    display: none;
  }

  .content {
    padding:
      max(94px, calc(env(safe-area-inset-top) + 72px))
      22px
      max(72px, env(safe-area-inset-bottom));

    align-items: center;
  }

  .ghost-404 {
    left: -0.30em;
    top: 39%;

    font-size: clamp(220px, 66vw, 390px);

    -webkit-text-stroke-color: rgba(104, 194, 255, 0.015);
  }

  .error-block {
    width: 100%;
  }

  h1 {
    font-size: clamp(46px, 11vw, 70px);
  }

  .login-form {
    width: 100%;
    max-width: 520px;

    margin-top: 48px;
  }

  .bottom-meta {
    right: 22px;
    bottom: max(22px, env(safe-area-inset-bottom));
  }

  .scanline {
    right: 22px;
    opacity: 0.62;
  }
}


/* =========================================================
   IPHONE / SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {
  .page {
    background:
      radial-gradient(
        circle at 86% 24%,
        rgba(25, 113, 193, 0.08),
        transparent 28%
      ),
      linear-gradient(
        155deg,
        #061427 0%,
        #020914 56%,
        #01040b 100%
      );
  }

  .brand-mark {
    width: 120px;
  }

  .ghost-404 {
    left: -0.44em;
    top: 35%;

    font-size: clamp(210px, 82vw, 330px);
  }

  @media (max-width: 480px) {
  .status-row {
    gap: 10px;
  }

  .status-code {
    font-size: 24px;
  }

  .status-text {
    font-size: 10px;
  }
}
  
  .status {
    font-size: 10px;
  }

  .message {
    max-width: 29ch;
  }

  .login-form {
    margin-top: 42px;
    gap: 18px;
  }

  .field {
    height: 46px;

    /* Prevents automatic Safari zoom on focus */
    font-size: 16px;
  }

  .hint {
    font-size: 9px;
  }
}


/* =========================================================
   LANDSCAPE PHONE
   ========================================================= */

@media (max-height: 540px) and (orientation: landscape) {
  body {
    overflow-y: auto;
  }

  .content {
    min-height: 100dvh;

    padding:
      max(72px, calc(env(safe-area-inset-top) + 56px))
      max(28px, env(safe-area-inset-right))
      max(30px, env(safe-area-inset-bottom))
      max(28px, env(safe-area-inset-left));
  }

  .error-block {
    width: min(62vw, 590px);
  }

  h1 {
    font-size: clamp(40px, 8vh, 62px);
  }

  .message {
    margin-top: 12px;
  }

  .login-form {
    margin-top: 24px;
    gap: 12px;
  }

  .field {
    height: 40px;
  }

  .bottom-meta {
    display: none;
  }

  .ghost-404 {
    left: auto;
    right: -0.14em;
    top: 52%;

    font-size: 46vh;

    opacity: 0.8;
  }

  .brand-mark {
    width: 120px;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .field,
  .field-wrap::after {
    transition: none;
  }
}
