/* Eagle DNS Secure: the sign-in page.
   One skeleton for every product of the Eagle SecOps Suite: a field drawn in code, the product's
   name and mark on the left, the sign-in card on the right. It was first written here; the CDC's
   sign-in page (7.12.0) took it and gave it the installation's colour scheme, and this page now
   follows the CDC's: the script sets the variables below from the theme the administrator chose
   under Branding (dark or light, and the accent), and the values written here are the "dark"
   theme, so the page is right before the script has run.
   No rule here depends on the application's own stylesheet; an outsider is served neither. */
:root {
  --bg: #0b1220; --panel: #121b2e; --panel2: #19243b; --line: #26344f;
  --text: #e8eef8; --muted: #8b98b4; --accent: #6d90d6; --accent2: #3f5a86;
  /* The same colours as numbers, for the places that need them see-through. */
  --bg-rgb: 11, 18, 32; --panel-rgb: 18, 27, 46; --accent-rgb: 109, 144, 214; --text-rgb: 232, 238, 248;
  --on-accent: #0a1220; --err: #ff8f7d; --shadow: rgba(0, 0, 0, 0.5);
}
html.light { --err: #b42318; --shadow: rgba(24, 36, 48, 0.18); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% 50%, rgba(var(--bg-rgb), 0.72), transparent 70%),
    radial-gradient(1100px 600px at 12% 8%, rgba(var(--accent-rgb), 0.16), transparent 62%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.25), rgba(var(--bg-rgb), 0.78));
}

.stage {
  position: relative; min-height: 100%; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 420px);
  align-items: center; gap: clamp(28px, 6vw, 96px);
  max-width: 1180px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px) 96px;
}

.brand img { display: block; max-width: 210px; max-height: 84px; margin: 0 0 30px; }
/* The built-in mark is white; on a light scheme it is drawn dark. An uploaded logo is shown as it is. */
html.light .brand img.builtin { filter: invert(1) hue-rotate(180deg); }
.brand h1 {
  margin: 0; font-size: clamp(2.3rem, 5.2vw, 4.1rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 650;
  background: linear-gradient(96deg, var(--text) 30%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 16px 0 0; font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--muted); max-width: 30ch; }
.family {
  display: inline-flex; align-items: center; gap: 10px; margin: 34px 0 0;
  font: 500 0.7rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.32); background: rgba(var(--accent-rgb), 0.07);
  padding: 9px 14px; border-radius: 100px;
}
.family .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18); }

.card {
  background: rgba(var(--panel-rgb), 0.78); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 28px 28px;
  box-shadow: 0 30px 80px var(--shadow), 0 0 0 1px rgba(var(--accent-rgb), 0.06) inset;
  -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
}
.card h2 { margin: 0 0 22px; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }

.field { margin: 0 0 16px; }
.field label {
  display: block; margin: 0 0 7px;
  font: 500 0.66rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.field input {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--text);
  background: rgba(var(--bg-rgb), 0.6); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.field input::placeholder { color: var(--muted); opacity: 0.6; }
.field input:focus {
  outline: 0; border-color: var(--accent); background: rgba(var(--bg-rgb), 0.85);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
#code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

.step { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.note { margin: 0 0 12px; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.note.key { text-align: center; word-break: break-all; }
.note.key b { color: var(--text); font-weight: 600; }
.qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.qr img, .qr canvas { background: #fff; padding: 8px; border-radius: 8px; }

.error { min-height: 1.3em; margin: 2px 0 12px; font-size: 0.88rem; color: var(--err); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 16px; border: 0; border-radius: 10px; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--on-accent);
  background: var(--accent);
  transition: filter 0.16s, transform 0.08s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn[disabled] { filter: saturate(0.4) brightness(0.8); cursor: progress; }
footer {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 18px clamp(20px, 5vw, 56px);
  font: 500 0.66rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); opacity: 0.7; pointer-events: none;
}
.noscript { position: fixed; left: 0; right: 0; top: 0; margin: 0; padding: 12px; text-align: center; background: #7a2a1e; color: #fff; }

@media (max-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 30px; padding-bottom: 72px; }
  .brand { text-align: center; }
  .brand img { margin: 0 auto 20px; max-height: 60px; }
  .tagline { margin-left: auto; margin-right: auto; }
  .family { margin-top: 20px; }
  .card { width: 100%; max-width: 440px; margin: 0 auto; }
  .veil { background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.45), rgba(var(--bg-rgb), 0.86)); }
}
@media (max-height: 620px) and (min-width: 861px) { .brand img { margin-bottom: 16px; } .family { margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
