/* openKanban - public reporting portal.
   Mobile first, large touch targets, no external resources. */

:root {
  --bg: #0b1120;
  --bg-gradient: radial-gradient(130% 90% at 50% 0%, #1b2a4a 0%, #0b1120 62%);
  --card: #141f33;
  --card-soft: #1b2840;
  --border: #27364f;
  --text: #f2f6ff;
  --text-muted: #a6b4cd;
  --text-soft: #7a8aa6;

  /* Dark enough to carry white label text at 5:1 - the report button is the
     one control that has to work on a phone in daylight. */
  --green: #15803d;
  --green-strong: #166534;
  --red: #dc2626;
  --red-strong: #b91c1c;
  --accent: #60a5fa;
  /* Status colours come in pairs: ``-bg`` for the surface, the plain name for
     text on the page background, ``-text`` for text on that surface. Every one
     of them is overridden in the light theme below - a hard-coded colour here
     would survive the switch and become unreadable. */
  --warning: #fbbf24;
  --warning-bg: #3a2b0c;
  --warning-text: #fde68a;
  --error-bg: #3a1517;
  --error-text: #fecaca;
  --success-text: #4ade80;
  --info-bg: #15293f;

  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 0.45em;
  line-height: 1.22;
  font-weight: 680;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.55rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 1em;
}

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */
.shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 620;
  letter-spacing: 0.02em;
}

/* Same mark as in the centre of the scanned QR code, so the reporter
   immediately recognises where they ended up. */
.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  background-color: var(--text);
  -webkit-mask: url("/static/logo.svg") center / contain no-repeat;
  mask: url("/static/logo.svg") center / contain no-repeat;
}

.card {
  padding: 24px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card > :last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Item panel ---------- */
.item-panel {
  margin: 0 0 22px;
  padding: 18px 20px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.item-name {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-description {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Which place was scanned - matters as soon as an article has several. */
.item-location {
  margin: 8px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.pill-warning {
  background: var(--warning-bg);
  border-color: transparent;
  color: var(--warning);
}

/* ---------- Form ---------- */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.field .help {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.86rem;
}

textarea {
  width: 100%;
  min-height: 130px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}

textarea::placeholder {
  color: var(--text-soft);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.28);
}

/* Honeypot: invisible for humans, reachable for naive bots. */
.trap {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Location ---------- */
/* Only a short transparency note - the browser handles the permission itself. */
.location-status {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.location-status.is-ok {
  color: var(--success-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 16px 20px;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active {
  transform: translateY(2px);
}

.btn-report {
  background: var(--green);
  border-color: var(--green-strong);
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.34);
}

.btn-report:hover {
  filter: brightness(1.07);
}

.btn-cancel {
  background: var(--red);
  border-color: var(--red-strong);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
}

.btn-cancel:hover {
  filter: brightness(1.07);
}

.btn-secondary {
  min-height: 52px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-stack {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

/* ---------- Notices ---------- */
.notice {
  padding: 14px 18px;
  margin: 0 0 20px;
  border-radius: var(--radius);
  background: var(--info-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.93rem;
}

.notice p {
  margin: 0;
}

.notice-warning {
  background: var(--warning-bg);
  border-color: transparent;
  color: var(--warning-text);
}

.notice-error {
  background: var(--error-bg);
  border-color: transparent;
  color: var(--error-text);
}

/* ---------- Result pages ---------- */
.result-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  font-size: 2.6rem;
  line-height: 1;
}

.result-icon.is-success {
  background: rgba(22, 163, 74, 0.18);
  color: #4ade80;
  border: 2px solid rgba(74, 222, 128, 0.5);
}

.result-icon.is-info {
  background: rgba(251, 191, 36, 0.16);
  color: var(--warning);
  border: 2px solid rgba(251, 191, 36, 0.45);
}

.result-icon.is-error {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
  border: 2px solid rgba(252, 165, 165, 0.45);
}

.centered {
  text-align: center;
}

.centered .summary {
  color: var(--text-muted);
}

/* ---------- Privacy ---------- */
.privacy {
  margin-top: 22px;
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.privacy h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}

.privacy ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.privacy li {
  margin-bottom: 5px;
}

.privacy p:last-child {
  margin-bottom: 0;
}

details.privacy-details summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  padding: 4px 0;
}

details.privacy-details[open] summary {
  margin-bottom: 10px;
}

.page-footer {
  margin-top: 26px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.page-footer a {
  color: var(--text-muted);
}

/* ---------- Light mode ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2f9;
    --bg-gradient: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, #e4eaf5 70%);
    --card: #ffffff;
    --card-soft: #f4f7fc;
    --border: #d9e1ef;
    --text: #0f172a;
    --text-muted: #51607a;
    /* Must be listed here too: the dark value would stay in place otherwise and
       drop below 4.5:1 on the light background. */
    --text-soft: #5b6a84;
    --accent: #1d4ed8;
    --warning: #92400e;
    --warning-bg: #fef3c7;
    --warning-text: #7c3a06;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --success-text: #15803d;
    --info-bg: #e3f0ff;
    --shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
  }

  .privacy {
    background: #f8fafc;
  }

  .result-icon.is-success {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
  }

  .result-icon.is-info {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
  }

  .result-icon.is-error {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
  }
}

@media (min-width: 600px) {
  .shell {
    padding-top: 48px;
  }
}
