/* SecureSend visual system: "Zero Trust Garage" terminal / SOC-dashboard theme.
   Near-black navy surfaces, a single phosphor-green accent, monospace ALL_CAPS
   labels, sharp corners, thin translucent borders, restrained green glows.

   Ported from a Tailwind reference to hand-written CSS: the app is static HTML
   with a strict CSP (style-src 'self'), so there are no utility classes and no
   inline styles. Class names are unchanged from the previous stylesheet because
   the page JS toggles them (is-hidden, is-active, tag, btn, hint, field...).

   Prose uses the humanist sans; mono is reserved for labels, nav, buttons,
   stats, chips and code. Fonts are self-hosted so the CSP needs no third-party
   origins. Presentation only. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope.woff2") format("woff2");
}

:root {
  /* Surfaces */
  --bg: #020c1b;
  --surface: #0a192f;
  --inset: #020c1b;

  /* The only brand color. Green carries all emphasis. */
  --accent: #00ff41;
  --accent-hover: #00e63a;
  --accent-ink: #020c1b;
  --accent-10: rgba(0, 255, 65, 0.1);
  --accent-20: rgba(0, 255, 65, 0.2);
  --accent-30: rgba(0, 255, 65, 0.3);
  --accent-40: rgba(0, 255, 65, 0.4);
  --accent-50: rgba(0, 255, 65, 0.5);

  /* Text */
  --ink: #ffffff;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;

  /* Borders: every border is white/10, interactive hover upgrades to accent */
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.05);

  /* Semantic */
  --info: #60a5fa;
  --info-bg: rgba(59, 130, 246, 0.1);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.1);

  /* Shape: sharp corners only, never large radii */
  --r-card: 4px;
  --r-chip: 2px;

  --font-sans: "Manrope", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Glow instead of elevation */
  --glow-cta: 0 0 12px var(--accent);
  --glow-dot: 0 0 8px var(--accent);
  --glow-card: 0 0 15px rgba(0, 255, 65, 0.13);

  /* 20px hero grid */
  --grid: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font: 400 15px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

/* ---- Header ---------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  /* 9px, not 14px: the 34px logo is taller than the old text-only brand, so
     the padding gives back the difference and the header stays 53px. */
  padding: 9px 24px;
  background-color: var(--surface);
  background-image: var(--grid);
  background-size: 20px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Lockup: the Zero Trust Garage compact mark as the parent-brand endorsement,
   then the product wordmark. The mark is the kit's SVG, never retyped, and
   carries no glow, shadow or outline (see DESIGN.md, "Logo"). */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
/* Height only, so the kit's proportions hold. 34px tall renders the file at
   ~80px wide, the kit's minimum for the ZTG layout; the file's own padding
   plus the gap clears one cursor width around the visible mark. */
.brand-mark {
  display: block;
  flex: none;
  height: 34px;
  width: auto;
}
/* Title and kicker share a baseline, and the kicker drops under the title
   when the header is too narrow for both on one line. */
.brand-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 4px;
  min-width: 0;
}

/* Wordmark reads as a path, per the naming voice: ZTG /SECURESEND. */
.brand-title {
  font: 700 15px/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-title::before {
  content: "/";
  color: var(--accent);
}
.brand-kicker {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

/* Status chip: accent tint formula (bg/10 + border/30 + accent text) */
.zk-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border: 1px solid var(--accent-30);
  background: var(--accent-10);
  border-radius: var(--r-chip);
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.zk-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow-dot);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* ---- Layout ---------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}
.wrap.narrow {
  max-width: 620px;
}
.auth-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
}

/* ---- Type ------------------------------------------------------------ */
h1 {
  font: 800 30px/1.1 var(--font-sans);
  letter-spacing: -0.035em;
  margin: 0 0 10px;
  color: var(--ink);
}

/* Card / section titles are paths: /ONE_TIME_LINK */
h2 {
  font: 700 12px/1.3 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--ink);
}
h2::before {
  content: "/";
  color: var(--accent);
}

