/* ── Robotics Inc. Product Showroom ───────────────────────────────────────
   Self-contained: system fonts only, no external assets.
   Standalone dark theme — near-black #1B1F24, safety orange #FF6A13.
   Tokens (radius / shadow / font stack) match scripts/portal/web/portal.css
   so the showroom → deal-room funnel feels like one product.             */

:root {
  --slate: #1B1F24;
  --slate-2: #232930;
  --slate-3: #2E353D;
  --slate-4: #3A424C;
  --orange: #FF6A13;
  --orange-dark: #E05100;
  --orange-tint: rgba(255, 106, 19, .16);
  --orange-ink: #FFB280;
  --bg: #15181C;
  --card: #1F252B;
  --card-2: #232930;
  --ink: #EDF0F3;
  --muted: #9AA4B1;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --green: #17B877;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 20px 45px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; overflow-x: clip; }
body { touch-action: manipulation; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 88% -10%, rgba(255, 106, 19, .16), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(21, 24, 28, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px;
  background: var(--orange);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(255, 106, 19, .35);
}

.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; white-space: nowrap; }
.brand-divider { width: 1px; height: 20px; background: var(--line-strong); }
.brand-room {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ── App shell / boot states ────────────────────────────────────────────── */

#app { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }

.boot-state { text-align: center; padding: 120px 20px; color: var(--muted); }
.boot-state h2 { color: var(--ink); margin: .4em 0; }
.state-emoji { font-size: 2.6rem; margin: 0; }

.spinner {
  width: 42px; height: 42px; margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--orange);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.screen { padding-top: 36px; }

/* ── Hero + Wizard ───────────────────────────────────────────────────────── */

.hero-copy { text-align: center; max-width: 40rem; margin: 0 auto 28px; }
.hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
}
.hero-copy p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.wizard-card {
  max-width: 640px; margin: 0 auto;
  padding: 30px 26px;
}

.progress-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.progress-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate-4);
  transition: background .2s, transform .2s;
}
.progress-dots span.done { background: var(--orange); }
.progress-dots span.active { background: var(--orange); transform: scale(1.35); }

.wizard-prompt {
  margin: 0 0 20px;
  text-align: center;
  font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em;
}

.option-grid { display: grid; gap: 12px; }

