/* WM Synergy brand tokens — aligned with otto / wm-training design system. */
:root {
  /* Brand accent — WM|SYNERGY red. */
  --brand: #c41e3a;
  --brand-dark: #a8172f;
  --brand-soft: rgb(196 30 58 / 7%);
  --brand-border: rgb(196 30 58 / 18%);

  /* Neutral surfaces (warm). */
  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-2: #f2f1ef;
  --surface-3: #e9e7e2;
  --line: #e3e1db;
  --line-strong: #ccc9c2;

  /* Text hierarchy. */
  --ink: #18181b;
  --ink-2: #5c5a56;
  --ink-3: #9b9893;

  /* Dark chrome. */
  --dark: #18181b;
  --dark-text: #f0ede8;

  /* Status. */
  --success: #15803d;
  --success-dot: #22c55e;
  --warn: #a16207;
  --err: #991b1b;
  --err-bg: rgb(153 27 27 / 8%);
  --info: #1d4ed8;
  --info-bg: rgb(29 78 216 / 8%);

  /* Type. */
  --font-display: "Barlow Condensed", "DM Sans", sans-serif;
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Radii. */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 9999px;

  /* Shadows. */
  --shadow-xs: 0 1px 2px rgb(24 24 27 / 5%);
  --shadow-sm: 0 2px 8px rgb(24 24 27 / 7%);
  --shadow-md: 0 4px 20px rgb(24 24 27 / 9%);
  --shadow-accent: 0 8px 18px rgb(196 30 58 / 18%);

  --t: 160ms ease;
  --maxw: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Masthead ---------- */
.masthead {
  background: var(--surface);
  border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow-xs);
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-logo {
  display: block;
  height: 34px;
  width: auto;
}
.brand-doc {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Page ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 28px 64px;
}
.doc-eyebrow {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 8px;
}
.doc-title {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1.0;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--brand);
  padding-bottom: 16px;
}
.doc-lede {
  font-style: italic;
  color: var(--ink-2);
  margin: 16px 0 20px;
  font-size: 15px;
}

/* ---------- Callout ---------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.callout-title {
  font-family: var(--font-display);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.callout p { margin: 8px 0; font-size: 14px; color: var(--ink-2); }
.callout p strong { color: var(--ink); }

/* ---------- Sections ---------- */
.section { margin: 44px 0; }
.section-head { border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 4px; }
.section-kicker {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
}
.section-title {
  font-family: var(--font-display);
  font-size: 30px;
  margin: 2px 0 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-desc { font-style: italic; color: var(--ink-2); margin: 12px 0 24px; font-size: 14px; }

/* ---------- Fields ---------- */
.field { margin-bottom: 22px; }
.field > label,
.field > legend {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
  font-size: 14.5px;
}
.hint {
  display: inline;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-3);
  font-size: 13px;
}
.req { color: var(--brand); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
  transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-border);
}
input.invalid, textarea.invalid { border-color: var(--err); background: var(--err-bg); }

.error {
  color: var(--err);
  font-size: 13px;
  margin-top: 5px;
}
.error:empty { display: none; }

/* ---------- Fieldset groups ---------- */
fieldset.group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 22px;
  background: var(--surface);
}
fieldset.group legend { padding: 0 6px; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  margin-top: 4px;
}
.checkbox-label, .radio-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400;
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
}
.checkbox-label input, .radio-label input {
  margin-top: 3px;
  flex: none;
  accent-color: var(--brand);
}
.radio-label.stacked { margin-bottom: 12px; }
.radio-label.stacked span { line-height: 1.45; }
.warn { color: var(--brand); font-style: italic; font-weight: 600; }

.other-row { flex-wrap: wrap; }
.other-input {
  margin-top: 6px;
  width: 100%;
  padding: 7px 10px;
  font-size: 14px;
}
.other-input:disabled { background: var(--surface-2); cursor: not-allowed; }

/* ---------- Sign-off ---------- */
.signoff {
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-top: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.signoff-head {
  font-family: var(--font-display);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
  padding: 9px 14px;
  margin: -18px -20px 16px;
}
.signoff-attest { font-style: italic; color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.checkbox-field .checkbox-label { font-weight: 600; }
.signoff-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 14px;
}

/* ---------- Sensitivity ---------- */
fieldset.sensitivity { border-color: var(--brand-border); }

/* ---------- Conditional block ---------- */
.conditional {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  margin-top: 8px;
  background: var(--surface);
  transition: border-color var(--t), background var(--t);
}
.conditional.active {
  border: 1px dashed var(--brand-border);
  background: var(--brand-soft);
}
.conditional-banner {
  font-family: var(--font-display);
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.conditional.active .conditional-banner { color: var(--brand); font-weight: 700; }

/* Conditional-required asterisks: only shown when 3.4 is sensitive. */
.cond-req { display: none; }
.conditional.active .cond-req { display: inline; }

/* ---------- File list ---------- */
input[type="file"] { font-size: 14px; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.file-list .fsize { color: var(--ink-3); }

/* ---------- Actions ---------- */
.actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 13px 30px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: background var(--t), transform var(--t);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--ink-3); cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  padding: 10px 24px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
}
.btn-secondary:hover { background: var(--brand-soft); }
.confidential-tag {
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Form message ---------- */
.form-message {
  padding: 13px 18px;
  border-radius: var(--r-sm);
  margin-top: 24px;
  font-size: 14.5px;
}
.form-message.error-msg { background: var(--err-bg); border: 1px solid rgb(153 27 27 / 22%); color: var(--err); }
.form-message.info-msg { background: var(--info-bg); border: 1px solid rgb(29 78 216 / 22%); color: var(--info); }

/* ---------- Success ---------- */
.success-screen {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  margin-top: 24px;
}
.success-icon {
  width: 72px; height: 72px; line-height: 72px;
  margin: 0 auto 18px;
  background: var(--success); color: #fff;
  border-radius: var(--r-full); font-size: 38px; font-weight: 700;
}
.success-screen h2 { font-family: var(--font-display); font-size: 34px; margin: 0 0 12px; font-weight: 700; }
.success-screen p { color: var(--ink-2); }
.success-screen .reference { margin-top: 18px; }
.success-screen .reference strong { color: var(--ink); letter-spacing: 0.04em; font-family: "JetBrains Mono", monospace; }
.success-screen .btn-secondary { margin-top: 26px; }

/* ---------- Footer ---------- */
.page-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 28px 40px;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .page, .masthead-inner { padding-left: 18px; padding-right: 18px; }
  .doc-title { font-size: 34px; }
  .section-title { font-size: 25px; }
  .signoff-grid { grid-template-columns: 1fr; }
  .brand-doc { display: none; }
}
