/* Magnetic pricing calculator. Internal tool, phone-first.
   Tokens and chrome lifted from ~/magnetic-v2 (styles.css + flow.css) so it
   reads as the same system. Dark only. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/inter-700.woff2') format('woff2'); }

:root {
  --tint: 255, 255, 255;
  --bg: #08090C;
  --bg-raise: #0C0D11;
  --panel: #101116;
  --panel-2: #15161C;
  --line: rgba(var(--tint),.07);
  --line-strong: rgba(var(--tint),.12);
  --ink: #FFFFFF;
  --ink-soft: #D3D7DE;
  --dim: #A5A8B0;
  --faint: #868B96;
  --accent: #2F6BFF;
  --accent-lite: #6FA6FF;
  --accent-deep: #1E52DB;
  --good: #4BD07E;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
input { font: inherit; }
::selection { background: rgba(47,107,255,.4); }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  background: rgba(8,9,12,.86); backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
@media (prefers-reduced-transparency: reduce) { .bar { background: var(--bg-raise); backdrop-filter: none; } }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #7FB2FF 0%, #2F6BFF 55%, #143A9E 100%);
  box-shadow: 0 4px 14px rgba(47,107,255,.5), inset 0 1px 0 rgba(255,255,255,.4);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand .mark svg { width: 14px; height: 14px; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; }
.brand span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-lite); }
.bar-tools { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--faint); transition: color .15s ease, background .15s ease;
}
.icon-btn:hover { color: var(--ink); background: rgba(var(--tint),.06); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- progress ---------- */
.prog { padding: 12px 20px 10px; border-bottom: 1px solid var(--line); }
.prog-bar { height: 4px; border-radius: 4px; background: rgba(var(--tint),.08); overflow: hidden; }
.prog-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #6FA6FF, #2F6BFF); border-radius: 4px;
  transition: width .35s cubic-bezier(.22,.61,.36,1);
}
.prog-t { display: block; margin-top: 8px; font-size: 12px; letter-spacing: .04em; color: var(--faint); }

/* ---------- screen ---------- */
main { flex: 1; display: flex; flex-direction: column; padding: 26px 20px calc(28px + env(safe-area-inset-bottom)); }
.screen { animation: flowIn .28s ease both; display: flex; flex-direction: column; flex: 1; }
@keyframes flowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .prog-bar i { transition: none; } }

.q-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-lite); }
.q-title { font-size: clamp(26px, 7vw, 34px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.12; margin: 12px 0 8px; }
.q-help { font-size: 15px; color: var(--faint); line-height: 1.55; margin-bottom: 22px; }
.q-title + .q-opts, .q-title + .chips, .q-title + .num-shell, .q-title + .fields { margin-top: 18px; }

/* option cards */
.q-opts { display: flex; flex-direction: column; gap: 10px; }
.q-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 60px; padding: 16px 18px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 16px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-soft);
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.q-opt:active { transform: scale(.985); }
.q-opt small { display: block; font-size: 13px; font-weight: 500; color: var(--faint); margin-top: 3px; line-height: 1.4; }
.q-opt .grow { flex: 1; }
.q-opt .tag { font-size: 13px; font-weight: 600; color: var(--faint); }
.q-opt .dot {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(var(--tint),.22); display: grid; place-items: center;
  transition: border-color .18s ease;
}
.q-opt .dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: transparent; transition: background .18s ease; }
.q-opt .box { border-radius: 6px; }
.q-opt .box::after { border-radius: 3px; }
.q-opt.sel { border-color: var(--accent); background: rgba(47,107,255,.1); color: var(--ink); }
.q-opt.sel .dot { border-color: var(--accent-lite); }
.q-opt.sel .dot::after { background: var(--accent-lite); }
.q-opt.sel .tag { color: var(--accent-lite); }

/* yes / no pair */
.q-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-pair .q-opt { justify-content: center; text-align: center; min-height: 76px; font-size: 17px; }

/* quick-select chips */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip {
  min-height: 60px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-soft);
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.chip:active { transform: scale(.97); }
.chip.sel { border-color: var(--accent); background: rgba(47,107,255,.1); color: var(--ink); }
.chip.chip-dim { font-size: 15px; font-weight: 600; color: var(--faint); }

