/*
 * ZERO — shared front-end styles.
 *
 * A restrained "phosphor terminal" aesthetic: green-on-black, monospace, subtle
 * scanlines. Used by the landing, signup, and dashboard pages. Kept small and
 * dependency-free (static site served from CloudFront).
 */

:root {
  --phos: #33ff66;        /* phosphor green */
  --phos-dim: #1c9c3e;
  --phos-fade: #0f5a24;
  --err: #ff5b5b;
  --bg: #020402;
  --panel: rgba(51, 255, 102, 0.03);
  --edge: rgba(51, 255, 102, 0.22);
  --maxw: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--phos);
  font: 16px/1.6 "SF Mono", "DejaVu Sans Mono", "Menlo", "Consolas", ui-monospace, monospace;
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.35);
  -webkit-font-smoothing: antialiased;
}

/* Scanline + faint flicker overlay, shared. */
body.crt::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.22) 3px, rgba(0,0,0,0.22) 3px
  );
}
@media (prefers-reduced-motion: no-preference) {
  body.crt::after {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3;
    background: rgba(51,255,102,0.015);
    animation: zflicker 5s infinite steps(30);
  }
  @keyframes zflicker { 0%,96%,100%{opacity:.2} 97%{opacity:.06} 98%{opacity:.32} 99%{opacity:.12} }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 6vw; position: relative; z-index: 1; }

/* Links + generic type */
a { color: var(--phos); text-decoration: none; border-bottom: 1px dotted var(--phos-dim); }
a:hover { text-shadow: 0 0 10px rgba(51,255,102,0.7); }
.dim { color: var(--phos-dim); text-shadow: 0 0 4px rgba(28,156,62,0.4); }
.faint { color: var(--phos-fade); }
h1, h2, h3 { letter-spacing: 0.06em; line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0.2em 0; }
h2 { font-size: 1.25rem; margin: 2.4em 0 0.6em; }
p { margin: 0.7em 0; }
code, .mono { font-family: inherit; }

/* Top nav / prompt bar */
.nav {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 1.4em 0; border-bottom: 1px solid var(--edge);
}
.brand { font-weight: 700; letter-spacing: 0.2em; }
.nav a { border: 0; margin-left: 1.2em; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.7em 1.2em; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; letter-spacing: 0.08em;
  background: var(--phos); color: #001b06; border-bottom: 0;
}
.btn:hover { text-shadow: none; box-shadow: 0 0 16px rgba(51,255,102,0.5); }
.btn.ghost { background: transparent; color: var(--phos); border: 1px solid var(--phos-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* Panels / cards */
.panel { border: 1px solid var(--edge); background: var(--panel); padding: 1.2em 1.3em; }
.grid { display: grid; gap: 1em; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* Forms */
label { display: block; margin: 1.1em 0 0.3em; letter-spacing: 0.04em; }
.field { display: flex; align-items: center; gap: 0.4em; border: 1px solid var(--phos-dim); padding: 0.55em 0.7em; background: var(--panel); }
input, select { background: transparent; border: 0; color: var(--phos); font: inherit; width: 100%; outline: none; }
input::placeholder { color: var(--phos-dim); opacity: 0.7; }
.suffix { color: var(--phos-dim); white-space: nowrap; }
.hint { min-height: 1.4em; margin-top: 0.35em; font-size: 0.85rem; }
.hint.err { color: var(--err); text-shadow: 0 0 6px rgba(255,91,91,0.4); }

/* Utility */
.center { text-align: center; }
.spaced > * + * { margin-top: 0.8em; }
.tag { display:inline-block; border:1px solid var(--phos-dim); padding:0.05em 0.5em; font-size:0.75rem; letter-spacing:0.1em; }

/* Segmented toggle (two mutually-exclusive options). */
.toggle { display:flex; border:1px solid var(--phos-dim); background:var(--panel); overflow:hidden; }
.toggle button {
  flex:1; padding:0.55em 0.7em; background:transparent; color:var(--phos-dim);
  border:0; border-right:1px solid var(--phos-dim); font:inherit; letter-spacing:0.06em; cursor:pointer;
}
.toggle button:last-child { border-right:0; }
.toggle button[aria-pressed="true"] { background:var(--phos); color:#001b06; text-shadow:none; font-weight:700; }
.toggle button:hover:not([aria-pressed="true"]) { color:var(--phos); }
hr { border: 0; border-top: 1px solid var(--edge); margin: 2.4em 0; }
footer { border-top: 1px solid var(--edge); margin-top: 3em; padding: 1.6em 0; font-size: 0.82rem; }
.cursor { display:inline-block; width:0.55em; height:1.05em; background:var(--phos); vertical-align:-0.16em; margin-left:2px; box-shadow:0 0 8px rgba(51,255,102,0.7); animation: zblink 1.05s steps(1) infinite; }
@keyframes zblink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } html { scroll-behavior: auto; } }
