/* Alpina Cleaning — booking form
 * Brand: Deep Navy #0F3D6B, Logo Blue #5BAEE8, Inter + Lora.
 */

:root {
  --navy: #0F3D6B;
  --navy-dark: #09294A;
  --blue: #5BAEE8;
  --ink: #1A2733;
  --muted: #5A6B7C;
  --faint: #7A8A99;
  --line: #D7DEE6;
  --line-soft: #EDF1F6;
  --tint: #F4F8FC;
  --ground: #F6F9FC;
  --white: #FFFFFF;
  --green: #17603C;
  --green-bg: #EDF7F1;
  --red: #8C2A20;
  --red-bg: #FDF3F2;
  --amber: #6B5A38;
  --amber-bg: #F8F6F1;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2 { font-family: Lora, Georgia, serif; font-weight: 600; color: var(--navy); margin: 0; }
h1 { font-size: 27px; line-height: 1.22; }
h2 { font-size: 20px; line-height: 1.25; }
p { margin: 0; }
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }

/* ---- Masthead --------------------------------------------------------- */

.masthead {
  background: var(--white);
  border-bottom: 1px solid #E7EDF3;
}
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--navy);
}
.wordmark i { color: var(--blue); font-style: normal; }
.masthead a { font-size: 13.5px; font-weight: 500; text-decoration: none; }

/* ---- Page frame ------------------------------------------------------- */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 44px;
  align-items: flex-start;
}

/* Step rail — laptop only */
.rail { flex: 1 1 240px; min-width: 0; display: none; flex-direction: column; gap: 2px; }
.rail-title {
  padding: 0 10px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.rail-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.rail-step[disabled] { color: var(--faint); cursor: default; }
.rail-step[aria-current="step"] {
  background: var(--white);
  border-color: #CBDCEB;
  color: var(--navy);
  font-weight: 600;
}
.rail-step .num, .sheet-step .num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--faint);
}
.rail-step .label, .sheet-step .label { flex-grow: 1; }
.rail-step .mark, .sheet-step .mark { font-size: 11px; color: var(--faint); }
.rail-step.done .num, .sheet-step.done .num {
  background: var(--navy); border-color: var(--navy); color: var(--white);
}
.rail-step[aria-current="step"] .num, .sheet-step[aria-current="step"] .num {
  background: var(--white); border: 1.5px solid var(--navy); color: var(--navy);
}

/* Card */
.card {
  flex: 999 1 560px;
  min-width: 0;
  background: var(--white);
  border: 1px solid #E7EDF3;
  border-radius: 14px;
  padding: 28px;
}

/* ---- Progress header -------------------------------------------------- */

