/* Bullseye Intake — styles. Sunlight-first: black on white, yellow band, big targets. */

:root {
  --yellow: #FFD400;
  --ink: #111;
  --bg: #fff;
  --card: #fff;
  --muted: #555;
  --line: #222;
  --line-soft: #cfcfcf;
  --ok: #1a7f37;
  --warn: #8a5a00;
  --err: #c62828;
  --focus: #005fcc;
  --radius: 12px;
  --tap: 48px;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23111' stroke-width='2.2'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f2f2;
    --bg: #121212;
    --card: #1c1c1c;
    --muted: #b8b8b8;
    --line: #9a9a9a;
    --line-soft: #444;
    --ok: #62cf7e;
    --warn: #f0c060;
    --err: #ff7373;
    --focus: #7db9ff;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23f2f2f2' stroke-width='2.2'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the HTML attribute must beat any display rule below */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* room for the fixed send bar; app.js keeps this in step with the bar's real height */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
body.no-bar { padding-bottom: 24px; }
a { color: var(--focus); }

/* ---- header band ---- */
.hdr {
  background: var(--yellow);
  color: #111;
  padding: calc(18px + env(safe-area-inset-top)) 16px 20px;
}
.hdr-inner { max-width: 560px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; flex: none; }
.hdr h1 { font-size: 23px; line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.owner { margin: 12px 0 0; font-weight: 600; }
.owner a { color: #111; text-decoration-thickness: 2px; }
.sub { margin: 8px 0 0; font-size: 16px; max-width: 36em; }
.test-mode { display: inline-block; margin: 12px 0 0; padding: 6px 10px; background: #111; color: var(--yellow); border-radius: 8px; font-weight: 700; font-size: 15px; }

main { padding: 0 16px; max-width: 560px; margin: 0 auto; }

/* ---- cards and fields ---- */
.card {
  margin: 16px 0;
  padding: 18px 16px 6px;
  border: 2px solid var(--line-soft);
  border-radius: 16px;
  background: var(--card);
}
h2 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--yellow); color: #111; font-size: 16px; font-weight: 800;
}
.field { margin: 0 0 16px; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { font-weight: 500; color: var(--muted); font-size: 14px; margin-left: 6px; }

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  display: block; width: 100%; min-height: 52px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 0;
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
select { background: var(--card) var(--chev) no-repeat right 14px center; padding-right: 42px; }
input::placeholder, textarea::placeholder { color: #8a8a8a; opacity: 1; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.invalid { border-color: var(--err) !important; }

.hint { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.hint.pad { margin-bottom: 14px; }
.err { color: var(--err); font-weight: 600; font-size: 15px; margin: 6px 0 0; }
.msg-ok { color: var(--ok); font-weight: 700; margin: 6px 0 0; }
.msg-warn { color: var(--warn); font-weight: 600; font-size: 15px; margin: 6px 0 0; }
.msg-muted { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.lead { margin: 0 0 12px; font-weight: 500; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 18px; margin: 0;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; text-align: center;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { cursor: default; }
.btn-primary { background: #111; color: var(--yellow); border-color: #111; width: 100%; min-height: 56px; font-size: 19px; }
.btn-primary[aria-disabled="true"] { opacity: 0.55; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--yellow); color: #111; border-color: var(--yellow); }
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.btn-row .btn { flex: 1 1 45%; }
.link {
  display: inline; background: none; border: 0; padding: 10px 2px; margin: -10px -2px;
  font: inherit; font-size: inherit; color: var(--focus); text-decoration: underline; cursor: pointer; text-align: left;
}
.link.small { font-size: 15px; }

/* ---- photos ---- */
.thumbs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.thumbs:empty { margin: 0; }
.thumbs li { position: relative; width: 140px; height: 100px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line-soft); background: #000; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button {
  position: absolute; top: 2px; right: 2px; width: var(--tap); height: var(--tap);
  border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}

/* ---- honeypot and screen-reader-only ---- */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---- radios ---- */
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 8px 12px; border: 2px solid var(--line-soft); border-radius: var(--radius); font-weight: 500; margin: 0;
}
.radio input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: #111; }
@media (prefers-color-scheme: dark) { .radio input { accent-color: var(--yellow); } }

details { margin: 4px 0 14px; }
summary { cursor: pointer; color: var(--focus); font-weight: 600; padding: 10px 0; list-style-position: inside; }
details p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* ---- authorization and signature ---- */
.auth {
  font-size: 17px; line-height: 1.5; margin: 0 0 14px; padding: 12px 14px;
  background: rgba(255, 212, 0, 0.18); border-left: 4px solid var(--yellow); border-radius: 8px;
}
.sig-wrap { border: 2px dashed var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; touch-action: none; }
.sig-wrap.invalid { border-style: solid; }
canvas#sig { display: block; width: 100%; height: 170px; touch-action: none; }
.sig-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 12px; color: var(--muted); font-size: 15px; }

/* ---- fixed send bar ---- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 2px solid var(--line-soft);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.bar-inner { max-width: 560px; margin: 0 auto; }
.send-msg { margin: 0 0 8px; font-weight: 600; }
.send-msg.err { color: var(--err); }
.fallback { margin-top: 10px; }
.fallback .btn { width: 100%; }
.fallback .hint { text-align: center; }

/* ---- draft banner ---- */
.banner {
  margin: 16px 0 0; padding: 10px 14px;
  background: rgba(255, 212, 0, 0.25); border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.banner .link { margin: 0; padding: 10px 4px; }

/* ---- thank-you ---- */
.thanks { padding-top: 20px; }
.thanks h2 { display: block; font-size: 26px; line-height: 1.2; }
.thanks h2:focus { outline: none; }
.ref-label { margin: 18px 0 2px; color: var(--muted); font-size: 15px; }
.ref { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.summary { margin: 18px 0; padding: 14px 16px; border: 2px solid var(--line-soft); border-radius: 16px; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary .thumbs { margin: 12px 0 0; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.actions .btn { width: 100%; min-height: 56px; }
.foot { margin: 24px 0 8px; text-align: center; }

noscript p { margin: 16px; padding: 12px 14px; border: 2px solid var(--err); border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
}
