/* SparClean booking — design tokens from brand book v1 (SparClean Blue #8AAED6) */
:root {
  --blue: #8aaed6;
  --blue-85: #edf3f9;
  --blue-60: #d0dfef;
  --blue-30: #adc6e2;
  --shade-25: #6882a0;
  --shade-45: #4c6076;
  --ink: #17191c;
  --ink-2: #2a2e34;
  --paper: #f5f7fa;
  --card: #ffffff;
  --line: #e6e9ee;
  --line-2: #f0f2f5;
  --muted: #6b7280;
  --faint: #9aa1aa;
  --success: #178a5a;
  --success-bg: #e7f5ee;
  --warn: #b7791f;
  --warn-bg: #fdf4e3;
  --error: #d8442f;
  --error-bg: #fdf2f0;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 25, 28, 0.04), 0 2px 8px rgba(23, 25, 28, 0.04);
  --shadow-md: 0 4px 16px rgba(23, 25, 28, 0.06), 0 12px 40px rgba(76, 96, 118, 0.10);
  --shadow-lg: 0 20px 60px rgba(76, 96, 118, 0.18);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--shade-25); }
.num { font-variant-numeric: tabular-nums; }
.sr, .field input.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 16px; }
/* width:auto matters: the img carries width/height attributes so the header
   reserves the right space before the file arrives, and without this the
   attribute's 368px would win over the aspect ratio and stretch the mark. */
.logo img { height: 30px; width: auto; display: block; }
.topbar-meta { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.topbar-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.topbar .spacer { flex: 1; }
.btn-wa {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; font-size: 14px;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
  text-decoration: none; color: var(--ink);
}
.btn-wa:hover { border-color: var(--blue-30); background: var(--blue-85); }
.btn-wa .ico { color: #25d366; }

/* ---------- Layout ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 24px 160px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h1 { font-size: 34px; line-height: 1.1; }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 52ch; font-size: 15.5px; }
.trust { display: flex; gap: 8px; flex-wrap: wrap; }
.trust span {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--shade-45); font-weight: 500;
}
.trust .ico { width: 16px; height: 16px; color: var(--shade-25); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 32px; align-items: start; }
.grid > * { min-width: 0; }
.form .field { min-width: 0; }

/* ---------- Step track ---------- */
.track { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.track-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 999px;
  color: var(--faint); font-weight: 500; font-size: 14px; transition: color .25s, background .25s;
}
.track-step .n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); font-family: var(--font-display); font-size: 13px; font-weight: 600; background: #fff;
  transition: all .3s var(--ease);
}
.track-step .n .ico { width: 14px; height: 14px; display: none; }
.track-step.done { color: var(--shade-45); }
.track-step.done .n { background: var(--blue-60); border-color: var(--blue-60); color: var(--shade-45); }
.track-step.done .n span { display: none; }
.track-step.done .n .ico { display: block; }
.track-step.active { color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.track-step.active .n { background: var(--ink); border-color: var(--ink); color: #fff; }
.track-step[disabled] { cursor: default; }
.track-step:not([disabled]):hover { background: #fff; }
.track-line { flex: 1; height: 1.5px; background: var(--line); margin: 0 4px; position: relative; overflow: hidden; }
.track-line::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.track-line.on::after { transform: scaleX(1); }

/* ---------- Steps ---------- */
.steps { position: relative; }
.step { display: none; animation: stepIn .45s var(--ease) both; }
.step.on { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.step-head h2 { font-size: 22px; }
.step-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* category chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 500;
  color: var(--ink-2); transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--blue-30); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 999px; background: var(--blue); color: var(--ink); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 18px; }
.chip:not(.has) .cnt { display: none; }

/* service cards */
.group { margin-bottom: 26px; }
.group.hidden { display: none; }
.group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--shade-25); font-weight: 600; margin: 0 0 10px; margin-inline-start: 4px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease), background .25s;
}
.card:hover { border-color: var(--blue-30); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.on { border-color: var(--blue); background: linear-gradient(135deg, #fff 55%, var(--blue-85)); box-shadow: 0 0 0 3px var(--blue-85), var(--shadow-md); }
.card .tile {
  width: 52px; height: 52px; border-radius: 14px; background: var(--blue-85); display: grid; place-items: center; color: var(--shade-45);
  transition: background .25s, color .25s, transform .3s var(--ease); flex: none;
}
.card .tile .ico { width: 26px; height: 26px; }
.card.on .tile { background: var(--blue); color: var(--ink); }
.card-main { flex: 1; min-width: 0; }
.card-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.card-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-price { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; margin-top: 6px; color: var(--shade-45); }
.card-price small { font-weight: 500; color: var(--faint); font-family: var(--font-body); font-size: 12px; }
.step-ctl { display: flex; align-items: center; gap: 0; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); padding: 3px; flex: none; }
.step-ctl button {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  transition: background .2s, color .2s, transform .15s var(--ease);
}
.step-ctl button:hover:not(:disabled) { background: #fff; box-shadow: var(--shadow-sm); }
.step-ctl button:active:not(:disabled) { transform: scale(.9); }
.step-ctl button:disabled { color: var(--line); }
.step-ctl button .ico { width: 16px; height: 16px; }
.step-ctl output { width: 30px; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; display: block; }
.step-ctl output.bump { animation: bump .3s var(--ease); }
@keyframes bump { 30% { transform: scale(1.35); color: var(--shade-25); } }
.card.on .step-ctl { background: #fff; border-color: var(--blue-60); }

/* quote toggles */
.quotes { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: #fff; border: 1.5px dashed var(--blue-30);
  font-size: 14px; font-weight: 500; color: var(--shade-45); transition: all .2s var(--ease);
}
.qchip .ico { width: 16px; height: 16px; }
.qchip.on { background: var(--blue-85); border-style: solid; border-color: var(--blue); color: var(--ink); }
.qchip small { color: var(--faint); font-weight: 400; }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-85); color: var(--shade-45); font-size: 13.5px; margin-top: 12px; }
.hint .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--shade-25); }