.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px 0 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.back[hidden] { display: none; }
.step-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 8px;
  margin-right: -8px;
  border: none;
  background: none;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.track { height: 3px; background: #E7EDF3; border-radius: 2px; margin-bottom: 26px; }
.track > div { height: 3px; background: var(--blue); border-radius: 2px; transition: width .25s ease; }

.intro { margin-top: 8px; font-size: 14px; color: var(--muted); }
.screen-head { margin-bottom: 22px; }

/* ---- Fields ----------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field > label, .field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.optional { font-weight: 400; color: var(--faint); }
.help { margin-top: 6px; font-size: 11.5px; color: var(--faint); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  /* 16px minimum: anything smaller makes iOS Safari zoom in on focus,
     which is what makes the page lurch around when you tap a field. */
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
}
input:focus-visible, textarea:focus-visible, button:focus-visible, .opt:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
textarea { min-height: 84px; resize: vertical; }
.suffixed { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.suffixed input { border: none; border-radius: 0; }
.suffixed span { padding: 0 15px; font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Option rows */
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.opt:hover { border-color: #AFC3D6; }
.opt input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.opt .opt-body { flex-grow: 1; }
.opt .opt-detail { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.opt:has(input:checked) { border-color: var(--navy); background: var(--tint); }
.opt:has(input:checked) .opt-body { font-weight: 500; }

/* Pill grid, for size */
.pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pill {
  position: relative;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
}
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill:has(input:checked) {
  border: 1.5px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
}
.pill.wide { grid-column: span 2; }

/* Tick rows with a count */
.ticks { display: grid; grid-template-columns: 1fr; gap: 9px; }
.tick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tick:has(input[type="checkbox"]:checked) { border-color: var(--navy); background: var(--tint); }
.tick input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); flex-shrink: 0; }
.tick label { flex-grow: 1; font-size: 14.5px; cursor: pointer; }
.tick:has(input[type="checkbox"]:checked) label { font-weight: 500; }
.tick .qty { width: 66px; padding: 9px; text-align: center; font-size: 14px; }
.tick .unit { font-size: 13px; color: var(--muted); }
.tick .sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.tick-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tick-group:has(> .tick-head input:checked) { border-color: var(--navy); }
.tick-group .tick-head { border: none; border-radius: 0; }
.tick-group .tick-body { padding: 15px; border-top: 1px solid #DCE7F2; background: var(--white); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
/* A sub-panel only exists once its own box is ticked. */
.tick-group:not(:has(> .tick-head input:checked)) .tick-body { display: none; }
/* Label sits above its own box, so there is never a question which number
   belongs to which word. */
.tick-body .pair { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tick-body .pair label { font-size: 13px; font-weight: 500; color: var(--muted); }
.tick-body .pair input { width: 100%; max-width: 110px; padding: 9px; text-align: center; }
.tick-body .row { display: flex; align-items: center; gap: 10px; }
.tick-body .row label { flex-grow: 1; font-size: 14px; }
.tick-body .row input[type="number"] { width: 56px; padding: 8px; text-align: center; }
.tick-body .row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--navy); }

/* Window tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.tile figure { margin: 0; height: 104px; background: var(--ground); display: flex; align-items: center; justify-content: center; }
.tile .tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.tile label { font-size: 13.5px; font-weight: 600; }
.tile input { text-align: center; padding: 10px; }

/* Day cards */
.cycle-hint {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px; padding: 12px 14px;
  background: var(--tint); border: 1px solid #CBDCEB; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500; color: var(--navy);
}
.days { display: flex; flex-direction: column; gap: 9px; }
.day {
  width: 100%;
  min-height: 58px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font: inherit;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.day .dot { width: 10px; height: 10px; border-radius: 50%; background: #9AA8B5; flex-shrink: 0; }
.day .when { flex-grow: 1; font-weight: 500; }
.day .state { font-size: 12px; font-weight: 600; }
.day.preferred { border-color: #1F7A4D; background: var(--green-bg); color: var(--green); }
.day.preferred .dot { background: #1F7A4D; }
.day.excluded { border-color: #C0695F; background: var(--red-bg); color: var(--red); }
.day.excluded .dot { background: #9C2A20; }

/* Notes and messages */
.note { padding: 14px 16px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.55; }
.note.soft { background: var(--ground); color: var(--muted); }
.note.warn { background: var(--amber-bg); color: var(--amber); }
.note.bad { background: var(--red-bg); color: var(--red); }
.error { margin-top: 7px; font-size: 12.5px; color: var(--red); }
.error[hidden] { display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid .suffixed { border-color: #C0695F; }

/* Address suggestions */
.suggest { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.suggest[hidden] { display: none; }
.suggest button {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border: none; border-bottom: 1px solid var(--line-soft);
  background: var(--white);
  font: inherit; font-size: 14px; color: var(--ink);
  text-align: left; cursor: pointer;
}
.suggest button:last-child { border-bottom: none; }
.suggest button:hover, .suggest button:focus-visible { background: var(--tint); }

/* ---- Footer: price rail + actions ------------------------------------- */

.foot { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.rail-price { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.rail-price[hidden] { display: none; }
.rail-price .lab { font-size: 12px; font-weight: 500; color: var(--muted); }
.rail-price .sub { display: block; font-size: 10.5px; color: var(--faint); font-weight: 400; }
.rail-price .amt { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 23px; color: var(--navy); white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.btn {
  display: inline-block;
  padding: 15px 30px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--navy-dark); }
.btn[disabled] { background: #AFC3D6; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--tint); border: 1px solid #CBDCEB; color: var(--navy); }
.btn.ghost:hover { background: #E8F1F9; }

/* ---- Summary ---------------------------------------------------------- */

.sum-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.sum-row:last-of-type { border-bottom: none; }
.sum-row .k {
  flex-shrink: 0; width: 92px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint);
  padding-top: 2px;
}
.sum-row .v { flex-grow: 1; font-size: 14px; line-height: 1.5; }
.sum-row .edit { border: none; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--navy); cursor: pointer; white-space: nowrap; }
.bill { margin: 18px 0; padding: 18px; background: var(--ground); border-radius: 12px; }
.bill-line { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; padding: 3px 0; }
.bill-line .n { color: var(--muted); }
.bill-line .a { font-weight: 500; white-space: nowrap; }
.bill hr { border: none; border-top: 1px solid #DCE5ED; margin: 10px 0; }
.bill-total { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.bill-total .n { font-size: 14px; font-weight: 600; }
.bill-total .a { font-family: Lora, Georgia, serif; font-weight: 600; font-size: 23px; color: var(--navy); }

/* ---- Step sheet — phone ---------------------------------------------- */

.sheet-wrap { position: fixed; inset: 0; background: rgba(10,35,60,.42); display: flex; flex-direction: column; justify-content: flex-end; z-index: 20; }
.sheet-wrap[hidden] { display: none; }
.sheet-scrim { flex-grow: 1; border: none; background: none; cursor: pointer; }
.sheet { background: var(--white); border-radius: 18px 18px 0 0; padding: 18px 18px 24px; max-height: 80vh; overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.sheet-head h2 { font-size: 16px; }
.sheet-close { width: 44px; height: 44px; margin-right: -10px; display: flex; align-items: center; justify-content: center; border: none; background: none; cursor: pointer; }
.sheet-step {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 8px 6px;
  border: none; border-radius: 8px; background: none;
  font: inherit; font-size: 14px; color: var(--ink);
  text-align: left; cursor: pointer;
}
.sheet-step[disabled] { color: var(--faint); cursor: default; }
.sheet-step[aria-current="step"] { background: var(--tint); color: var(--navy); font-weight: 600; }

/* ---- Done screen ------------------------------------------------------ */

.done { text-align: center; padding: 20px 0 8px; }
.done .tickmark { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%; background: var(--green-bg); display: flex; align-items: center; justify-content: center; }
.done .ref { display: inline-block; margin-top: 16px; padding: 9px 16px; background: var(--ground); border-radius: 8px; font-size: 14px; }
.done .ref strong { font-weight: 600; }

/* ---- Utility ---------------------------------------------------------- */

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.dev-flag {
  max-width: 1240px; margin: 0 auto; padding: 10px 24px;
  font-size: 12px; color: var(--amber); background: var(--amber-bg);
}

/* ---- Laptop ----------------------------------------------------------- */

@media (min-width: 900px) {
  .rail { display: flex; }
  .step-toggle { display: none; }
  .card { padding: 32px; }
  h1 { font-size: 30px; }
  .ticks.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticks.two .span2 { grid-column: span 2; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tick-group .tick-body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .page { padding: 20px 16px 48px; gap: 0; }
  .card { padding: 20px 18px 24px; border-radius: 12px; }
  .masthead-inner { padding: 14px 16px; }
  .sum-row { flex-wrap: wrap; }
  .sum-row .k { width: 100%; }
}

@media print {
  .rail, .masthead a, .step-toggle, .actions, .dev-flag { display: none; }
  body { background: var(--white); }
  .card { border: none; }
}