.tagline {
  font: 400 14.5px/1.65 var(--font-sans);
  color: var(--body);
  margin: 0 0 28px;
  max-width: 62ch;
}
.center-head {
  text-align: center;
  margin-bottom: 24px;
}
.center-head h1 {
  font-size: 28px;
}
.center-head .tagline {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Card ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
}
.card + .card {
  margin-top: 16px;
}

/* Terminal chrome: three traffic-light dots above a card. */
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-card) var(--r-card) 0 0;
}
.term-bar + .card {
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.term-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
}
.term-bar i:nth-child(2) {
  background: var(--warn);
}
.term-bar i:nth-child(3) {
  background: var(--accent);
}
.term-bar span {
  margin-left: 6px;
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* ---- Tabs ------------------------------------------------------------ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  margin-bottom: -1px;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover {
  color: var(--ink);
}
.tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-10);
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.composer-top .tabs {
  border-bottom: none;
  margin-bottom: 0;
}
.composer-top .btn-compact {
  flex: 0 0 auto;
  margin-bottom: 6px;
}

/* ---- Fields ---------------------------------------------------------- */
label {
  display: block;
  font: 700 10.5px/1.4 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 11px 12px;
  font: 14px/1.5 var(--font-sans);
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  outline: none;
  transition: all 0.2s;
}
textarea {
  font: 13.5px/1.6 var(--font-mono);
  resize: vertical;
}
::placeholder {
  color: var(--muted-2);
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-40), 0 0 10px rgba(0, 255, 65, 0.15);
}

select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300FF41' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field {
  flex: 1;
  min-width: 180px;
  margin-bottom: 20px;
}
.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.row .field {
  margin-bottom: 0;
}
.panel {
  margin-bottom: 20px;
}
.hint {
  font: 400 11.5px/1.6 var(--font-mono);
  color: var(--muted-2);
  margin: 9px 0 0;
}
/* An intro hint sits directly under a section title, above the first field. */
h2 + .hint {
  margin: -8px 0 20px;
}

/* Slider values read as telemetry */
.slider-val {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 12px 0 2px;
  border-radius: 0;
  background: var(--line);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border: none;
  border-radius: var(--r-chip);
  background: var(--accent);
  box-shadow: var(--glow-dot);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: var(--r-chip);
  background: var(--accent);
  box-shadow: var(--glow-dot);
  cursor: pointer;
}
.slider:focus-visible {
  box-shadow: 0 0 0 1px var(--accent-40);
}

/* ---- Dropzone -------------------------------------------------------- */
.dropzone {
  display: block;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  padding: 32px;
  text-align: center;
  background: var(--inset);
  cursor: pointer;
  transition: all 0.2s;
}
.dropzone:hover {
  border-color: var(--accent-50);
  box-shadow: var(--glow-card);
}
.dropzone .dz-title {
  font: 700 11px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.dropzone .dz-sub {
  font: 400 11.5px/1.6 var(--font-mono);
  color: var(--muted-2);
  margin-top: 8px;
}

/* ---- Disclosure ------------------------------------------------------ */
details.advanced {
  margin-bottom: 20px;
}
details.advanced > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 10.5px/1.4 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
}
details.advanced > summary::-webkit-details-marker {
  display: none;
}
details.advanced > summary::before {
  content: "+";
  display: inline-block;
  width: 1em;
  text-align: center;
}
details.advanced[open] > summary::before {
  content: "-";
}
details.advanced .adv-body {
  padding-top: 16px;
}

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  width: 100%;
  padding: 13px 20px;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--glow-cta);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-ghost,
.btn-secondary {
  background: var(--inset);
  border: 1px solid var(--accent-40);
  color: var(--accent);
}
.btn-ghost {
  margin-top: 16px;
}
.btn-ghost:hover,
.btn-secondary:hover {
  background: var(--inset);
  border-color: var(--accent);
  box-shadow: var(--glow-card);
}

/* Destructive actions. The accent carries every other emphasis in this system,
   so danger is the one place --danger appears on a control: it has to read as
   "not the same kind of button as the ones next to it". */
.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}
.btn-danger:hover {
  color: var(--ink);
  background: var(--danger);
  border-color: var(--danger);
}

.btn-compact {
  width: auto;
  padding: 8px 14px;
  font-size: 10.5px;
  box-shadow: none;
}
.btn-compact.btn-primary {
  box-shadow: var(--glow-cta);
}

.compose-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.compose-actions .advanced {
  flex: 1 1 auto;
  margin-bottom: 0;
}
.compose-actions #create-btn {
  flex: 0 0 auto;
}

/* Microsoft glyph for the SSO button (kept for when SSO is re-enabled) */
.ms-glyph {
  width: 14px;
  height: 14px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.ms-glyph span {
  background: var(--accent-ink);
}

/* ---- OR divider ------------------------------------------------------ */
.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--muted-2);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- Result / links -------------------------------------------------- */
.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.link-row input {
  flex: 1;
  min-width: 200px;
  font: 12.5px/1.5 var(--font-mono);
  color: var(--accent);
}
.link-row .btn {
  flex: none;
}
.summary {
  font: 400 11.5px/1.7 var(--font-mono);
  color: var(--muted);
  margin: 0 0 14px;
}

/* ---- Banners --------------------------------------------------------- */
.warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--warn-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--r-card);
  color: var(--warn);
  font: 400 12px/1.65 var(--font-mono);
  margin: 0 0 20px;
}
.warn::before {
  content: "!";
  flex: none;
  font-weight: 700;
  padding: 0 5px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--r-chip);
}

/* ---- Output ---------------------------------------------------------- */
.secret-box {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px;
  max-height: 40vh;
  overflow: auto;
  font: 13.5px/1.6 var(--font-mono);
  color: var(--ink);
  margin: 0 0 14px;
}
.done {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font: 700 11px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 14px 0 0;
}
.done::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow-dot);
}
.status {
  font: 400 12px/1.6 var(--font-mono);
  color: var(--muted);
  padding: 6px 0;
}
.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-card);
  padding: 10px 12px;
  font: 400 12px/1.6 var(--font-mono);
  margin-top: 14px;
}

/* ---- Footer ---------------------------------------------------------- */
.site-foot {
  text-align: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.site-foot p {
  font: 400 10.5px/1.7 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin: 0 0 8px;
}
.site-foot .foot-links {
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.auth-foot {
  text-align: center;
  color: var(--muted-2);
  font: 400 10.5px/1.7 var(--font-mono);
  letter-spacing: 0.06em;
  margin: 20px 0 0;
}

/* ---- Admin ----------------------------------------------------------- */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
}
.topnav a {
  margin-left: 14px;
}
.table-scroll {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 12.5px/1.5 var(--font-mono);
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.admin-table th {
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.admin-table .btn {
  padding: 5px 9px;
  font-size: 9.5px;
  margin-right: 6px;
}

/* Badge chips: tint formula, green live / amber degraded */
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-chip);
  font: 700 10px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.tag.admin {
  color: var(--accent);
  border-color: var(--accent-30);
  background: var(--accent-10);
}
.tag.disabled {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.3);
  background: var(--warn-bg);
}

/* ---- Utility --------------------------------------------------------- */
.is-hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .app-header {
    /* The brand wraps to two lines here (kicker under title) and the chip
       drops below it; a tighter row gap keeps that from getting tall. */
    padding: 9px 16px;
    row-gap: 10px;
  }
  .wrap {
    padding: 28px 16px 56px;
  }
  h1 {
    font-size: 24px;
  }
  .row {
    flex-direction: column;
    gap: 20px;
  }
  .btn-compact {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  .zk-dot {
    transition: none !important;
    animation: none !important;
  }
}
