/* Tokens pulled from margolatka.com */
:root {
  --bg: #fefdf6;
  --surface: #ffffff;
  --ink: #1e322d;
  --ink-2: rgba(30, 50, 45, 0.72);
  --muted: rgba(30, 50, 45, 0.5);
  --line: rgba(30, 50, 45, 0.14);
  --line-strong: rgba(30, 50, 45, 0.32);
  --tint: rgba(30, 50, 45, 0.04);
  --accent: #6f9e7d;
  --error: #a3412d;

  --serif: "Gambetta", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --label: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --pill: 999px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.logo img { height: 30px; width: auto; display: block; }
.top-label {
  font-family: var(--label);
  font-size: 13px;
  color: var(--muted);
}

.progress {
  height: 2px;
  background: var(--line);
  margin: 0 -20px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.35s ease;
}

.main { flex: 1; padding: 40px 0 56px; }

/* Type */
.eyebrow {
  font-family: var(--label);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
}
h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}
h1 { font-size: clamp(38px, 8vw, 56px); line-height: 1.08; letter-spacing: -0.04em; }
h2 { font-size: clamp(32px, 6vw, 42px); line-height: 1.1; letter-spacing: -0.035em; }
h3 { font-family: var(--sans); font-size: 18px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; max-width: 56ch; }

/* Welcome */
.welcome { padding-top: 12px; }
.bring {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  margin-bottom: 36px;
}
.bring ul { margin: 10px 0 0; padding-left: 0; list-style: none; }
.bring li { padding: 4px 0 4px 22px; position: relative; color: var(--ink-2); }
.bring li::before {
  content: "";
  position: absolute; left: 4px; top: 13px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--pill);
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: #2c4740; }
.btn.ghost { border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--tint); }
.btn .dot, .chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.text-btn {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  font-size: 15px;
}
.text-btn:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fields */
.field { margin-bottom: 30px; }
.label {
  display: block;
  font-weight: 500;
  font-size: 17px;
  margin-bottom: 6px;
}
.optional {
  font-family: var(--label);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 10px;
}
.help { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.help.small { font-size: 13px; margin: 8px 0 0; }
.error { color: var(--error); font-size: 14px; margin: 8px 0 0; }
.error.banner {
  background: rgba(163, 65, 45, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], textarea {
  width: 100%;
  font: inherit;
  font-size: 17px; /* ≥16px prevents iOS zoom */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(111, 158, 125, 0.22);
}
.has-error input, .has-error textarea { border-color: var(--error); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip .dot { background: transparent; border: 1px solid var(--line-strong); width: 9px; height: 9px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .dot { background: var(--accent); border-color: var(--accent); }
.has-error .chip { border-color: rgba(163, 65, 45, 0.5); }

.other-input { margin-top: 10px; }

/* Room-by-room follow-up headings */
.subhead { border-top: 1px solid var(--line); padding-top: 22px; margin: 8px 0 18px; }
.subhead h3 { font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: -0.03em; }
.subhead .help { margin: 4px 0 0; }
.subhead:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.review-subhead { font-weight: 500; font-size: 15px; padding: 12px 0 4px; border-top: 1px solid var(--line); }

/* Links */
.links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link-row { display: flex; gap: 8px; width: 100%; }
.icon-btn {
  flex-shrink: 0; width: 48px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); cursor: pointer; font-size: 22px; color: var(--muted);
}

/* Photos */
.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.thumb, .add-photo {
  aspect-ratio: 1;
  border-radius: 12px;
  margin: 0;
  overflow: hidden;
  position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(30, 50, 45, 0.75); color: #fff;
  cursor: pointer; font-size: 17px; line-height: 1;
}
.add-photo {
  border: 1.5px dashed var(--line-strong);
  background: var(--tint);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 14px; color: var(--ink-2);
}
.add-photo:hover { border-color: var(--ink); }
.add-photo .plus { font-family: var(--serif); font-size: 30px; line-height: 1; }
.has-error .add-photo { border-color: var(--error); }

/* Drag and drop */
.photos { position: relative; border-radius: 14px; transition: background 0.15s, box-shadow 0.15s; }
.photos.dragging {
  background: rgba(111, 158, 125, 0.1);
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 8px rgba(111, 158, 125, 0.1);
  min-height: 120px;
}
.photos.dragging .add-photo { border-color: var(--accent); }
.drop-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--label); font-size: 15px; color: var(--ink);
  background: rgba(254, 253, 246, 0.82);
  border-radius: 14px;
  pointer-events: none;
}
/* Only mention dragging on devices with a mouse */
@media (hover: none), (pointer: coarse) { .drag-tip { display: none; } }

/* Packages */
.packages { display: grid; gap: 14px; }
.package {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.package:hover { border-color: var(--ink); }
.package.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.package.featured { border-color: var(--accent); background: #fbfcf8; }
.package.featured.on { border-color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--label); font-size: 12px; font-weight: 500;
  color: var(--ink);
  background: rgba(111, 158, 125, 0.16);
  border-radius: var(--pill);
  padding: 4px 10px;
  margin-bottom: 12px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.package-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.package h3 { font-family: var(--serif); font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; }
.price { font-family: var(--label); font-size: 15px; white-space: nowrap; }
.package p { margin: 0 0 12px; color: var(--ink-2); font-size: 16px; }
.package ul { margin: 0 0 14px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.package li {
  position: relative;
  padding: 9px 0 9px 26px;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}
.package li::before {
  content: "";
  position: absolute; left: 3px; top: 15px;
  width: 10px; height: 5px;
  border-left: 1.75px solid var(--accent);
  border-bottom: 1.75px solid var(--accent);
  transform: rotate(-45deg);
}
.select-mark { font-family: var(--label); font-size: 13px; color: var(--muted); }
.package.on .select-mark { color: var(--ink); }
.package.on .select-mark::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: 1px;
}

/* "Home or business?" first screen */
.choices { display: grid; gap: 14px; }
.choice { display: block; position: relative; color: inherit; text-decoration: none; padding-right: 52px; }
.choice p { margin: 6px 0 0; }
.choice-go { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--ink); }
.choice:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Review */
.review { display: grid; gap: 14px; }
.review-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review dl { margin: 0; }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.review-row:first-child { border-top: 0; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.review-pkg { margin: 4px 0 0; display: flex; justify-content: space-between; }

/* Step nav */
.nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* Saving / done */
.saving { text-align: center; padding-top: 60px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 24px;
  border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* "What happens next" timeline on the thank-you screen */
.next-steps { border-top: 1px solid var(--line); padding-top: 22px; margin: 0 0 36px; }
.next-steps ol { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: step; }
.next-steps li {
  position: relative;
  padding: 0 0 22px 40px;
  counter-increment: step;
  display: grid; gap: 2px;
}
.next-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--label); font-size: 13px; color: var(--ink);
  background: var(--surface);
}
.next-steps li:not(:last-child)::after {
  content: "";
  position: absolute; left: 13px; top: 30px; bottom: 4px;
  width: 1px; background: var(--line);
}
.next-steps .when { font-family: var(--label); font-size: 13px; color: var(--muted); padding-top: 3px; }
.next-steps .what { font-size: 17px; color: var(--ink); }

.demo-note {
  font-family: var(--label); font-size: 13px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; margin-top: 28px;
}

.foot {
  font-family: var(--label); font-size: 12px; color: var(--muted);
  padding: 22px 0 28px; border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .shell { padding: 0 16px; }
  .progress { margin: 0 -16px; }
  .main { padding-top: 28px; }
  .review-row { grid-template-columns: 1fr; gap: 2px; }
  .nav .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
