/* dsh-auth sign-in - console archetype: cool slate, signal blue, hairlines only */

@font-face {
  font-family: "Geist";
  src: url("/login/static/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: oklch(0.175 0.012 255);
  --bg-deep: oklch(0.145 0.012 255);
  --card: oklch(0.198 0.012 255);
  --fg: oklch(0.945 0.008 250);
  --fg-dim: oklch(0.19 0.012 255);
  --muted: oklch(0.72 0.012 250);
  --faint: oklch(0.60 0.012 250);
  --line: oklch(0.285 0.012 255);
  --line-strong: oklch(0.40 0.014 255);
  --line-edge: oklch(0.52 0.016 255);
  --line-control: oklch(0.50 0.016 255);
  --accent: oklch(0.76 0.115 245);
  --accent-soft: oklch(0.76 0.115 245 / 0.16);
  --accent-glow: oklch(0.76 0.115 245 / 0.34);
  --danger: oklch(0.68 0.18 25);
  --warn: oklch(0.80 0.13 85);

  --font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 44px;

  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: center;
  justify-content: center;
}

::selection { background: var(--accent-soft); }

/* ---- faint measurement grid: one bold-ish move, still hairline ---- */

.grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: 0.30;
  mask-image: radial-gradient(120% 90% at 50% 42%, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 42%, #000 0%, transparent 76%);
}

/* ---- bars ---- */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 clamp(16px, 4vw, 40px);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.bar--top { top: 0; border-bottom: 1px solid var(--line); }
.bar--bottom { bottom: 0; border-top: 1px solid var(--line); }

.bar .sep { color: var(--line-strong); }
.bar .meta { color: var(--faint); }
.bar .path { color: var(--faint); }

.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.status[data-state="live"] .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.status[data-state="down"] .dot { background: var(--danger); box-shadow: 0 0 0 3px oklch(0.68 0.18 25 / 0.16); }

/* ---- card ---- */

.stage {
  position: relative;
  z-index: 10;
  width: min(100% - 32px, 428px);
  padding: calc(52px + var(--space-5)) 0 calc(52px + var(--space-5));
}

.card {
  position: relative;
  padding: clamp(26px, 5vw, 38px);
  background: var(--card);
  border: 1px solid var(--line-edge);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 oklch(0.45 0.016 255 / 0.22) inset, 0 24px 48px -32px oklch(0 0 0 / 0.6);
}

/* the one bold-ish move: a signal rule that draws itself across the top edge */
.rule {
  position: absolute;
  top: -1px;
  left: -1px;
  height: 1px;
  width: calc(100% + 2px);
  background: linear-gradient(90deg, var(--accent), var(--accent-glow) 45%, transparent 88%);
  transform-origin: left;
  animation: draw-x 0.9s var(--ease) 0.15s both;
}

@keyframes draw-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.head { margin-bottom: var(--space-5); }

.wordmark {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.wordmark .deep { color: var(--fg); }
.wordmark .seek { color: var(--muted); }

.product {
  margin: 2px 0 0;
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--faint);
}

.lede {
  margin: 0 0 var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---- facts ---- */

.facts {
  margin: 0 0 var(--space-5);
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 11px;
  background: var(--bg-deep);
}

.facts dt {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--faint);
}

.facts dd {
  margin: 0;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---- form ---- */

.label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.label--gap { margin-top: var(--space-4); }

.field { position: relative; }

.field input {
  width: 100%;
  padding: 12px 13px;
  background: var(--bg-deep);
  border: 1px solid var(--line-control);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  caret-color: var(--accent);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.field input::placeholder { color: var(--faint); }

/* reserve the toggle's own column so typed text never runs beneath it */
#field-pass input { padding-right: 62px; }

.field input:hover { border-color: var(--line-strong); }

.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.error input { border-color: var(--danger); }

.field.error input:focus-visible { box-shadow: 0 0 0 3px oklch(0.68 0.18 25 / 0.16); }

.ghost {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  min-width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: color 150ms var(--ease);
}

.ghost:hover { color: var(--fg); }
.ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.err {
  min-height: 17px;
  margin: 9px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}

.submit {
  width: 100%;
  margin-top: var(--space-3);
  padding: 12px 16px;
  background: var(--fg);
  color: var(--fg-dim);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 100ms var(--ease),
    opacity 150ms var(--ease);
}

.submit:hover { background: color-mix(in oklab, var(--fg) 91%, white); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit[aria-busy="true"] { opacity: 0.55; pointer-events: none; }

/* ---- responsive ---- */

/* Short viewports: the single card must fit without a pointless scrollbar.
   Supplementary facts are the first thing to go, then the lede. */
@media (max-height: 760px) {
  .stage { padding: calc(52px + var(--space-3)) 0; }
}

@media (max-height: 700px) {
  .facts { display: none; }
  .stage { padding: 56px 0; }
  .lede { margin-bottom: var(--space-4); padding-bottom: var(--space-4); }
}

@media (max-height: 620px) {
  .lede { display: none; }
  .head { margin-bottom: var(--space-4); }
}

@media (max-width: 420px) {
  #status .version { display: none; }
  .bar { padding: 0 14px; font-size: 10.5px; }
}

@media (max-width: 460px) {
  .bar { height: 46px; font-size: 11px; }
  .bar--bottom .meta { display: none; }
  .stage { padding: calc(46px + var(--space-4)) 0 calc(46px + var(--space-4)); }
  .grid { background-size: 56px 56px; }
  .facts { display: none; }
  .card { padding: 24px 20px; }
  /* 44px minimum touch target on the fields themselves */
  .field input { padding-top: 13px; padding-bottom: 13px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .rule { animation: none; }
}
