/* ==========================================================================
 * style.css — TESTUPS brand (Phase 3): white background, logo header,
 * azure #0890ED / #1AA0FF with cyan #61CEE2–#A3DDEB accents.
 * ========================================================================== */

* { box-sizing: border-box; }

:root {
  --accent: #0890ED;
  --accent-2: #1AA0FF;
  --accent-soft: #61CEE2;
  --accent-softer: #A3DDEB;
  --ink: #1d2b38;
  --ink-soft: #55677a;
  --line: #dbe4ec;
  --card: #ffffff;
  --bg: #f2f6f9;
  --ok: #0d9f6e;
  --bad: #d9403a;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* header — TESTUPS brand: white bg, logo, azure accent (Phase 3) */
.app-header {
  background: #ffffff;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #0890ED, #1AA0FF, #61CEE2, #A3DDEB) 1;
  padding: 14px 0;
}
.header-row { display: flex; align-items: center; gap: 18px; }
.logo { height: 54px; width: auto; flex-shrink: 0; }
.header-text { flex: 1; min-width: 0; }
.app-header h1 { margin: 0 0 2px; font-size: 24px; letter-spacing: -0.01em; color: var(--ink); }
.subtitle { margin: 0; color: var(--ink-soft); font-size: 13px; }
.btn-tour {
  border: 1.5px solid var(--accent); border-radius: 10px;
  background: #fff; color: var(--accent);
  padding: 9px 18px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  flex-shrink: 0; transition: background 150ms ease, color 150ms ease;
}
.btn-tour:hover, .btn-tour.active { background: var(--accent); color: #fff; }

/* cards */
main { padding: 18px 16px 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(13, 26, 40, 0.06);
}
.scene-card { padding: 10px; position: relative; }
.card-title { margin: 2px 4px 10px; font-size: 15px; }

canvas { display: block; width: 100%; border-radius: 8px; }

/* two-column zone under the scene */
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
}

/* readouts */
.readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  padding: 8px 6px 2px;
}
.ro { display: flex; align-items: baseline; gap: 7px; }
.ro-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
#lbl-ro-lambda { text-transform: none; } /* keep λ lowercase — Λ reads wrong */
.ro-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ro-value.ok { color: var(--ok); }
.ro-value.bad { color: var(--bad); }

.verdict {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 12px; border-radius: 999px;
}
.verdict.pass { background: rgba(13,159,110,0.12); color: var(--ok); border: 1px solid rgba(13,159,110,0.35); }
.verdict.fail { background: rgba(217,64,58,0.12); color: var(--bad); border: 1px solid rgba(217,64,58,0.35); }

/* controls */
.controls-card { display: flex; flex-direction: column; gap: 16px; }
.control .ctl-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ctl-label { font-size: 13px; font-weight: 600; color: var(--ink); }
output { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-soft));
  outline: none;
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 1px 4px rgba(13,26,40,0.25);
}
input[type='range']::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
}
input[type='range']::-moz-range-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

