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

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  /* Surfaces — warm off-white, low-noise neutrals */
  --bg: #f6f3ef;
  --surface: #ffffff;
  --surface-2: #efeae3;
  --surface-3: #1c1a18;        /* dark slab for hero contrast cards */

  /* Type */
  --text: #1c1a18;
  --text-muted: #6b645d;
  --text-on-dark: #f5efe7;

  /* Lines / focus */
  --border: #d8d1c7;
  --border-strong: #a89c8b;

  /* Brand — fire-service red */
  --primary: #c8201f;           /* fire engine red, AA on white ≈ 4.84 */
  --primary-hover: #a31817;
  --primary-text: #ffffff;
  --primary-soft: #fde8e5;      /* tinted background for chips/badges */

  /* Status (also serve as the alertness traffic-light) */
  --green: #1f7d4a;
  --green-soft: #e0efe5;
  --yellow: #b07300;
  --yellow-soft: #f7ecd1;
  --red: #b41e1e;
  --red-soft: #f8dad8;

  /* Effects */
  --shadow: 0 1px 2px rgba(28, 26, 24, 0.06), 0 2px 6px rgba(28, 26, 24, 0.04);
  --shadow-md: 0 4px 16px rgba(28, 26, 24, 0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --pad: 16px;

  /* Stripe accent height for the brand bar */
  --stripe: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15110f;
    --surface: #1e1a17;
    --surface-2: #2a2521;
    --surface-3: #0c0a08;
    --text: #f4ece2;
    --text-muted: #a59a8e;
    --text-on-dark: #f4ece2;
    --border: #3a322c;
    --border-strong: #6a5d51;
    --primary: #e84a3a;
    --primary-hover: #f26656;
    --primary-text: #1a0907;
    --primary-soft: #3a1614;
    --green: #46c477;
    --green-soft: #1a3326;
    --yellow: #e8a942;
    --yellow-soft: #3a2c14;
    --red: #ee5e5e;
    --red-soft: #3a1e1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  }
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

h1, h2, h3 { margin: 0 0 0.4em 0; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0.4em 0; }

.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }

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

a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 32, 31, 0.18);
}

@media (prefers-color-scheme: dark) {
  input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(232, 74, 58, 0.28);
  }
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
  font-size: 0.92rem;
}

label > input,
label > select,
label > textarea {
  margin-top: 6px;
  font-weight: 400;
  font-size: 1rem;
}

.hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  min-height: 44px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  transition: background-color 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}

button:hover { background: var(--border); }
button:active { transform: translateY(1px); }

button.primary {
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: 0.01em;
}
button.primary:hover { background: var(--primary-hover); }

button.ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
button.ghost:hover { background: var(--surface-2); color: var(--text); }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
}

legend { font-weight: 600; padding: 0 6px; font-size: 0.92rem; }

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-large .brand-mark { width: 40px; height: 40px; }

.brand-text h1 { line-height: 1.1; margin: 0; }
.brand-text p, .brand-tag {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-tag {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

.brand-stripe {
  height: var(--stripe);
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 60%, var(--primary) 100%);
  position: sticky;
  top: 0;
  z-index: 6;
}
