/* Genetrix Prime — shared styles for the public site and the admin page. */

:root {
  --bg: #fbfbfd;
  --card: #fff;
  --fg: #111418;
  --mut: #5f6672;
  --line: #e6e8ec;
  --accent: #2563eb;
  --accent2: #7c3aed;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --warn-bg: #fef3c7;
  --warn-fg: #78350f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --card: #14171c;
    --fg: #e9ecf1;
    --mut: #9aa2ae;
    --line: #242932;
    --accent: #7aa2ff;
    --accent2: #b58cff;
    --ok: #4ade80;
    --ok-bg: #05301c;
    --bad: #fca5a5;
    --bad-bg: #3b1113;
    --warn-bg: #3a2f0b;
    --warn-fg: #fde68a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 18px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 700px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 0 0 10px 0;
  z-index: 50;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { left: 0; }

/* ---------- navigation ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand {
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 18px;
  text-decoration: none;
  color: var(--fg);
}
.brand span {
  background: linear-gradient(92deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
nav a.cta {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
}

/* ---------- headings & sections ---------- */

header.hero { padding: 76px 0 64px; text-align: center; }
h1 {
  font-size: clamp(32px, 6.2vw, 52px);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 18px;
  font-weight: 750;
}
h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { font-size: clamp(17px, 2.3vw, 20px); color: var(--mut); max-width: 620px; margin: 0 auto 30px; }
.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

section { padding: 56px 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(24px, 3.6vw, 32px); letter-spacing: -.02em; margin: 0 0 10px; font-weight: 700; }
.sectionsub { color: var(--mut); margin: 0 0 32px; max-width: 620px; }

/* ---------- buttons ---------- */

.btn, button {
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  padding: 14px 22px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  min-height: 46px;
}
.btn { display: inline-block; border-radius: 999px; padding: 14px 26px; }
.btn.primary, button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
button:disabled { opacity: .6; cursor: default; }
button.done { background: var(--ok); color: #fff; border-color: transparent; }
button.danger { color: var(--bad); }

/* ---------- cards ---------- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 14px 0 8px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--mut); font-size: 15px; }
.ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(145deg, var(--accent), var(--accent2));
  color: #fff;
}

/* ---------- steps ---------- */

ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
ol.steps li { counter-increment: s; display: flex; gap: 15px; align-items: flex-start; }
ol.steps li::before {
  content: counter(s);
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
ol.steps b { display: block; }
ol.steps span { color: var(--mut); font-size: 15px; }

/* ---------- forms ---------- */

form { display: grid; gap: 14px; max-width: 540px; }
label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 5px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
}
textarea { min-height: 120px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.hint { font-size: 13px; color: var(--mut); font-weight: 400; }
.err { font-size: 13px; color: var(--bad); min-height: 0; }
.note { font-size: 13px; color: var(--mut); }

.msg { display: none; padding: 13px 15px; border-radius: 11px; font-size: 15px; }
.msg.ok { display: block; background: var(--ok-bg); color: var(--ok); }
.msg.bad { display: block; background: var(--bad-bg); color: var(--bad); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Segmented radio control — real radios, styled as a two-up switch. */
fieldset.segment { border: none; padding: 0; margin: 0; }
fieldset.segment legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 6px;
}
.segbtns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
}
.segbtns input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segbtns label {
  margin: 0;
  text-align: center;
  padding: 11px 8px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mut);
  cursor: pointer;
  user-select: none;
}
.segbtns input:checked + label { background: var(--accent); color: #fff; }
.segbtns input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Support flagging in the admin list. */
.enq.support { border-left-color: #d97706; }
.enq.support.read { border-left-color: var(--line); }
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: 2px;
  background: #d97706;
  color: #fff;
}
.tag-high { background: #ea580c; }
.tag-critical { background: #b91c1c; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 calc(44px + env(safe-area-inset-bottom));
  color: var(--mut);
  font-size: 14px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--mut); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- admin ---------- */

body.admin { padding: 20px 16px calc(56px + env(safe-area-inset-bottom)); }
body.admin .wrap { max-width: 720px; padding: 0; }
.admin-h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -.02em; }
.admin-sub { color: var(--mut); font-size: 13px; margin-bottom: 22px; }
.admin-sub a { color: var(--mut); }
h2.sec {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mut);
  margin: 32px 0 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.pill {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0;
}
.linkcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 13px; }
.linkcard .name { font-weight: 650; font-size: 17px; }
.linkcard .addr { color: var(--mut); font-size: 13px; margin-top: 2px; }
.url {
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--mut);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  margin: 12px 0;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 76px; padding: 12px 10px; font-size: 15px; border-radius: 10px; }
.row > button.copy { flex: 2.2; }

.enq { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 15px; margin-bottom: 12px; }
.enq.read { border-left-color: var(--line); opacity: .72; }
.enq .who { font-weight: 650; }
.enq .meta { font-size: 12px; color: var(--mut); margin-top: 1px; }
.enq .meta a { color: var(--accent); }
.enq .body { white-space: pre-wrap; margin: 8px 0 11px; font-size: 15px; }
.enq .row > * { flex: 1; font-size: 14px; padding: 9px 8px; min-height: 40px; }

.empty { color: var(--mut); font-size: 14px; }
.warn { padding: 11px 13px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; margin-bottom: 14px; }

.form-wide { max-width: none; }
.push-right { margin-left: auto; }

/* ---------- login ---------- */

.login-box {
  width: 100%;
  max-width: 380px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.login-box form { max-width: none; }
.row-tight { margin-top: 7px; }
button.linkish {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  min-height: 0;
  text-align: left;
  flex: 0 0 auto;
  cursor: pointer;
}
.logout {
  background: none;
  border: none;
  color: var(--mut);
  font: inherit;
  font-size: 13px;
  padding: 0;
  min-height: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- 404 ---------- */

.center-page { min-height: 78vh; display: grid; place-items: center; text-align: center; }