/* date strip */
.dates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.dates::-webkit-scrollbar { display: none; }
.date {
  flex: none; min-width: 74px; padding: 12px 10px 10px; border-radius: var(--r-md); background: #fff; border: 1.5px solid var(--line);
  text-align: center; transition: all .25s var(--ease); scroll-snap-align: start;
}
.date .dow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; white-space: nowrap; }
.date .d { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; margin: 3px 0 1px; }
.date .m { font-size: 12px; color: var(--muted); }
.date:hover { border-color: var(--blue-30); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.date.on { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-md); }
.date.on .dow, .date.on .m { color: rgba(255, 255, 255, .7); }
.date:disabled { opacity: .4; transform: none; box-shadow: none; }

.slots-wrap { margin-top: 12px; }
.slot-part { margin-bottom: 14px; }
.slot-part h4 { margin: 0 0 8px 2px; font-size: 12.5px; font-weight: 600; color: var(--shade-25); display: flex; align-items: center; gap: 6px; }
.slot-part h4 .ico { width: 15px; height: 15px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.slot {
  padding: 11px 10px; border-radius: var(--r-sm); background: #fff; border: 1.5px solid var(--line); text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; transition: all .2s var(--ease);
}
.slot small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.slot:hover:not(:disabled) { border-color: var(--blue-30); box-shadow: var(--shadow-sm); }
.slot.on { border-color: var(--blue); background: var(--blue-85); box-shadow: 0 0 0 3px var(--blue-85); }
.slot:disabled { opacity: .4; text-decoration: line-through; }
.slot:disabled small { text-decoration: none; }

.timeline { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); }
.timeline .tl-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line-2); position: relative; overflow: hidden; }
.timeline .tl-bar > i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 0; background: linear-gradient(90deg, var(--blue-30), var(--blue)); border-radius: 999px; transition: width .6s var(--ease); }
.timeline .tl-t { font-family: var(--font-display); font-weight: 600; font-size: 14px; white-space: nowrap; }
.timeline .tl-t small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--faint); }

