/* ZeniX AI Vigilance: public side-effect reporting form.
   Calm and neutral: one accent colour, red only for the emergency notice,
   errors and a ticked "serious" box. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --soft: #f8f9fb;
  --ink: #1d2433;
  --ink-2: #4a5263;
  --ink-3: #6b7385;
  --line: #e3e6ec;
  --line-2: #cfd4dd;
  --accent: #2557d6;
  --accent-hover: #1d47b3;
  --accent-soft: #eef3fd;
  --red: #c4302b;
  --red-ink: #9b211d;
  --red-soft: #fdf1f0;
  --red-line: #f3c9c6;
  --green: #1f8a4c;
  --green-soft: #eef8f2;
  --radius: 8px;
  --radius-lg: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --surface: #1a1e26; --soft: #20252f;
    --ink: #e7eaf0; --ink-2: #b9bfcc; --ink-3: #8e96a6;
    --line: #2c323d; --line-2: #3a414e;
    --accent: #6b95f0; --accent-hover: #86a9f4; --accent-soft: #1f2a42;
    --red: #f07a73; --red-ink: #f5a19b; --red-soft: #2e1c1c; --red-line: #5a2c2a;
    --green: #5cc58a; --green-soft: #17271e;
  }
}

body {
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* Emergency notice */
.emergency-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--red-soft); color: var(--red-ink);
  border-bottom: 1px solid var(--red-line);
  padding: 9px 16px; font-size: 0.9rem; text-align: center;
}
.emergency-banner a { color: inherit; font-weight: 700; }

/* Header */
header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 16px; }
.header-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 36px; height: 36px; flex: none; display: block; }
.header-text h1 { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.header-text p { font-size: 0.85rem; color: var(--ink-3); }

main { max-width: 720px; margin: 28px auto; padding: 0 16px 56px; }

/* Card */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.form-card-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--line); }
.form-card-header h2 { font-size: 1.45rem; font-weight: 700; line-height: 1.25; }
.form-card-header p { color: var(--ink-2); margin-top: 4px; }
.form-card-header .notice {
  display: flex; gap: 8px; align-items: baseline;
  margin-top: 14px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--soft); color: var(--ink-2); font-size: 0.9rem;
}
.form-card-header .notice i { color: var(--accent); }
.form-body { padding: 8px 28px 28px; }

/* Sections */
.section { border: 0; padding: 22px 0 6px; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-heading { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; padding: 0; }
.section-heading .optional { margin-left: 2px; }
.step {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700; flex: none;
}

/* Fields */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-half { max-width: calc(50% - 8px); }
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-half { max-width: none; }
  .form-card-header, .form-body { padding-left: 18px; padding-right: 18px; }
}

label { display: block; font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-3); font-size: 0.85rem; margin-left: 4px; }
.required-star { color: var(--red); margin-left: 2px; }
.help { font-size: 0.85rem; color: var(--ink-3); margin-top: 5px; font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: 9px 12px; min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 128px; line-height: 1.5; }
input[type="date"] { color-scheme: light dark; }
select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238e96a6'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
select:invalid { color: var(--ink-3); }

/* Contact block */
.contact-box { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 2px; margin-bottom: 16px; }
.contact-title { font-weight: 600; }
.contact-box > .help { margin: 2px 0 12px; }
.contact-box > .field-error { margin: -8px 0 12px; }

/* Checkboxes */
input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin-top: 3px; accent-color: var(--accent); cursor: pointer; }
.check-row { display: flex; gap: 10px; align-items: flex-start; }
.check-row label { margin: 0; cursor: pointer; }

.serious-option {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-weight: 400; cursor: pointer; transition: background .15s, border-color .15s;
}
.serious-option:hover { border-color: var(--ink-3); }
.serious-option input { accent-color: var(--red); }
.serious-title { display: block; font-weight: 600; }
.serious-option .help { display: block; margin-top: 2px; }
.serious-option:has(input:checked) { background: var(--red-soft); border-color: var(--red-line); }
.serious-option:has(input:checked) .serious-title { color: var(--red-ink); }
.serious-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Submit */
.submit-area { padding-top: 20px; }
.submit-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius);
  padding: 12px 24px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.privacy { margin-top: 16px; font-size: 0.85rem; color: var(--ink-3); }

/* Validation */
.field-error { color: var(--red); font-size: 0.85rem; margin-top: 5px; display: none; }
.field-error.visible { display: block; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); }
.submit-error {
  display: none; margin-top: 12px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red-ink); font-size: 0.9rem;
}
.submit-error.visible { display: block; }

.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Confirmation */
.confirmation {
  display: none; text-align: center; padding: 36px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.confirmation.visible { display: block; }
.confirmation-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 1.5rem;
}
.confirmation h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.confirmation p { color: var(--ink-2); margin-bottom: 6px; }
.confirmation .ref-label { margin-top: 18px; font-size: 0.85rem; color: var(--ink-3); margin-bottom: 4px; }
.confirmation .muted { font-size: 0.9rem; color: var(--ink-3); }
.reference-number {
  display: inline-block; margin: 0 0 14px; padding: 8px 18px;
  background: var(--soft); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 700; letter-spacing: .04em;
}
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--surface); color: var(--accent); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); }

/* Footer */
footer { text-align: center; color: var(--ink-3); font-size: 0.82rem; padding: 0 16px 32px; }
footer p + p { margin-top: 4px; }
footer a { color: var(--ink-3); }

/* Honeypot field for bots: off-screen, not display:none, so naive bots still fill it */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }
