:root {
  --green: #009c7f;
  --green-dark: #007a63;
  --green-light: #e3f3ef;
  --ink: #1f2a24;
  --muted: #66756c;
  --line: #d8e0db;
  --bg: #f4f7f5;
  --white: #fff;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(10, 50, 30, .07);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }

/* ===== Header ===== */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; background: var(--white);
  border-bottom: 3px solid var(--green); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; color: var(--green); border: 2px solid var(--green);
  border-radius: 8px; padding: 6px 12px; line-height: 1.1; font-size: 16px;
}
.logo-placeholder span { font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 13px; color: var(--muted); }
.dossier-pill {
  background: var(--green-light); color: var(--green-dark); font-weight: 600;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}

/* ===== Stepper ===== */
.stepper {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 24px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.stepper button {
  border: 1px solid var(--line); background: var(--white); color: var(--muted);
  font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; transition: .15s;
}
.stepper button .num {
  display: inline-flex; width: 18px; height: 18px; border-radius: 50%;
  background: var(--line); color: var(--white); align-items: center; justify-content: center;
  font-size: 11px; margin-right: 6px;
}
.stepper button.active { border-color: var(--green); color: var(--green-dark); background: var(--green-light); font-weight: 600; }
.stepper button.active .num { background: var(--green); }
.stepper button.done .num { background: var(--green); }
.stepper button.done .num::after { content: "✓"; }
.stepper button.done .num span { display: none; }

/* ===== Form layout ===== */
.form-wrap { max-width: 920px; margin: 24px auto; padding: 0 16px; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 16px; border-top: 1px solid var(--line); background: var(--white); margin-top: 36px; }
.site-footer span { display: inline-flex; align-items: center; gap: 8px; }
.turnstile-wrap { display: flex; justify-content: center; margin-top: 20px; }

.docs-box { border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; background: #fcfdfc; font-size: 14px; }
.docs-box h3 { color: var(--green-dark); margin: 0 0 8px; font-size: 16px; }
.docs-box ul { margin: 8px 0 0; padding-left: 20px; }
.docs-box li { margin-bottom: 4px; }

.confirmation { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px 0 40px; }
.confirmation .docs-box { max-width: 720px; text-align: left; }
.docs-box ul ul { margin-top: 4px; }
.confirmation[hidden] { display: none; }
.conf-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; max-width: 560px; text-align: center; }
.conf-check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.conf-card h2 { color: var(--green-dark); margin: 0 0 12px; }
.conf-ref { font-size: 18px; margin: 10px 0 16px; }
.conf-ref strong { color: var(--green-dark); }
.conf-card .btn-primary { margin-top: 18px; }
form { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.step h2 { color: var(--green-dark); margin: 0 0 18px; font-size: 22px; border-bottom: 2px solid var(--green-light); padding-bottom: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; }
legend { color: var(--green-dark); font-weight: 600; padding: 0 8px; }

.field { margin-bottom: 14px; }
.field label, .qblock > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea, .field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fcfdfc; transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
input.invalid { border-color: var(--danger); background: #fdf3f2; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.req { color: var(--danger); }
.muted { color: var(--muted); font-size: 14px; }
.note { background: var(--green-light); padding: 10px 14px; border-radius: 8px; }

/* radios / checks */
.radio-row { display: flex; gap: 20px; flex-wrap: wrap; }
.radio-col { display: flex; flex-direction: column; gap: 10px; }
.radio { font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.radio input { width: auto; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 14px; cursor: pointer; }
.check-line input { width: auto; margin-top: 3px; }

.conditional { border-left: 3px solid var(--green); padding-left: 14px; background: #fafdfb; border-radius: 0 8px 8px 0; }
.qblock { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.qblock:last-child { border-bottom: none; }

.legal-box { background: var(--green-light); border-radius: var(--radius); padding: 14px 18px; font-size: 14px; margin-bottom: 18px; }
.legal-box p { margin: 0 0 10px; }
.legal-box ul { margin: 6px 0 0; padding-left: 20px; }

/* ===== Repeat blocks ===== */
.repeat-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; position: relative; background: #fcfdfc; }
.repeat-item .item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.repeat-item .item-head h4 { margin: 0; color: var(--green-dark); font-size: 15px; }
.btn-remove { background: none; border: 1px solid var(--danger); color: var(--danger); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.btn-remove:hover { background: var(--danger); color: #fff; }
.btn-add { background: var(--green-light); color: var(--green-dark); border: 1px dashed var(--green); border-radius: 8px; padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn-add:hover { background: var(--green); color: #fff; }
.empty-hint { color: var(--muted); font-style: italic; font-size: 14px; margin: 8px 0 14px; }
.age-warn { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; font-weight: 600; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ===== Income table ===== */
.table-scroll { overflow-x: auto; }
table.income { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.income th, table.income td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
table.income thead th { background: var(--green); color: #fff; font-weight: 600; }
table.income th.rowhead { text-align: left; background: var(--green-dark); }
table.income td.rowhead { text-align: left; font-weight: 500; background: #f7faf8; }
table.income tr.cat td { background: var(--green-light); color: var(--green-dark); font-weight: 700; text-align: left; }
table.income tr.total td { background: #eef6f1; font-weight: 700; }
table.income input { width: 92px; padding: 6px; text-align: right; }
table.income .total-cell { font-weight: 700; color: var(--green-dark); }

/* ===== Review ===== */
.review { font-size: 14px; }
.review .rev-section { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.review .rev-section h3 { margin: 0; padding: 10px 14px; background: var(--green-light); color: var(--green-dark); font-size: 15px; }
.review dl { display: grid; grid-template-columns: 280px 1fr; gap: 0; margin: 0; }
.review dt { padding: 8px 14px; color: var(--muted); border-top: 1px solid var(--line); }
.review dd { padding: 8px 14px; margin: 0; border-top: 1px solid var(--line); font-weight: 500; }
.review table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.review table th, .review table td { border: 1px solid var(--line); padding: 6px 8px; font-size: 13px; text-align: left; }

/* ===== Nav ===== */
.nav-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-right { display: flex; gap: 10px; }
.btn-primary { background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 11px 22px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 11px 22px; font-size: 15px; cursor: pointer; }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: none; border: none; color: var(--green-dark); text-decoration: underline; cursor: pointer; font-size: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; z-index: 50; }
.toast.show { opacity: 1; }
.error-banner { background: #fdf3f2; border: 1px solid var(--danger); color: var(--danger); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .review dl { grid-template-columns: 1fr; }
  .review dt { border-top: 1px solid var(--line); padding-bottom: 0; }
  .review dd { border-top: none; padding-top: 2px; }
  form { padding: 18px; }
}