.option-card {
  display: block; width: 100%; text-align: left;
  padding: 16px 18px;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.option-card:hover { border-color: var(--orange); background: var(--slate-3); }
.option-card:active { transform: translateY(1px); }
.option-card.selected { border-color: var(--orange); background: var(--orange-tint); }

.option-label { display: block; font-weight: 700; font-size: 1.02rem; }
.option-detail { display: block; margin-top: 3px; color: var(--muted); font-size: .86rem; }

.btn-back { margin: 20px auto 0; display: block; }

/* ── Split layout (recommendation + configurator) ───────────────────────── */

.screen-split {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
}

.viewer-shell {
  position: relative;
  height: min(56vh, 480px);
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(720px 320px at 50% 88%, rgba(255, 106, 19, .14), transparent 70%),
    linear-gradient(180deg, #20262C 0%, #14181C 100%);
  border: 1px solid var(--line);
}

.viewer-shell model-viewer {
  width: 100%; height: 100%;
  --poster-color: transparent;
  outline: none;
}

.viewer-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px;
  color: var(--muted);
}
.viewer-fallback .fallback-mark { width: 56px; height: 56px; opacity: .8; }
.viewer-fallback strong { color: var(--ink); font-size: 1rem; }
.viewer-fallback span { font-size: .86rem; max-width: 26rem; }

.viewer-rotate {
  position: absolute; top: 14px; right: 14px;
  padding: .35em 1em;
  background: rgba(27, 31, 36, .78);
  color: #EDF0F3;
  border: 0; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .03em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.viewer-rotate:hover { background: rgba(27, 31, 36, .92); }
.viewer-rotate[aria-pressed="true"] { background: var(--orange); color: #fff; }

/* model-viewer hotspot pills */
.hotspot-pill {
  border: none;
  padding: .32em .8em;
  border-radius: 999px;
  background: var(--slate);
  color: #fff;
  font-family: var(--font);
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  white-space: nowrap;
  pointer-events: none;
}
.hotspot-pill::before { content: "\25CF "; color: var(--orange); }

.side-panel { min-width: 0; }

.eyebrow {
  display: block; margin-bottom: 6px;
  font-size: .76rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange-ink);
}

.panel-title { margin: 0 0 14px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: .34em .85em;
  background: var(--orange-tint);
  color: var(--orange-ink);
  border: 1px solid rgba(255, 106, 19, .35);
  border-radius: 999px;
  font-size: .82rem; font-weight: 600;
}

.rationale { color: var(--muted); margin: 0 0 22px; max-width: 34rem; }

.price-block {
  padding: 18px 20px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
.price-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.price-value { display: block; margin: 4px 0 6px; font-size: 1.9rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.price-footnote { display: block; color: var(--muted); font-size: .78rem; }

/* Sticky bottom price card: shadow separates it from component toggles
   scrolling beneath; panel bottom padding lets the last group clear it. */
.price-block.sticky { position: sticky; bottom: 16px; z-index: 5; box-shadow: 0 -12px 32px rgba(16, 19, 23, .65); }
.config-panel { padding-bottom: 24px; }
.price-block .btn-lg { margin-top: 14px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row .btn { flex: 1 1 180px; }

.link-back {
  background: none; border: none; padding: 0; margin-bottom: 14px;
  color: var(--muted); font-family: var(--font); font-size: .88rem; font-weight: 600;
  cursor: pointer;
}
.link-back:hover { color: var(--orange-ink); }

/* ── Configurator pickers ────────────────────────────────────────────────── */

.picker-groups { display: grid; gap: 18px; margin-bottom: 22px; }

.picker-group span.picker-label {
  display: block; margin-bottom: 8px;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s, transform .1s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button {
  padding: .5em 1em;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font); font-size: .86rem; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.segmented button:hover { border-color: var(--orange); }
.segmented button.selected { border-color: var(--orange); background: var(--orange-tint); color: var(--orange-ink); }

/* ── Component toggles ───────────────────────────────────────────────────── */

.component-groups { display: grid; gap: 18px; margin-bottom: 20px; }

.component-group span.picker-label {
  display: block; margin-bottom: 8px;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

.component-list { display: grid; gap: 8px; }

.component-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.component-toggle:hover { border-color: var(--orange); }
.component-toggle.selected { border-color: var(--orange); background: var(--orange-tint); }

.toggle-switch {
  width: 36px; height: 20px; border-radius: 999px; flex: none;
  background: var(--slate-4);
  position: relative;
  transition: background .15s;
}
.toggle-switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.component-toggle.selected .toggle-switch { background: var(--orange); }
.component-toggle.selected .toggle-switch::after { transform: translateX(16px); }

.component-info { flex: 1; min-width: 0; }
.component-name { display: block; font-weight: 600; font-size: .92rem; }
.component-price { display: block; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: none; cursor: pointer;
  border-radius: 12px;
  padding: .7em 1.5em;
  font-family: var(--font);
  font-size: .95rem; font-weight: 700;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 106, 19, .38);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255, 106, 19, .5); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-ink); }

.btn-sm { padding: .45em 1em; font-size: .84rem; border-radius: 9px; }
.btn-lg { width: 100%; padding: .95em 2em; font-size: 1.02rem; }

/* ── Quote modal ─────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 14, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: 92vh; overflow-y: auto;
  padding: 28px 24px 26px;
  border-radius: 20px 20px 0 0;
}

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.modal-close:hover { color: var(--ink); border-color: var(--orange); }

.modal h2 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.modal-sub { margin: 0 0 22px; color: var(--muted); font-size: .92rem; }

.field { display: block; margin-bottom: 16px; }
.field span {
  display: block; margin-bottom: 6px;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.field input {
  width: 100%;
  padding: .72em .9em;
  font-family: var(--font); font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink);
  transition: border-color .15s;
}
.field input:focus { outline: none; border-color: var(--orange); }

.turnstile-container { margin: 4px 0 16px; min-height: 1px; }

.form-error {
  margin: 0 0 16px;
  padding: .7em 1em;
  background: rgba(211, 47, 47, .14); color: #FF9B8F;
  border: 1px solid rgba(211, 47, 47, .35);
  border-radius: 10px;
  font-size: .88rem;
}

.success-check {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green); color: #06341F;
  display: grid; place-items: center;
  font-size: 1.5rem; font-weight: 800;
}
#quoteSuccessView { text-align: center; }
#quoteSuccessView p { color: var(--muted); margin: 0 0 22px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (min-width: 900px) {
  .screen-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: start;
  }
  .viewer-shell { height: min(72vh, 620px); position: sticky; top: 90px; }
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 20px; max-height: 88vh; }
}

@media (max-width: 560px) {
  .topbar-inner { padding: 12px 16px; }
  #app { padding: 0 16px 90px; }
  .brand-room { display: none; }
  .brand-divider { display: none; }
  .wizard-card { padding: 22px 18px; }
  .viewer-shell { min-height: 260px; }
  .cta-row .btn { flex: 1 1 100%; }
}
