/* ===== The McDuffie Group — Home Handoff (seller-facing app) ===== */
:root {
  --navy: #1B2A4A;
  --navy-2: #24365c;
  --gold: #C9A227;
  --gold-soft: #e6d39a;
  --cream: #F7F3EA;
  --cream-2: #efe8d8;
  --ink: #2b2b2b;
  --muted: #6a6a6a;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(27, 42, 74, 0.12);
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.app-header { text-align: center; padding: 8px 0 14px; }
.logo {
  display: block;
  margin: 0 auto 10px;
  max-width: 320px;
  width: 100%;
  height: auto;
}
.logo--missing { display: none; }
.app-title {
  font-family: var(--serif);
  color: var(--navy);
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  line-height: 1.15;
  margin: 6px 0 4px;
  letter-spacing: 0.2px;
}
.app-subtitle {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0;
}

/* ---------- Progress ---------- */
.progress { margin: 8px 4px 16px; }
.progress-track {
  height: 8px;
  background: var(--cream-2);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 99px;
  transition: width 0.35s ease;
}
.progress-label {
  margin-top: 6px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

.step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 4px;
}
.step-title {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.35rem;
  margin: 0;
  line-height: 1.2;
}
.step-eyebrow {
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 0.66rem;
  margin: 0 0 2px;
}
.step-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 8px 0 16px;
}
.step-anchor {
  border-left: 3px solid var(--gold);
  background: var(--cream);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  margin: 10px 0 14px;
}

.mark-all {
  flex: 0 0 auto;
  border: 1px solid var(--cream-2);
  background: var(--cream);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
}
.mark-all:active { transform: translateY(1px); }

/* ---------- Fields ---------- */
.field { margin: 16px 0; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.field-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
}
.req { color: var(--gold); }

.na-chip {
  flex: 0 0 auto;
  border: 1px solid var(--cream-2);
  background: var(--white);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
  min-width: 46px;
}
.na-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.na-chip:active { transform: translateY(1px); }

.ctrl {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--cream-2);
  border-radius: 10px;
  padding: 12px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ctrl:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
  background: var(--white);
}
.ctrl:disabled {
  color: var(--muted);
  background: #f1efe9;
  opacity: 0.8;
}
textarea.ctrl { resize: vertical; min-height: 96px; line-height: 1.45; }
.field.is-na .field-label { color: var(--muted); }

.select { -webkit-appearance: none; appearance: none; }
.time-row { display: flex; gap: 10px; }
.time-row .ctrl:first-child { flex: 1 1 auto; }
.time-row .select { flex: 0 0 88px; }

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--cream-2);
  background: var(--cream);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  cursor: pointer;
}
.radio input { accent-color: var(--navy); width: 16px; height: 16px; }
.field-hint { color: var(--muted); font-size: 0.78rem; margin: 6px 0 0; }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.btn {
  flex: 1 1 auto;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: var(--white);
  color: var(--navy);
  border-color: var(--cream-2);
  flex: 0 0 34%;
}
.btn-ghost[disabled] { opacity: 0.4; cursor: default; }
.btn-generate {
  background: linear-gradient(180deg, var(--gold), #b8931f);
  color: #241d05;
  font-size: 1.06rem;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}

/* ---------- Review ---------- */
.review-sub { color: var(--muted); font-size: 0.9rem; margin: 6px 0 18px; }
.review-section {
  border: 1px solid var(--cream-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  background: #fdfcf9;
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.review-head h3 {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.02rem;
  margin: 0;
}
.edit-link {
  border: none;
  background: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 6px;
}
.edit-link:hover { text-decoration: underline; }
.review-section dl { margin: 0; }
.review-row {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px dashed var(--cream-2);
}
.review-row:first-child { border-top: none; }
.review-row dt { color: var(--muted); font-size: 0.82rem; }
.review-row dd { margin: 0; font-size: 0.88rem; color: var(--ink); word-break: break-word; }
.review-row dd.empty { color: #b9b3a5; }

.field-error {
  color: #a02323;
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 700;
}
.ctrl.invalid { border-color: #a02323; box-shadow: 0 0 0 3px rgba(160,35,35,0.14); }

/* ---------- Honeypot (hidden from humans) ---------- */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---------- Submit / states ---------- */
.submit-area { margin-top: 22px; }
.submit-area .btn-generate { width: 100%; }
.submit-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 10px 0 0;
}
.submit-nudge {
  background: #fbf6e6;
  border: 1px solid var(--gold-soft);
  color: #6b5310;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 14px;
}
.submit-btns { display: flex; gap: 12px; margin-top: 14px; }
.submit-btns .btn { flex: 1 1 auto; }
.btn-fallback { flex: 1 1 auto; }
.submit-error {
  background: #fbeeee;
  border: 1px solid #eccaca;
  color: #7a2222;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.submit-error strong { display: block; margin-bottom: 2px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  border: 2px solid rgba(36, 29, 5, 0.35);
  border-top-color: #241d05;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.success { text-align: center; padding: 10px 6px 6px; }
.success-mark {
  width: 66px;
  height: 66px;
  line-height: 66px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), #b8931f);
  color: #241d05;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}
.success-msg { color: var(--muted); font-size: 0.95rem; margin: 8px auto 16px; max-width: 40ch; }
.success-note { font-family: var(--serif); color: var(--navy); font-style: italic; margin-bottom: 22px; }
.btn-download { width: auto; padding: 12px 20px; flex: 0 0 auto; }

/* ---------- Footer ---------- */
.app-footer { text-align: center; margin-top: 18px; }
.privacy-note {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
  padding: 0 8px;
}

@media (min-width: 620px) {
  .card { padding: 28px 26px; }
  .step-title { font-size: 1.5rem; }
}
