@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --tff-black: #000000;
  --tff-near-black: #1F1D1D;
  --tff-mid: #222222;
  --tff-surface: #f7f7f7;
  --tff-white: #ffffff;
  --tff-muted: #a9a9a9;
  --tff-border: #000000;
  --tff-accent: #ec6c4c;
  --tff-serif: 'DM Serif Display', Georgia, serif;
  --tff-sans: 'DM Sans', Helvetica, Arial, sans-serif;
  --req-color: #a9a9a9;
  --err-color: #ec6c4c;
  --prog-color: #f7f7f7;
  --eyebrow-font: var(--tff-serif);
}

/* accent emphasis (tweakable) — dark context */
.accent-none    { --req-color: var(--tff-muted); --err-color: var(--tff-muted); --prog-color: var(--tff-surface); }
.accent-subtle  { --req-color: var(--tff-muted); --err-color: var(--tff-accent); --prog-color: var(--tff-surface); }
.accent-signature { --req-color: var(--tff-accent); --err-color: var(--tff-accent); --prog-color: var(--tff-accent); }
.ff-root { height: 100%; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--tff-sans);
  color: var(--tff-surface);
  background: var(--tff-near-black);
}

#root { height: 100%; }

button { font-family: inherit; }

/* ============ FIELDS ============ */
.form-field { margin-bottom: 30px; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--tff-black);
  line-height: 1.35;
}
.form-label .req {
  color: var(--req-color);
  font-weight: 500;
  margin-left: 3px;
}
.form-hint {
  font-size: 12px;
  font-weight: 300;
  color: var(--tff-muted);
  margin-bottom: 12px;
  display: block;
  line-height: 1.5;
}

.tff-input, .tff-select, .tff-textarea {
  width: 100%;
  font-family: var(--tff-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--tff-black);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--tff-black);
  border-radius: 0;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.15s, padding 0.15s;
  -webkit-appearance: none;
}
.tff-input:focus, .tff-select:focus, .tff-textarea:focus {
  border-bottom-width: 2px;
  padding-bottom: 9px;
}
.tff-input::placeholder, .tff-textarea::placeholder {
  color: var(--tff-muted);
  font-weight: 300;
}
.tff-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.tff-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 24px;
  cursor: pointer;
}

/* field error state */
.form-field.invalid .tff-input,
.form-field.invalid .tff-select,
.form-field.invalid .tff-textarea,
.form-field.invalid .scale-wrap,
.form-field.invalid .checkbox-grid {
  border-color: var(--err-color);
}
.field-error {
  font-size: 11px;
  font-weight: 400;
  color: var(--err-color);
  margin-top: 7px;
  letter-spacing: 0.01em;
}

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 560px) { .input-row { grid-template-columns: 1fr; gap: 0; } }

/* ---- Checkboxes ---- */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
@media (max-width: 560px) { .checkbox-grid { grid-template-columns: 1fr; } }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 300;
  color: var(--tff-mid);
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.12);
  transition: color 0.12s;
}
.checkbox-item:hover { color: var(--tff-black); }
.checkbox-item input[type=checkbox] {
  width: 16px; height: 16px;
  border: 1px solid var(--tff-black);
  border-radius: 0;
  appearance: none; -webkit-appearance: none;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.checkbox-item input[type=checkbox]:checked { background: var(--tff-black); }
.checkbox-item input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 1.5px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ---- Scale 1–5 ---- */
.scale-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--tff-black);
}
.scale-ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 300;
  color: var(--tff-muted);
  margin-top: 8px;
}
.scale-opt {
  flex: 1;
  text-align: center;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 300;
  cursor: pointer;
  border-right: 1px solid var(--tff-black);
  transition: background 0.1s, color 0.1s;
  color: var(--tff-mid);
  -webkit-user-select: none; user-select: none;
}
.scale-opt:last-child { border-right: none; }
.scale-opt:hover { background: var(--tff-surface); }
.scale-opt.selected {
  background: var(--tff-black);
  color: #fff;
  font-weight: 500;
}

/* ---- Sub-section heading inside a step ---- */
.sub-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tff-muted);
  margin-bottom: 18px;
}
.sub-block {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 0.5px solid rgba(0,0,0,0.15);
}

/* ============ NAV BUTTONS ============ */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.btn-back {
  font-family: var(--tff-sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--tff-black);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 8px 0 8px 22px;
  letter-spacing: 0.01em;
}
.btn-back::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 12px; height: 1px;
  background: var(--tff-black);
}
.btn-back:disabled { color: var(--tff-muted); cursor: default; }
.btn-back:disabled::before { background: var(--tff-muted); }

.btn-next {
  font-family: var(--tff-sans);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--tff-black);
  border: none;
  border-radius: 0;
  padding: 15px 40px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.btn-next:hover { background: var(--tff-near-black); }

/* On dark surfaces */
.on-dark { color: var(--tff-surface); }
.on-dark .form-label { color: var(--tff-surface); }
.on-dark .form-hint { color: var(--tff-muted); }
.on-dark .tff-input, .on-dark .tff-select, .on-dark .tff-textarea {
  color: var(--tff-surface);
  border-bottom-color: var(--tff-surface);
}
.on-dark .tff-input::placeholder, .on-dark .tff-textarea::placeholder { color: #6f6c6c; }
.on-dark .tff-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F7F7F7' stroke-width='1' fill='none'/%3E%3C/svg%3E");
}
.on-dark .scale-wrap { border-color: var(--tff-surface); }
.on-dark .scale-opt { color: #cfcccc; border-right-color: var(--tff-surface); }
.on-dark .scale-opt:hover { background: rgba(255,255,255,0.06); }
.on-dark .scale-opt.selected { background: var(--tff-surface); color: var(--tff-near-black); }
.on-dark .checkbox-item { color: #cfcccc; border-bottom-color: rgba(255,255,255,0.14); }
.on-dark .checkbox-item:hover { color: #fff; }
.on-dark .checkbox-item input[type=checkbox] { border-color: var(--tff-surface); }
.on-dark .checkbox-item input[type=checkbox]:checked { background: var(--tff-surface); }
.on-dark .checkbox-item input[type=checkbox]:checked::after { border-color: var(--tff-near-black); }
.on-dark .btn-next { background: var(--tff-surface); color: var(--tff-near-black); }
.on-dark .btn-next:hover { background: #fff; }
.on-dark .btn-back { color: var(--tff-surface); }
.on-dark .btn-back::before { background: var(--tff-surface); }
.on-dark .sub-block { border-top-color: rgba(255,255,255,0.18); }