/* form */
.form { display: grid; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--shade-45); margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
  font-size: 15px; transition: border-color .2s, background .2s, box-shadow .2s;
}
.field textarea { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px var(--blue-85); }
.field input.bad { border-color: var(--error); background: var(--error-bg); }
.field .err { font-size: 12px; color: var(--error); margin-top: 5px; display: none; }
.field.bad .err { display: block; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos label {
  width: 72px; height: 72px; border-radius: var(--r-sm); border: 1.5px dashed var(--blue-30); display: grid; place-items: center; color: var(--shade-25);
  cursor: pointer; transition: all .2s; background: var(--blue-85);
}
.photos label:hover { border-color: var(--blue); }
.photos img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* review */
.review { display: grid; gap: 12px; }
.rv { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.rv .tile { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-85); color: var(--shade-45); display: grid; place-items: center; flex: none; }
.rv .tile .ico { width: 20px; height: 20px; }
.rv-main { flex: 1; min-width: 0; }
.rv-main h4 { margin: 0 0 2px; font-size: 12.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.rv-main p { margin: 0; font-size: 15px; }
.rv-main p + p { color: var(--muted); font-size: 13.5px; }
.rv .edit { font-size: 13px; font-weight: 500; color: var(--shade-25); padding: 6px 10px; border-radius: 999px; }
.rv .edit:hover { background: var(--blue-85); }
.rv ul { list-style: none; margin: 0; padding: 0; }
.rv ul li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14.5px; }
.rv ul li > span { min-width: 0; }
.rv ul li b { white-space: nowrap; }
.rv ul li b { font-weight: 600; }
.promo { margin: 2px 0; }
.promo-input { display: flex; gap: 8px; }
.promo-input input {
  flex: 1; min-width: 0; height: 44px; padding: 0 13px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
}
.promo-input input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-85); }
.promo-input .btn { width: auto; margin: 0; height: 44px; padding: 0 18px; font-size: 14.5px; }
.promo-on {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1.5px solid var(--blue); border-radius: var(--r-sm);
  background: linear-gradient(135deg, #fff 55%, var(--blue-85));
}
.promo-on .ico { width: 18px; height: 18px; color: var(--shade-25); }
.promo-on b { flex: none; font-weight: 600; letter-spacing: .04em; }
.promo-on .num { flex: 1; color: var(--success); font-weight: 600; }
.promo-on button { font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 8px; border-radius: 999px; }
.promo-on button:hover { background: #fff; color: var(--ink); }

.pay-methods { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 4px 2px; }
.pay-methods .pm { padding: 5px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 12px; color: var(--ink-2); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding: 4px 2px; }
.agree input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 1px; }

/* ---------- Summary panel ---------- */
.panel {
  position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-md);
}
.panel h2 { font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.panel h2 .badge { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--shade-25); background: var(--blue-85); padding: 3px 9px; border-radius: 999px; }
.lines { list-style: none; margin: 14px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line-2); animation: lineIn .3s var(--ease); }
@keyframes lineIn { from { opacity: 0; transform: translateX(-6px); } }
.lines li .l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines li .q { color: var(--faint); font-size: 12.5px; margin-inline-start: 6px; }
.lines li b { font-weight: 600; }
.lines li.quote b { color: var(--shade-25); font-weight: 500; font-size: 12.5px; }
.empty { margin: 14px 0 0; padding: 18px; border-radius: var(--r-md); background: var(--paper); color: var(--muted); font-size: 13.5px; text-align: center; }
.total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.total span { color: var(--muted); font-size: 13.5px; }
.total-num { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.total-num small { font-size: 15px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; letter-spacing: 0; }
.meter { margin-top: 12px; }
.meter-bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-30), var(--blue)); border-radius: 999px; transition: width .5s var(--ease), background .3s; }
.meter.done .meter-fill { background: var(--success); }
.meter-txt { margin: 7px 0 0; font-size: 12.5px; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.meter.done .meter-txt { color: var(--success); }
.meter-txt .ico { width: 14px; height: 14px; }
.facts { display: grid; gap: 6px; margin-top: 12px; }
.fact { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fact .ico { width: 15px; height: 15px; color: var(--shade-25); }
.fact b { color: var(--ink); font-weight: 500; }
.btn { text-decoration: none;
  width: 100%; height: 52px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px;
  transition: background .2s, transform .15s var(--ease), box-shadow .2s;
  box-shadow: 0 6px 18px rgba(23, 25, 28, .18);
}
.btn:hover:not(:disabled) { background: var(--ink-2); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.btn:disabled { background: var(--line); color: var(--faint); box-shadow: none; }
.btn .ico { width: 18px; height: 18px; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; margin-top: 10px; height: 46px; font-size: 14.5px; }
.btn.ghost:hover:not(:disabled) { background: var(--blue-85); border-color: var(--blue-30); }
.btn.ghost .ico { color: #25d366; }
.btn.busy { pointer-events: none; }
.btn.busy::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fineprint { margin: 10px 0 0; font-size: 12px; color: var(--faint); text-align: center; line-height: 1.45; }
.fineprint .ico { width: 12px; height: 12px; vertical-align: -2px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-lg);
  transition: all .35s var(--ease); z-index: 60; max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--error); }

/* mobile bar */
.mbar { display: none; }

/* ---------- Thanks page ---------- */
.thanks { max-width: 560px; margin: 0 auto; padding: 48px 24px 80px; text-align: center; }
.thanks .mark { position: relative; width: 96px; height: 96px; margin: 0 auto 22px; }
.thanks .mark .ring { position: absolute; inset: 0; border-radius: 50%; background: var(--blue-85); animation: ringIn .6s var(--ease) both; }
.thanks .mark .ring2 { position: absolute; inset: 12px; border-radius: 50%; background: var(--blue-60); animation: ringIn .6s .1s var(--ease) both; }
.thanks .mark svg { position: absolute; inset: 24px; width: 48px; height: 48px; color: var(--ink); }
.thanks .mark svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ringIn { from { transform: scale(.4); opacity: 0; } }
.thanks .mark.spin .ring { animation: none; }
.thanks .mark.spin .ring2 { animation: none; inset: 18px; background: none; border: 3px solid var(--blue-60); border-top-color: var(--shade-25); animation: spin 1s linear infinite; }
.thanks .mark.fail .ring { background: var(--error-bg); }
.thanks .mark.fail .ring2 { background: #f8d7d0; }
.thanks .mark.fail svg { color: var(--error); }
.thanks h1 { font-size: 30px; }
.thanks p.lead { color: var(--muted); font-size: 15.5px; margin: 10px auto 0; max-width: 40ch; }
.ticket { margin: 28px 0 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); text-align: left; overflow: hidden; animation: stepIn .5s .2s var(--ease) both; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--blue-85); }
.ticket-head .ref { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.ticket-head .ref small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--shade-25); text-transform: uppercase; letter-spacing: .08em; }
.ticket-head .paid { font-size: 12.5px; font-weight: 600; color: var(--success); background: var(--success-bg); padding: 5px 10px; border-radius: 999px; display: flex; align-items: center; gap: 5px; }
.ticket-head .paid .ico { width: 13px; height: 13px; }
.ticket-body { padding: 8px 20px 18px; }
.ticket-body .row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.ticket-body .row:last-child { border-bottom: 0; }
.ticket-body .row .ico { width: 18px; height: 18px; color: var(--shade-25); margin-top: 2px; }
.ticket-body .row h4 { margin: 0 0 2px; font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ticket-body .row p { margin: 0; font-size: 14.5px; }
.ticket-body ul { list-style: none; margin: 0; padding: 0; }
.ticket-body ul li { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; }
.ticket-body .cuts { list-style: none; margin: 4px 0 0; padding: 0; }
.ticket-body .cuts li { font-size: 13px; color: var(--success); padding: 1px 0; }
.ticket-body .tt { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.actions { display: grid; gap: 10px; margin-top: 18px; }
.actions .btn { margin: 0; }
.next-steps { margin: 26px 0 0; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.next-steps h3 { font-size: 14px; margin-bottom: 8px; }
.next-steps ol { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .panel { display: none; }
  .page { padding-bottom: 120px; }
  .hero h1 { font-size: 28px; }
  .track-step span.t { display: none; }
  .track-step.active span.t { display: inline; }
  .mbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(23,25,28,.08);
  }
  .mbar-row { display: flex; align-items: center; gap: 14px; }
  .mbar-total { flex: 1; min-width: 0; text-align: start; }
  .mbar-total .t { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.1; }
  .mbar-total .t small { font-size: 13px; color: var(--muted); font-weight: 500; }
  .mbar-total .s { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
  .mbar-total .s span { overflow: hidden; text-overflow: ellipsis; }
  .mbar-total .s .ico { width: 12px; height: 12px; transition: transform .25s; }
  .mbar.open .mbar-total .s .ico { transform: rotate(180deg); }
  .mbar .btn { width: auto; min-width: 160px; margin: 0; height: 48px; padding: 0 20px; white-space: nowrap; }
  .mbar-sheet { display: none; padding: 10px 0 6px; }
  .mbar.open .mbar-sheet { display: block; }
  .mbar-sheet .lines { max-height: 40vh; margin-top: 0; }
}
@media (max-width: 600px) {
  .topbar-in { padding: 0 16px; height: 58px; }
  .topbar-meta { display: none; }
  .page { padding: 16px 16px 120px; }
  .cards { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .form { padding: 16px; }
  .mbar .btn { min-width: 0; flex: 1; }
  .btn-wa span { display: none; }
  .btn-wa { width: 38px; padding: 0; justify-content: center; }

  /* Anything under 16px makes iOS zoom the page when the field is focused. */
  .field input, .field select, .field textarea, .loc input { font-size: 16px; }

  /* The hero belongs to the first step. Later steps have their own heading,
     so on a phone it is 300px of nothing between the customer and the task. */
  body:not([data-step="1"]) .hero { display: none; }
  .hero { gap: 14px; margin-bottom: 16px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14.5px; margin-top: 6px; }

  /* The swipe rows below bleed to the screen edge with negative margins.
     `clip` keeps that bleed without letting the page scroll sideways, and
     unlike `hidden` it does not break sticky positioning. */
  .page { overflow-x: clip; }
  .hero { max-width: 100%; min-width: 0; }
  .trust { max-width: 100%; }

  /* Chip rows swipe sideways instead of stacking three deep. */
  .trust, .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px; padding-bottom: 2px;
  }
  .trust::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .trust span, .chip { flex: none; }
  .chips { margin-bottom: 14px; }
  .track { margin-bottom: 16px; }
  .step-head { margin-bottom: 12px; }
  .step-head h2 { font-size: 20px; }

  /* Thumb-sized steppers. */
  .step-ctl button { width: 38px; height: 38px; }
  .step-ctl output { width: 32px; }
  .card { padding: 12px; gap: 12px; }
  .card .tile { width: 46px; height: 46px; border-radius: 12px; }
  .card .tile .ico { width: 24px; height: 24px; }

  .rv { padding: 14px; gap: 12px; }
  .rv .tile { width: 34px; height: 34px; border-radius: 10px; }
  .rv .tile .ico { width: 17px; height: 17px; }
  .rv .edit { padding: 6px 8px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Invoice note + location picker ---------- */
.form-note { display: flex; gap: 8px; align-items: flex-start; margin: -2px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--blue-85); color: var(--shade-45); font-size: 13px; }
.form-note .ico { width: 16px; height: 16px; color: #25d366; margin-top: 1px; }

.loc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; white-space: nowrap;
  border: 1.5px solid var(--blue-30); border-radius: var(--r-sm); background: var(--blue-85);
  color: var(--shade-45); font-size: 14.5px; font-weight: 500;
  transition: border-color .2s, background .2s, color .2s;
}
.loc-btn:hover:not(:disabled) { border-color: var(--blue); background: #fff; color: var(--ink); }
.loc-btn:disabled { opacity: .6; }
.loc-btn .ico { width: 18px; height: 18px; }
.loc-or { font-size: 13px; color: var(--faint); }
.field .loc input { flex: 1; width: auto; min-width: 170px; }
.field.bad .loc input { border-color: var(--error); background: var(--error-bg); }

.loc-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1.5px solid var(--blue); border-radius: var(--r-sm);
  background: linear-gradient(135deg, #fff 55%, var(--blue-85));
  animation: stepIn .3s var(--ease);
}
.loc-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--blue); color: var(--ink); display: grid; place-items: center; flex: none; }
.loc-main { flex: 1; min-width: 0; }
.loc-title { font-weight: 600; font-size: 14.5px; }
.loc-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-open { font-size: 13px; font-weight: 500; color: var(--shade-25); white-space: nowrap; text-decoration: none; padding: 7px 10px; border-radius: 999px; }
.loc-open:hover { background: #fff; color: var(--ink); }
.loc-clear { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); flex: none; }
.loc-clear:hover { background: #fff; color: var(--ink); }
.loc-clear .ico { width: 15px; height: 15px; }

.rv-link { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--shade-25); text-decoration: none; }
.rv-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .loc { flex-direction: column; align-items: stretch; gap: 8px; }
  .loc-or { text-align: center; }
  .loc-btn { justify-content: center; }
  .field .loc input { min-width: 0; }
  /* Card becomes two rows: pin + text + clear, then a full-width map link. */
  .loc-card { flex-wrap: wrap; gap: 10px 12px; }
  .loc-clear { order: 2; }
  .loc-open { order: 3; flex: 1 1 100%; text-align: center; padding: 9px; background: #fff; border: 1px solid var(--blue-30); border-radius: var(--r-sm); }
}

/* ---------- Language switcher ---------- */
.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.langs button {
  min-width: 34px; height: 30px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em;
  transition: background .2s, color .2s;
}
.langs button:hover:not(.on) { color: var(--ink); background: #fff; }
.langs button.on { background: var(--ink); color: #fff; }

/* ---------- Savings breakdown ---------- */
.savings { list-style: none; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line-2); }
.savings:empty { display: none; }
.savings li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13.5px; color: var(--muted); }
.savings li b { color: var(--ink); font-weight: 600; }
.savings li.cut b { color: var(--success); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.modal-bg { position: absolute; inset: 0; background: rgba(23, 25, 28, .45); backdrop-filter: blur(3px); animation: fadeIn .25s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 400px; background: #fff;
  border-radius: var(--r-lg); padding: 26px 24px 20px; box-shadow: var(--shadow-lg);
  animation: stepIn .35s var(--ease);
  max-height: 88vh; overflow-y: auto;
}
.modal-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--faint); }
.modal-x:hover { background: var(--paper); color: var(--ink); }
.modal-x .ico { width: 16px; height: 16px; }
.modal-ico { width: 46px; height: 46px; border-radius: 14px; background: #e9f9ef; color: #25d366; display: grid; place-items: center; margin-bottom: 14px; }
.modal-ico .ico { width: 24px; height: 24px; }
.modal-card h3 { font-size: 20px; }
.modal-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.modal-why { margin: 12px 0 16px; font-size: 13px; color: var(--shade-45); background: var(--blue-85); padding: 10px 12px; border-radius: var(--r-sm); }
.otp-input { text-align: center; font-family: var(--font-display); font-size: 26px !important; font-weight: 600; letter-spacing: .28em; height: 56px !important; }
.pw-row { display: flex; gap: 8px; align-items: stretch; }
.pw-row input { flex: 1; min-width: 0; }
.pw-row .link { flex: none; padding: 0 10px; white-space: nowrap; }

.modal-err { margin: 8px 0 0; font-size: 13px; color: var(--error); }
.modal-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.link { font-size: 13px; font-weight: 500; color: var(--shade-25); }
.link:hover:not(:disabled) { color: var(--ink); text-decoration: underline; }
.link:disabled { color: var(--faint); cursor: default; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Account page ---------- */
.acc-loading { display: grid; place-items: center; padding: 80px 0; }
.spin-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--shade-25); animation: spin .8s linear infinite; }
.account { max-width: 780px; margin: 0 auto; padding: 28px 24px 80px; }
.account-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.account-hero h1 { font-size: 28px; }
.account-hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tier-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14px; border: 1.5px solid var(--line); background: #fff;
}
.tier-badge .ico { width: 16px; height: 16px; }
.tier-badge[data-tier="silver"] { background: linear-gradient(135deg, #f2f5f8, #dfe6ee); border-color: #cfd8e3; color: #45566b; }
.tier-badge[data-tier="gold"] { background: linear-gradient(135deg, #fff6e0, #ffe9b8); border-color: #e8cf93; color: #7a5c18; }

.acards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 26px; }
.acard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.acard h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--shade-25); font-weight: 600; }
.acard .big { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; }
.acard .big small { font-size: 15px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.acard p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.acard .bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.acard .bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--blue-30), var(--blue)); transition: width .6s var(--ease); }

