/* FlowSentry self-service portal (P7-E8-01): mobile-first, system fonts, no external assets. Colours follow design
   system v3 (violet-indigo accent on neutral slate) at WCAG AA contrast; dark mode follows the device. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --accent: #4f46e5;
  --accent-text: #ffffff;
  --ok-bg: #ecfdf5;
  --ok-text: #065f46;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --warn-bg: #fffbeb;
  --warn-text: #92400e;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #818cf8;
    --accent-text: #0b1120;
    --ok-bg: #052e22;
    --ok-text: #6ee7b7;
    --error-bg: #3b0d0d;
    --error-text: #fca5a5;
    --warn-bg: #3a2604;
    --warn-text: #fcd34d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.bar, .foot, .page { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 56px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; }
.lang a { margin-left: 12px; text-decoration: none; }
.lang a[aria-current="true"] { font-weight: 700; text-decoration: underline; }
.page { padding-top: 16px; padding-bottom: 32px; }
.foot { border-top: 1px solid var(--border); padding-top: 12px; padding-bottom: 24px; color: var(--muted); }
.foot a, .foot form { margin-right: 16px; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 16px 0 8px; }
.eyebrow, .small, .help { color: var(--muted); font-size: 0.875rem; }
.lead { font-size: 1.05rem; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input:not([type]), select, textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
input[readonly], textarea[readonly], select:disabled { opacity: 0.7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.code { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; max-width: 220px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

.field { margin-bottom: 8px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error-text); }
.error-text { color: var(--error-text); font-size: 0.875rem; margin: 4px 0 0; }

button, .button {
  display: inline-block; min-height: 44px; padding: 10px 18px; font: inherit; font-weight: 600; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; text-align: center;
}
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.link { background: none; border: none; padding: 0; min-height: auto; color: var(--accent); text-decoration: underline; font-weight: 400; }
button:disabled { opacity: 0.6; cursor: progress; }
.actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; }
.inline { display: inline; }
.secondary-form { margin-top: 16px; }

.note { padding: 12px; border-radius: var(--radius); margin: 12px 0; background: var(--surface); border: 1px solid var(--border); }
.note.ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.note.error { background: var(--error-bg); color: var(--error-text); border-color: transparent; }
.note.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }

.steps, .requests { padding-left: 20px; }
.steps li, .requests li { margin: 10px 0; }
.steps li.done a::after, .requests li.done > p:first-child::after { content: " ✓"; color: var(--ok-text); }
.steps .small { display: block; }

.slots { list-style: none; padding: 0; }
.slot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.slot.requested { border-color: var(--accent); }
.slot h2 { margin-top: 4px; }
.badge { display: inline-block; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); }
.upload { padding: 8px 12px; border-radius: var(--radius); margin: 8px 0; background: var(--bg); }
.upload p { margin: 4px 0; }
.state-needsnewupload, .state-notaccepted { background: var(--error-bg); color: var(--error-text); }
.state-accepted { background: var(--ok-bg); color: var(--ok-text); }
.upload-form input[type=file] { width: 100%; margin: 4px 0 8px; }

.notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px 8px; margin: 12px 0; }
.notice-text { white-space: pre-wrap; }
.problems li { margin: 6px 0; }
.faq { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

/* Honeypot: off-screen for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
