/* Sun Law, P.C. — Estate Planning Questionnaire
   Palette matched to sunlawpc.com (Lawyer Landing Page theme):
   primary #3F6C92, accent #639BBC, body text #4a4a4a */

* { box-sizing: border-box; }

:root {
  --primary: #3F6C92;
  --primary-dark: #33587a;
  --accent: #639BBC;
  --accent-light: #e8f1f7;
  --text: #3d3d3d;
  --text-light: #5c6670;
  --border: #d5dde3;
  --input-border: #76858f;
  --bg: #f6f8fa;
  --white: #ffffff;
  --error: #b3402e;
  --error-bg: #fbeae7;
  --success-bg: #eaf5ec;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Raleway', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / footer ---------- */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 0;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.firm-name {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.firm-tag {
  display: block;
  font-size: 0.8rem;
  opacity: 0.85;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.contact-mini {
  font-size: 0.85rem;
  text-align: right;
  opacity: 0.92;
}

.site-footer {
  background: var(--primary-dark);
  color: #dbe6ee;
  margin-top: 48px;
  padding: 22px 0;
  font-size: 0.85rem;
  text-align: center;
}
.site-footer .fine {
  font-size: 0.75rem;
  opacity: 0.75;
  max-width: 640px;
  margin: 8px auto 0;
}

/* ---------- Intro ---------- */
.intro { padding-top: 28px; }
h1 {
  color: var(--primary);
  font-size: 1.7rem;
  margin: 0 0 10px;
}
.intro-notes {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px 14px 34px;
  margin: 16px 0 0;
  font-size: 0.92rem;
}
.intro-notes li { margin: 4px 0; }

/* ---------- Progress ---------- */
.progress { margin: 26px 0 18px; }
.progress ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.progress li {
  counter-increment: step;
  font-size: 0.85rem;
  padding: 6px 11px;
  border-radius: 20px;
  background: #e4e9ee;
  color: #46515c;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.progress li:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 1px;
}
.progress li::before {
  content: counter(step) ". ";
  font-weight: 600;
}
.progress li.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.progress li.done {
  background: var(--accent-light);
  color: var(--primary);
}

/* ---------- Steps / fieldsets ---------- */
.step h2 {
  color: var(--primary);
  font-size: 1.35rem;
  margin: 8px 0 14px;
}
fieldset {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px 20px;
  margin: 0 0 18px;
}
legend {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.02rem;
  padding: 0 8px;
}

/* ---------- Fields ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.grid-2 .span-2 { grid-column: span 2; }

.field { margin: 10px 0; }
.grid-2 .field { margin: 0; }

label, .label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: var(--text);
}
.choices label, .consent label {
  font-weight: 400;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  margin: 2px 14px 2px 0;
  padding: 5px 0;
  cursor: pointer;
}
.choices.stack label { display: flex; margin-right: 0; }
.consent label { display: flex; font-size: 0.92rem; }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 1rem; /* 16px minimum prevents iOS auto-zoom */
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-dark);
  outline-offset: 1px;
  border-color: var(--primary-dark);
}
input[type="radio"], input[type="checkbox"] {
  accent-color: var(--primary);
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  cursor: pointer;
}
textarea { resize: vertical; }

.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--error);
  background: var(--error-bg);
}
.field .err-msg {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 4px;
}

.hint {
  font-size: 0.92rem;
  color: var(--text-light);
  margin: 4px 0 10px;
}
.hint-inline {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-light);
}
.req { color: var(--error); }

/* ---------- Repeat groups ---------- */
.repeat-item {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  position: relative;
  background: #fbfcfd;
}
.repeat-item .item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.repeat-item .item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-remove {
  background: none;
  border: none;
  color: var(--error);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-remove:hover { text-decoration: underline; }
.btn-add {
  background: var(--accent-light);
  color: var(--primary);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-add:hover { background: #d9e9f3; }

/* ---------- Conditional visibility ---------- */
[data-show-if] { transition: opacity 0.15s; }
[data-show-if].hidden-cond { display: none; }

/* ---------- Banners ---------- */
.banner {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 0.9rem;
}
.banner.error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}
.banner.info p { margin: 4px 0; }
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

/* ---------- Buttons ---------- */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0;
}
.btn {
  font: inherit;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  margin-left: auto;
}
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:disabled { background: #9ab0c2; cursor: wait; }
.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn.secondary:hover { border-color: var(--accent); }

/* ---------- Review summary ---------- */
.review-summary {
  font-size: 0.9rem;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 16px;
  background: #fbfcfd;
}
.review-summary h3 {
  color: var(--primary);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin: 14px 0 8px;
}
.review-summary h4 {
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.review-summary .qa { margin: 3px 0; }
.review-summary .qa .q { color: var(--text-light); }
.review-summary .empty-note {
  color: var(--text-light);
  font-style: italic;
}

/* ---------- Honeypot (hidden from humans, visible to bots) ---------- */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Success ---------- */
.success-panel {
  background: var(--success-bg);
  border: 1px solid #7cab85;
  border-radius: 8px;
  padding: 24px 28px;
  margin-top: 24px;
}
.success-panel h2 { color: #2e6b3a; margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .span-2 { grid-column: span 1; }
  .site-header .wrap { justify-content: center; text-align: center; }
  .contact-mini { text-align: center; }
  .nav-buttons { flex-direction: column-reverse; }
  .btn { width: 100%; }
  .btn.primary { margin-left: 0; }
  .progress li { font-size: 0.8rem; padding: 5px 9px; }
}

/* ---------- Print (review copy) ---------- */
@media print {
  .site-header, .site-footer, .progress, .nav-buttons, .banner { display: none; }
  .step { display: block !important; }
  body { background: #fff; }
}