.invite-code {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px;
  border: 1.5px dashed var(--blue-30); border-radius: var(--r-sm); background: var(--blue-85);
  font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .12em;
}
.invite-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.invite-actions .btn { margin: 0; height: 42px; font-size: 14px; flex: 1; min-width: 150px; }

.orders { display: grid; gap: 10px; }
.order {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px;
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.order-main { flex: 1; min-width: 180px; }
.order-ref { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }
.order-when { font-size: 13px; color: var(--muted); margin-top: 2px; }
.order-items { font-size: 13px; color: var(--shade-45); margin-top: 6px; }
.order-money { text-align: end; white-space: nowrap; }
.order-total { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.order-cut { font-size: 12px; color: var(--success); }
.order-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.order-status[data-s="PAID"] { background: var(--success-bg); color: var(--success); }
.order-status[data-s="AWAITING_PAYMENT"] { background: var(--warn-bg); color: var(--warn); }
.order-status[data-s="FAILED"] { background: var(--error-bg); color: var(--error); }
.section-title { font-size: 17px; margin-bottom: 12px; }
.signin-card { max-width: 400px; margin: 40px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 24px; box-shadow: var(--shadow-md); }
.signin-card h1 { font-size: 22px; }
.signin-card p { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }

@media (max-width: 600px) {
  .account { padding: 18px 16px 56px; }
  .account-hero { margin-bottom: 16px; }
  .account-hero h1 { font-size: 23px; }
  .order-money { text-align: start; }
  /* One number per full-width card wastes a screen. The tier card keeps its
     progress bar, the other two sit side by side. */
  .acards { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .acards .acard:first-child { grid-column: 1 / -1; }
  .acard { padding: 14px; border-radius: var(--r-md); }
  .acard h3 { font-size: 11px; letter-spacing: .05em; }
  .acard .big { font-size: 25px; margin-top: 6px; }
  .acard .big small { font-size: 13px; }
  .acard p { font-size: 12px; margin-top: 6px; }
  .section-title { font-size: 16px; }
  .order { padding: 12px 14px; gap: 10px; }
  .invite-actions .btn { min-width: 0; }
}

/* ---------- Right-to-left (Arabic) ---------- */
:root:lang(ar) {
  --font-display: "Noto Sans Arabic", "Poppins", system-ui, sans-serif;
  --font-body: "Noto Sans Arabic", "Inter", system-ui, sans-serif;
}
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; }
:lang(ar) .group > h3, :lang(ar) .rv-main h4, :lang(ar) .ticket-body .row h4,
:lang(ar) .date .dow, :lang(ar) .ticket-head .ref small { text-transform: none; letter-spacing: 0; }
[dir="rtl"] .track-line::after { transform-origin: right; }
[dir="rtl"] .ico-arrow { transform: scaleX(-1); }
[dir="rtl"] .card.on { background: linear-gradient(225deg, #fff 55%, var(--blue-85)); }
[dir="rtl"] .meter-fill, [dir="rtl"] .timeline .tl-bar > i { background: linear-gradient(270deg, var(--blue-30), var(--blue)); }
[dir="rtl"] .meter.done .meter-fill { background: var(--success); }
/* Latin runs (prices, times, AED) keep their own direction inside RTL text. */
[dir="rtl"] .num, [dir="rtl"] .slot, [dir="rtl"] .date .d, [dir="rtl"] .tl-t { direction: ltr; unicode-bidi: isolate; }

/* ---------- Small phones ---------- */
@media (max-width: 420px) {
  .topbar-in { gap: 8px; padding: 0 12px; }
  .logo img { height: 23px; }
  .langs { padding: 2px; }
  .langs button { min-width: 27px; height: 27px; padding: 0 6px; font-size: 11px; }
  .btn-wa { width: 34px; height: 34px; }
  .page { padding: 14px 12px 118px; }
  .trust, .chips { margin-inline: -12px; padding-inline: 12px; }
  .hero h1 { font-size: 24px; }
  .mbar .btn { padding: 0 12px; font-size: 14px; }
  .account { padding: 16px 12px 56px; }
  .modal { padding: 12px; }
  .modal-card { padding: 22px 18px 16px; }
}

@media (max-width: 360px) {
  /* No room for the estimate next to the total on the narrowest phones. */
  .mbar-total .s .dur { display: none; }
}

/* ---------- Landscape phones: height is the scarce axis ---------- */
@media (max-height: 480px) and (max-width: 960px) {
  .hero p { display: none; }
  .hero { margin-bottom: 12px; }
  .hero h1 { font-size: 22px; }
  body:not([data-step="1"]) .hero { display: none; }
  .page { padding-top: 12px; }
  .track { margin-bottom: 12px; }
  .step-head { margin-bottom: 10px; }
  .modal-card { max-height: 92vh; }
  .modal-why { display: none; }
  /* Reassurance chips and step subtitles are the first things to cut when
     there are only ~360px of height to work with. */
  .trust { display: none; }
  .step-head p { display: none; }
  .chips { margin-bottom: 10px; }
}