/* segmented mode switch */
.mode-row { display: flex; align-items: center; justify-content: space-between; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg {
  border: 0; background: #fff; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.seg.active { background: var(--accent); color: #fff; }
.seg.disabled { opacity: 0.45; cursor: not-allowed; }

/* play button + switches */
.toggles { display: flex; flex-direction: column; gap: 12px; }
.btn-primary {
  border: 0; border-radius: 10px; padding: 10px 16px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background 150ms ease;
}
.btn-primary:hover { background: #076fc0; }

.switch { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 40px; height: 22px; border-radius: 999px;
  background: #c4d0da; position: relative; transition: background 160ms ease; flex-shrink: 0;
}
.switch .track::before {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 160ms ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ghost button (Clear max-hold) */
.btn-ghost {
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink-soft);
  padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* controls disabled during the automated scan */
input[type='range']:disabled { opacity: 0.4; cursor: not-allowed; }
.seg.disabled, .btn-primary.disabled { opacity: 0.45; pointer-events: none; }

/* automated scan status + results table */
.scan-status {
  margin: 12px 4px 4px; font-size: 13px; font-weight: 600; color: var(--accent);
}
.table-wrap { overflow-x: auto; }
#scan-table {
  width: 100%; border-collapse: collapse; margin-top: 8px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
#scan-table th {
  text-align: left; padding: 7px 9px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
#scan-table td { padding: 6px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
#scan-table td.ok { color: var(--ok); font-weight: 700; }
#scan-table td.bad { color: var(--bad); font-weight: 700; }
#scan-table tr.row-fail { background: rgba(217,64,58,0.05); }
#scan-table .verdict { font-size: 10px; padding: 1px 9px; }

/* hotspot / guided-tour info card */
.spot-card {
  position: absolute;
  width: min(320px, calc(100% - 32px));
  background: #ffffff;
  border: 1px solid var(--accent-softer);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 10px 34px -8px rgba(8, 82, 140, 0.35);
  padding: 14px 16px 13px;
  z-index: 20;
}
.spot-card h4 { margin: 0 26px 6px 0; font-size: 14.5px; color: var(--ink); }
.spot-card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.spot-close {
  position: absolute; top: 6px; right: 8px;
  border: 0; background: none; font-size: 20px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 4px;
}
.spot-close:hover { color: var(--accent); }
.spot-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.spot-step { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }
.spot-nav-btns { display: flex; gap: 8px; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 8px; }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* mobile (Phase 3) */
@media (max-width: 560px) {
  .header-row { flex-wrap: wrap; gap: 10px; }
  .logo { height: 40px; }
  .app-header h1 { font-size: 19px; }
  .subtitle { font-size: 12px; }
  .btn-tour { width: 100%; }
  main { padding: 12px 10px 6px; }
  .card { padding: 10px; border-radius: 12px; }
  .readouts { gap: 6px 12px; }
  .ro-value { font-size: 13px; }
  .seg { padding: 8px 12px; }
  .btn-primary { padding: 12px 16px; }
  .spot-card {
    position: fixed;
    left: 10px !important; right: 10px;
    top: auto !important; bottom: 12px;
    width: auto;
  }
}

/* quiz (Phase 4) */
.quiz-card { margin-top: 16px; }
.quiz-q { margin: 14px 4px 18px; }
.quiz-question { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.quiz-opt {
  display: block; width: 100%; text-align: left;
  margin: 6px 0; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:disabled { cursor: default; opacity: 0.9; }
.quiz-opt.right { border-color: var(--ok); background: rgba(13,159,110,0.08); }
.quiz-opt.wrong { border-color: var(--bad); background: rgba(217,64,58,0.08); }
.quiz-why { margin: 8px 2px 0; font-size: 12.5px; color: var(--ink-soft); font-style: italic; }
.quiz-score { margin: 14px 4px 4px; font-size: 15px; }
.quiz-score strong { color: var(--accent); font-size: 18px; }
.quiz-verdict-text { margin: 0 4px 10px; font-size: 13.5px; color: var(--ink-soft); }

/* lead capture (optional) */
.lead-box {
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--accent-softer); border-radius: 12px;
  background: linear-gradient(180deg, rgba(163,221,235,0.12), rgba(163,221,235,0.03));
}
.lead-box h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.lead-box p { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }
#lead-form { display: flex; gap: 8px; flex-wrap: wrap; }
#lead-email {
  flex: 1; min-width: 200px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; color: var(--ink);
}
#lead-email:focus { outline: none; border-color: var(--accent); }
.lead-msg { font-size: 12.5px; font-weight: 600; margin: 8px 0 0 !important; }
.lead-msg.ok { color: var(--ok) !important; }
.lead-msg.bad { color: var(--bad) !important; }
.lead-privacy { font-size: 11px !important; color: #8195a8 !important; margin-top: 8px !important; }

/* footer */
.app-footer { padding: 14px 16px 26px; color: var(--ink-soft); font-size: 12px; }
.app-footer .tagline { font-weight: 600; color: var(--ink); }
