.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

    /* ── TOKENS ──────────────────────────────────────────── */
    :root {
      --hme84-emerald:       #071f1b;
      --hme84-lime-signal:   #a8d429;

      --bg:            var(--hme84-emerald);
      --bg-surface:    #0c130e;
      --bg-card:       #121a14;
      --bg-elevated:   #182119;

      --border:        rgba(90,160,80,0.09);
      --border-mid:    rgba(90,160,80,0.17);
      --border-strong: rgba(90,160,80,0.28);

      --text-primary:  #EAE8E1;
      --text-secondary:#7E8A80;
      --text-muted:    #455048;
      --text-dim:      #2D3830;

      --live:          var(--hme84-lime-signal);
      --live-dim:      rgba(168,212,41,0.08);
      --live-border:   rgba(168,212,41,0.22);
      --live-glow:     rgba(168,212,41,0.06);

      --dev:           #C8902A;

      --font-serif: 'Cormorant Garamond', Georgia, serif;
      --font-sans:  'Inter', -apple-system, sans-serif;
      --font-mono:  'JetBrains Mono', monospace;

      --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; }

    body {
      background: var(--bg);
      color: var(--text-primary);
      font-family: var(--font-sans);
      font-size: 14px;
      line-height: 1.65;
      -webkit-font-smoothing: antialiased;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      position: relative;
      overflow: hidden;
    }

    /* Grid texture */
    body::before {
      content: '';
      position: fixed; inset: 0; z-index: 0;
      background-image:
        linear-gradient(rgba(55,130,55,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(55,130,55,0.035) 1px, transparent 1px);
      background-size: 52px 52px;
      pointer-events: none;
    }

    /* Subtle radial glow at center */
    body::after {
      content: '';
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 700px; height: 700px;
      background: radial-gradient(ellipse at center, rgba(168,212,41,0.025) 0%, transparent 70%);
      pointer-events: none; z-index: 0;
    }

    /* ── CORNER ELEMENTS ─────────────────────────────────── */
    .corner {
      position: fixed; z-index: 10;
      font-family: var(--font-mono); font-size: 9px;
      letter-spacing: 0.08em; color: var(--text-muted);
    }
    .corner.tl { top: 20px; left: 24px; display: flex; align-items: center; gap: 8px; }
    .corner.tr { top: 20px; right: 24px; text-align: right; }
    .corner.bl { bottom: 20px; left: 24px; }
    .corner.br { bottom: 20px; right: 24px; text-align: right; }

    .corner-live-dot {
      width: 4px; height: 4px; border-radius: 50%;
      background: var(--live);
      animation: pulse 2.4s ease-in-out infinite;
      flex-shrink: 0;
    }
    @keyframes pulse {
      0%,100% { box-shadow: 0 0 0 0 rgba(168,212,41,0.5); }
      50%      { box-shadow: 0 0 0 3px rgba(168,212,41,0); }
    }

    /* Scan line — subtle horizontal sweep */
    .scanline {
      position: fixed; left: 0; right: 0; z-index: 1;
      height: 1px;
      background: linear-gradient(90deg, transparent 10%, rgba(168,212,41,0.08) 50%, transparent 90%);
      animation: scan 8s linear infinite;
      pointer-events: none;
    }
    @keyframes scan {
      0%   { top: -2px; }
      100% { top: 100vh; }
    }

    /* ── MAIN CARD ───────────────────────────────────────── */
    .card {
      position: relative; z-index: 2;
      width: 100%; max-width: 420px;
      margin: 0 24px;
      background: var(--bg-card);
      border: 0.5px solid var(--border-mid);
      border-radius: var(--r-lg);
      overflow: hidden;
    }

    /* Top accent line */
    .card::before {
      content: '';
      position: absolute; top: 0; left: 0; right: 0; height: 1px;
      background: linear-gradient(90deg, transparent 5%, var(--live-border) 30%, var(--live-border) 70%, transparent 95%);
    }

    /* ── CARD HEADER ─────────────────────────────────────── */
    .card-top {
      padding: 28px 32px 24px;
      border-bottom: 0.5px solid var(--border);
      display: flex; flex-direction: column; gap: 16px;
    }

    .brand-row {
      display: flex; align-items: center; justify-content: space-between;
    }
    .brand-lockup {
      display: flex; align-items: center; gap: 8px;
    }
    .brand-lockup .brand-logo {
      display: block;
      height: 49px;
      width: auto;
      max-width: none;
      object-fit: contain;
      flex-shrink: 0;
    }
    .brand-glyph {
      font-family: var(--font-mono); font-size: 13px;
      color: var(--live); letter-spacing: 0.06em;
    }
    .brand-sep {
      font-family: var(--font-mono); font-size: 10px;
      color: var(--text-dim); letter-spacing: 0.04em;
      padding: 0 8px;
    }
    .brand-section {
      font-family: var(--font-mono); font-size: 10px;
      color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
    }
    .access-badge {
      font-family: var(--font-mono); font-size: 9px;
      letter-spacing: 0.1em; text-transform: uppercase;
      padding: 3px 10px; border-radius: 99px;
      background: var(--live-dim); border: 0.5px solid var(--live-border);
      color: var(--live);
      display: flex; align-items: center; gap: 6px;
    }
    .access-badge .d {
      width: 4px; height: 4px; border-radius: 50%;
      background: var(--live);
      animation: pulse 2.4s ease-in-out infinite;
    }

    .title-block { display: flex; flex-direction: column; gap: 6px; }
    .title-eyebrow {
      font-family: var(--font-mono); font-size: 9px;
      letter-spacing: 0.14em; text-transform: uppercase;
      color: var(--text-muted);
      display: flex; align-items: center; gap: 8px;
    }
    .title-eyebrow::before {
      content: ''; display: block;
      width: 14px; height: 0.5px; background: var(--live);
    }
    .title-h1 {
      font-family: var(--font-serif); font-weight: 300;
      font-size: 2.2rem; line-height: 1.05;
      letter-spacing: -0.01em; color: var(--text-primary);
    }
    .title-sub {
      font-size: 12px; color: var(--text-secondary); line-height: 1.55;
    }

    /* ── FORM AREA ───────────────────────────────────────── */
    .card-body {
      padding: 28px 32px 24px;
      display: flex; flex-direction: column; gap: 16px;
    }

    /* Field */
    .field { display: flex; flex-direction: column; gap: 7px; }
    .field-label {
      font-family: var(--font-mono); font-size: 9px;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: var(--text-muted);
      display: flex; align-items: center; justify-content: space-between;
    }
    .field-hint {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-dim); letter-spacing: 0.04em;
    }
    .field-input-wrap { position: relative; }
    .field-input.no-toggle { padding-right: 14px; }
    .field-input {
      width: 100%;
      background: var(--bg-surface);
      border: 0.5px solid var(--border-mid);
      border-radius: var(--r-sm);
      padding: 11px 42px 11px 14px;
      font-family: var(--font-mono); font-size: 13px;
      color: var(--text-primary);
      letter-spacing: 0.08em;
      outline: none;
      transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
      caret-color: var(--live);
    }
    .field-input.no-toggle { padding-right: 14px; }
    .field-input::placeholder {
      color: var(--text-dim); letter-spacing: 0.04em;
      font-size: 11px; font-family: var(--font-mono);
    }
    .field-input:focus {
      border-color: var(--live-border);
      background: var(--bg-elevated);
      box-shadow: 0 0 0 3px var(--live-glow);
    }
    .field-input.error {
      border-color: rgba(200,100,80,0.4);
      background: rgba(60,20,20,0.3);
      animation: shake 0.35s cubic-bezier(0.36,0.07,0.19,0.97);
    }
    @keyframes shake {
      10%, 90%  { transform: translateX(-1px); }
      20%, 80%  { transform: translateX(2px);  }
      30%, 70%  { transform: translateX(-3px); }
      40%, 60%  { transform: translateX(3px);  }
      50%       { transform: translateX(-2px); }
    }

    /* Toggle show/hide password */
    .field-toggle {
      position: absolute; top: 50%; right: 12px;
      transform: translateY(-50%);
      background: none; border: none; cursor: pointer;
      color: var(--text-muted); font-size: 13px; line-height: 1;
      padding: 2px; transition: color 0.12s;
    }
    .field-toggle:hover { color: var(--text-secondary); }

    /* Divider */
    .divider {
      height: 0.5px; background: var(--border);
    }

    /* Submit button */
    .btn-enter {
      width: 100%;
      background: var(--live-dim);
      border: 0.5px solid var(--live-border);
      border-radius: var(--r-sm);
      padding: 12px 20px;
      font-family: var(--font-mono); font-size: 11px;
      letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--live); cursor: pointer;
      display: flex; align-items: center; justify-content: center; gap: 10px;
      transition: background 0.15s, border-color 0.15s, transform 0.14s, box-shadow 0.15s;
      position: relative; overflow: hidden;
    }
    .btn-enter:hover {
      background: rgba(168,212,41,0.14);
      border-color: rgba(168,212,41,0.38);
      transform: translateY(-1px);
      box-shadow: 0 4px 20px rgba(168,212,41,0.08);
    }
    .btn-enter:active { transform: translateY(0); }
    .btn-enter:disabled { opacity: 0.75; cursor: wait; transform: none; }
    .login-footer-row {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
    }
    .login-public-link {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-muted); letter-spacing: 0.04em;
      text-decoration: none; transition: color 0.13s;
    }
    .login-public-link:hover { color: var(--text-secondary); }
    .login-env-tag {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--live); letter-spacing: 0.04em;
    }
    .btn-enter:disabled { opacity: 0.6; cursor: default; transform: none; }
    .btn-enter.loading .btn-txt { opacity: 0; }
    .btn-enter.loading .btn-spinner { opacity: 1; }
    .btn-txt { transition: opacity 0.15s; }
    .btn-arrow { transition: transform 0.2s; }
    .btn-enter:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }
    .btn-spinner {
      position: absolute;
      width: 14px; height: 14px; border-radius: 50%;
      border: 1.5px solid rgba(168,212,41,0.2);
      border-top-color: var(--live);
      animation: spin 0.7s linear infinite;
      opacity: 0; transition: opacity 0.15s;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Error message */
    .error-msg {
      display: none; align-items: center; gap: 8px;
      padding: 9px 12px; border-radius: var(--r-sm);
      background: rgba(180,60,60,0.07);
      border: 0.5px solid rgba(180,60,60,0.22);
      font-family: var(--font-mono); font-size: 10px;
      color: #c87070; letter-spacing: 0.04em;
      opacity: 0; transform: translateY(-4px);
      transition: opacity 0.18s, transform 0.18s;
      pointer-events: none;
    }
    .error-msg.show {
      display: flex; opacity: 1; transform: translateY(0); pointer-events: auto;
    }
    .error-dot { width: 4px; height: 4px; border-radius: 50%; background: #c87070; flex-shrink: 0; }

    /* ── CARD FOOTER ─────────────────────────────────────── */
    .card-foot {
      padding: 12px 32px 14px;
      border-top: 0.5px solid var(--border);
      background: var(--bg-surface);
      display: flex; align-items: center; justify-content: space-between;
    }
    .foot-left {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-muted); letter-spacing: 0.04em;
      display: flex; align-items: center; gap: 6px;
    }
    .foot-env {
      padding: 2px 7px; border-radius: 99px;
      background: var(--live-dim); border: 0.5px solid var(--live-border);
      color: var(--live); font-size: 8px; letter-spacing: 0.1em;
    }
    .foot-right {
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-dim); letter-spacing: 0.04em;
    }

    /* ── BOTTOM NOTICE ───────────────────────────────────── */
    .notice {
      position: relative; z-index: 2;
      margin-top: 20px;
      font-family: var(--font-mono); font-size: 9px;
      color: var(--text-muted); letter-spacing: 0.04em;
      text-align: center; max-width: 340px;
      line-height: 1.6;
    }

    /* ── ENTRANCE ANIMATION ──────────────────────────────── */
    .card, .notice {
      opacity: 0; transform: translateY(14px);
      animation: enter 0.6s cubic-bezier(0.16,1,0.3,1) 0.1s forwards;
    }
    .notice { animation-delay: 0.25s; }
    @keyframes enter {
      to { opacity: 1; transform: translateY(0); }
    }

    /* Corners fade in */
    .corner {
      opacity: 0;
      animation: fadein 0.5s ease 0.4s forwards;
    }
    @keyframes fadein { to { opacity: 1; } }