/* number stepper */
.num-shell { display: flex; flex-direction: column; gap: 16px; }
.num-row { display: flex; align-items: center; gap: 12px; }
.step-btn {
  flex: 0 0 60px; height: 60px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 26px; font-weight: 600; color: var(--ink-soft);
  transition: background .15s ease, transform .12s ease;
}
.step-btn:active { transform: scale(.95); background: var(--panel-2); }
.num-input {
  flex: 1; min-width: 0; height: 60px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -0.02em;
}
.num-input:focus { outline: none; border-color: var(--accent); background: rgba(47,107,255,.07); }
.num-unit { text-align: center; font-size: 13px; color: var(--faint); }

/* text fields */
.fields { display: flex; flex-direction: column; gap: 14px; }
.fields label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--dim); }
.txt {
  width: 100%; padding: 15px 17px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); font-size: 16px; letter-spacing: -0.015em;
}
.txt:focus { outline: none; border-color: var(--accent); background: rgba(47,107,255,.07); }
.txt::placeholder { color: var(--faint); }
input[type="date"].txt { min-height: 52px; -webkit-appearance: none; appearance: none; color-scheme: dark; }

/* ---------- actions ---------- */
.actions { display: flex; gap: 10px; margin-top: auto; padding-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  padding: 15px 28px; border-radius: 999px; position: relative; isolation: isolate;
  transition: transform .18s ease, filter .18s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .38; pointer-events: none; }
.btn-blue {
  color: #fff; flex: 1;
  background: linear-gradient(180deg, #7FB2FF 0%, #4285F8 46%, #2F6BFF 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -2px 6px rgba(15,50,140,.5),
    0 6px 18px rgba(47,107,255,.42);
}
.btn-blue::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,.55) .6px, transparent .7px);
  background-size: 7px 7px; opacity: .35; mix-blend-mode: overlay;
}
.btn-ghost {
  color: var(--ink); background: rgba(var(--tint),.05);
  border: 1px solid var(--line-strong);
}
.btn-back { flex: 0 0 auto; padding: 15px 20px; }
.skip { align-self: center; margin-top: 16px; font-size: 14px; color: var(--faint); padding: 10px 18px; }
.skip:hover { color: var(--ink); }

/* ---------- results ---------- */
.res-hero {
  text-align: center; padding: 30px 20px 26px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(47,107,255,.12), rgba(47,107,255,.03));
  border: 1px solid rgba(47,107,255,.25);
}
.res-hero .q-eyebrow { color: var(--accent-lite); }
.res-price { font-size: clamp(52px, 15vw, 68px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: 10px; }
.res-price small { font-size: .38em; font-weight: 600; color: var(--dim); letter-spacing: -0.02em; }
.res-range { margin-top: 10px; font-size: 14px; color: var(--dim); }
.res-range b { color: var(--ink-soft); font-weight: 600; }
.res-rush { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #E8C583; border: 1px solid rgba(242,179,61,.35); border-radius: 999px; padding: 5px 12px; }

.res-grid { margin-top: 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.res-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.res-row:last-child { border-bottom: 0; }
.res-row span { font-size: 13.5px; font-weight: 600; color: var(--faint); }
.res-row b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.res-row.hot b { color: var(--ink); }
.res-row.good b { color: var(--good); }
.res-note { margin-top: 12px; font-size: 12.5px; color: var(--faint); line-height: 1.5; }

/* ---------- start screen extras ---------- */
.recent { margin-top: 30px; }
.recent h4 { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.recent .q-opt { min-height: 52px; padding: 13px 16px; font-size: 14.5px; }
.recent .q-opt b { color: var(--ink-soft); }

/* ---------- settings ---------- */
.set-group { margin-top: 26px; }
.set-group h4 { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.set-rows { border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row span { font-size: 14px; font-weight: 600; color: var(--dim); flex: 1; line-height: 1.35; }
.set-in {
  flex: 0 0 104px; height: 46px; text-align: right; padding: 0 13px;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 11px;
  color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.set-in:focus { outline: none; border-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px);
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--ink-soft);
  font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 60;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 720px) {
  .q-title { font-size: 32px; }
  main { padding-top: 40px; }
}
