/* Design language follows tilo.dominikkocsordi.io */
:root {
  --bg: #FAF7F2;
  --bg-soft: #F3EDE4;
  --surface: #FFFFFF;
  --ink: #2B1D14;
  --ink-soft: #6E5E52;
  --line: #E7DFD4;
  --orange: #EE8E3A;
  --orange-deep: #C96F22;
  --orange-tint: #FCE6D1;
  --green: #5FB760;
  --green-deep: #3E8E46;
  --error: #B42318;
  --shadow: 0 1px 2px rgba(43, 29, 20, .05), 0 12px 40px -12px rgba(43, 29, 20, .18);
  --radius: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110D;
    --bg-soft: #211914;
    --surface: #261D17;
    --ink: #F7EFE6;
    --ink-soft: #B9A99B;
    --line: #3A2E25;
    --orange-tint: #3A2412;
    --error: #F97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 48px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }

.card {
  width: 100%;
  max-width: 520px;
  margin-top: 4vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 24px 28px;
  box-shadow: var(--shadow);
}
h1 {
  font: 750 clamp(30px, 8vw, 38px)/1.08 "Bricolage Grotesque", "Inter", sans-serif;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  text-wrap: balance;
}
h1:focus { outline: none; }
.step {
  margin: 0 0 14px;
  font: 400 14px/1.2 "Silkscreen", monospace;
  letter-spacing: .02em;
  color: var(--orange);
}
.muted { color: var(--ink-soft); margin: 0 0 8px; text-wrap: pretty; }
.error { color: var(--error); margin: 10px 0 0; font-size: 15px; text-align: center; }

/* Buttons – Tilo pill with pressed edge */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 999px;
  font: 600 19px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:focus-visible, .slider:focus-visible, input:focus-visible, .btn-link:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.btn-primary {
  margin-top: 28px;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 0 var(--orange-deep);
}
.btn-primary:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-deep); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.btn-choice {
  min-height: 92px;
  border-radius: 24px;
  font: 750 26px/1 "Bricolage Grotesque", "Inter", sans-serif;
  letter-spacing: -0.02em;
  background: var(--bg-soft);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
}
.btn-choice:active {
  transform: translateY(3px);
  border-color: var(--orange);
  background: var(--orange-tint);
  box-shadow: 0 1px 0 var(--orange);
}

.btn-link {
  display: block; margin: 16px auto 0; padding: 10px 14px;
  background: none; border: 0; border-radius: 999px;
  color: var(--ink-soft); font: 500 16px "Inter", sans-serif; cursor: pointer;
}

/* ---- Estimate ---- */
.estimate {
  text-align: center;
  margin: 24px 0 4px;
  min-height: 96px;
  display: flex; flex-direction: column; justify-content: center;
}
.estimate-value {
  display: block;
  font: 800 72px/1 "Bricolage Grotesque", "Inter", sans-serif;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--orange);
}
.estimate-value:empty { display: none; }
.estimate-hint { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* Custom slider: no initial position, no labels, no ticks */
.slider {
  position: relative;
  height: 80px;               /* large touch area */
  margin: 4px 0 8px;
  padding: 0 24px;            /* room for the thumb at both ends */
  cursor: pointer;
  touch-action: none;         /* we handle the gesture */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 20px;
}
.slider-rail {
  position: relative;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.slider-thumb {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -24px 0 0 -22px;
  border-radius: 50%;
  background: var(--orange);
  border: 4px solid var(--surface);
  box-shadow: 0 4px 0 var(--orange-deep), 0 6px 16px rgba(43, 29, 20, .2);
  pointer-events: none;
  transition: transform .12s ease;
}
.slider.dragging .slider-thumb { transform: scale(1.1); }

.fine { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; color: var(--ink-soft); font-size: 16px; }
.fine input {
  width: 7.5em;
  min-height: 52px;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--ink);
  font: 600 19px "Inter", sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.fine input[aria-invalid="true"] { border-color: var(--error); }

/* Done – pixel-style check like Tilo's green bullets */
.check {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--green); color: #fff;
  box-shadow: 0 5px 0 var(--green-deep);
  font: 700 36px/1 "Inter", sans-serif;
  margin: 0 0 22px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Step 2: recap of the first answer + visible scale ends */
.recap {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--orange-tint); color: var(--ink); font-size: 15px;
}
.recap strong { color: var(--orange-deep); font-weight: 700; }
.scale {
  display: flex; justify-content: space-between;
  margin: -14px 0 4px; padding: 0 6px;
  font: 400 13px/1.2 "Silkscreen", monospace; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