/* Scroll-safe on short viewports */
@media (max-height: 720px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 48px 0 32px;
  }
}

@media (max-width: 480px) {
  .corner.tl, .corner.tr { top: 12px; }
  .corner.tl { left: 16px; }
  .corner.tr { right: 16px; }
  .corner.bl, .corner.br { bottom: 12px; }
  .corner.bl { left: 16px; }
  .corner.br { right: 16px; }
  .card { margin: 0 16px; }
  .card-top, .card-body { padding-left: 24px; padding-right: 24px; }
  .card-foot { padding-left: 24px; padding-right: 24px; }
}

/* ── ITL canonical alignment (reference: guardian-studio/login v3) ── */
.card {
  max-width: 500px;
  box-shadow:
    0 0 0 0.5px rgba(168, 212, 41, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-top {
  padding: 32px 36px 28px;
  gap: 20px;
}

.card-body {
  padding: 8px 36px 28px;
  gap: 18px;
}

.card-foot {
  padding: 14px 36px 16px;
}

.brand-lockup .brand-logo {
  height: 49px;
  max-width: none;
}

.access-badge {
  font-size: 8px;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  text-transform: uppercase;
}

.title-block {
  gap: 8px;
}

.title-eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.title-eyebrow::before {
  display: none;
}

.title-h1 {
  font-size: clamp(2.35rem, 6vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.title-sub {
  font-size: 13px;
  max-width: 36ch;
}

.field {
  gap: 9px;
  margin-top: 4px;
}

.field-input {
  background: #f2ede4;
  color: #1a241c;
  border: 0.5px solid rgba(90, 160, 80, 0.28);
  border-radius: 6px;
  padding: 15px 44px 15px 16px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.field-input::placeholder {
  color: rgba(26, 36, 28, 0.35);
}

.field-input:focus {
  background: #faf7f0;
  border-color: rgba(168, 212, 41, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 212, 41, 0.12);
}

.field-input.error {
  border-color: rgba(200, 100, 80, 0.55);
  background: #f8ebe8;
}

.field-toggle {
  color: rgba(26, 36, 28, 0.45);
}

.field-toggle:hover {
  color: rgba(26, 36, 28, 0.7);
}

.btn-enter {
  margin-top: 4px;
  padding: 14px 22px;
  border-radius: 6px;
}

.error-msg[hidden] {
  display: none !important;
}

.error-msg:not([hidden]) {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notice {
  margin-top: 24px;
  max-width: 420px;
}
