/* =========================================================================
   MMSx MoveScan — TrainersEye visual system
   dark #0A0A0A · amber #FFC107 · Barlow. Boldness spent on the score dial;
   everything else stays quiet.
   ========================================================================= */
:root {
  --bg:        #0A0A0A;
  --surface:   #141414;
  --surface-2: #1c1c1c;
  --line:      #2a2a2a;
  --amber:     #FFC107;
  --amber-dim: #b8860b;
  --text:      #f4f2ec;
  --muted:     #9a968c;
  --ok:        #46c07a;
  --mild:      #ffd24a;
  --moderate:  #ff9d3c;
  --significant:#ff5c5c;
  --radius: 14px;
  --maxw: 720px;
  --font: "Barlow", system-ui, -apple-system, sans-serif;
  --font-cond: "Barlow Semi Condensed", var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--amber); text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(10,10,10,.9);
  backdrop-filter: blur(8px); z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand b { font-family: var(--font-cond); font-weight: 700; letter-spacing: .5px;
  font-size: 20px; text-transform: uppercase; }
.brand b span { color: var(--amber); }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.topbar .who { font-size: 13px; color: var(--muted); }
.topbar .who b { color: var(--amber); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-cond); font-weight: 600; font-size: 16px;
  letter-spacing: .4px; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 10px;
  padding: 14px 22px; cursor: pointer; transition: transform .06s ease, background .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: #1a1300; }
.btn-primary:hover { background: #ffce3a; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber-dim); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Landing hero ---- */
.hero { padding: 64px 0 40px; text-align: center; }
.eyebrow { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 2px;
  color: var(--amber); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-family: var(--font-cond); font-weight: 700; font-size: clamp(38px, 8vw, 64px);
  line-height: .98; text-transform: uppercase; letter-spacing: -.5px; }
.hero h1 em { color: var(--amber); font-style: normal; }
.hero p { color: var(--muted); font-size: 18px; max-width: 460px; margin: 20px auto 32px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.disclaim { color: var(--muted); font-size: 12.5px; margin-top: 26px; line-height: 1.4;
  max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---- Steps / features ---- */
.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section h2 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px;
  font-size: 24px; margin-bottom: 22px; }
.steps { display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 42px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .n { font-family: var(--font-cond); font-weight: 700; font-size: 22px; color: var(--amber);
  border: 1px solid var(--amber-dim); border-radius: 8px; width: 42px; height: 42px;
  display: grid; place-items: center; }
.step h3 { font-size: 17px; margin-bottom: 3px; }
.step p { color: var(--muted); font-size: 15px; }

.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.plan.pro { border-color: var(--amber-dim); }
.plan h3 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px; font-size: 20px; }
.plan .price { font-size: 30px; font-weight: 700; margin: 8px 0 12px; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; display: grid; gap: 8px; }
.plan li { font-size: 14.5px; color: var(--text); padding-left: 22px; position: relative; }
.plan li::before { content: "\2713"; position: absolute; left: 0; color: var(--amber); font-weight: 700; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "\2013"; color: var(--muted); }
@media (max-width: 560px) { .pricing { grid-template-columns: 1fr; } }

.footer { padding: 34px 20px 60px; text-align: center; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }

/* =========================================================================
   APP (app.html)
   ========================================================================= */
.app-main { padding: 20px 0 90px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 14px; }
.h-title { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px; font-size: 22px; margin-bottom: 6px; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }

/* view chooser */
.view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.view-opt { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color .15s ease; }
.view-opt:hover, .view-opt.sel { border-color: var(--amber); }
.view-opt .ico { font-size: 34px; margin-bottom: 8px; }
.view-opt h4 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px; font-size: 17px; }
.view-opt p { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* camera stage */
.stage { position: relative; width: 100%; aspect-ratio: 3 / 4; background: #000;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage video { transform: scaleX(-1); }        /* mirror for natural framing */
.stage canvas { transform: scaleX(-1); }
.stage .cam-grid { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.stage .cam-grid .g { stroke: rgba(255,255,255,.14); stroke-width: .35; }
.stage .cam-grid .cl { stroke: var(--amber); stroke-width: .5; stroke-dasharray: 3 3; opacity: .75; }
.stage .cam-grid .tgt { fill: none; stroke: rgba(255,255,255,.32); stroke-width: .5; stroke-dasharray: 2 3; }
.stage .cam-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; border: 4px solid transparent; border-radius: var(--radius); transition: border-color .15s ease, box-shadow .15s ease; }
.stage .cam-frame.b-red { border-color: var(--significant); box-shadow: inset 0 0 30px rgba(255,92,92,.35); }
.stage .cam-frame.b-amber { border-color: var(--moderate); }
.stage .cam-frame.b-green { border-color: var(--ok); box-shadow: inset 0 0 28px rgba(70,192,122,.30); }
.stage .status { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; text-align: center; backdrop-filter: blur(4px); }
.stage .status.good { border-color: var(--ok); color: #d5f5e2; }
.stage .status.warn { border-color: var(--moderate); color: #ffe1c2; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4;
  font-family: var(--font-cond); font-weight: 700; font-size: 120px; color: var(--amber);
  text-shadow: 0 4px 30px rgba(0,0,0,.7); pointer-events: none; }
.cam-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---- Results: score dial (signature element) ---- */
.result-head { text-align: center; padding: 8px 0 4px; }
.dial-wrap { display: grid; place-items: center; margin: 6px 0 10px; }
.dial { position: relative; width: 220px; height: 220px; }
.dial svg { transform: rotate(-90deg); }
.dial .track { fill: none; stroke: var(--surface-2); stroke-width: 16; }
.dial .fill { fill: none; stroke: var(--amber); stroke-width: 16; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.dial .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.dial .num { font-family: var(--font-cond); font-weight: 700; font-size: 62px; line-height: 1; }
.dial .out { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.band-tag { display: inline-block; font-family: var(--font-cond); text-transform: uppercase;
  letter-spacing: 1px; font-size: 15px; font-weight: 600; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); margin-top: 4px; }

/* metric bars */
.metric { padding: 14px 0; border-top: 1px solid var(--line); }
.metric:first-child { border-top: none; }
.metric .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.metric .name { font-weight: 600; font-size: 15.5px; }
.metric .val { font-size: 13px; color: var(--muted); }
.metric .sev { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin-left: 8px; }
.sev.ok { color: var(--ok); border: 1px solid var(--ok); }
.sev.mild { color: var(--mild); border: 1px solid var(--mild); }
.sev.moderate { color: var(--moderate); border: 1px solid var(--moderate); }
.sev.significant { color: var(--significant); border: 1px solid var(--significant); }
.bar { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; transition: width 1s ease; }

/* locked / paywall */
.locked { position: relative; }
.locked .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,20,20,.2), rgba(10,10,10,.96));
  display: grid; place-items: end center; padding-bottom: 24px; text-align: center; border-radius: var(--radius); }
.locked .veil .inner { max-width: 320px; }
.lock-ico { font-size: 26px; }

/* plan blocks */
.plan-block { border-top: 1px solid var(--line); padding: 16px 0; }
.plan-block:first-child { border-top: none; }
.plan-block .bhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-block h4 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px; font-size: 17px; }
.drill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 10px; }
.drill .dname { font-weight: 600; margin-bottom: 6px; }
.drill dl { display: grid; grid-template-columns: 84px 1fr; gap: 4px 12px; font-size: 14px; }
.drill dt { color: var(--amber); font-weight: 600; }
.drill dd { color: var(--text); }

/* session exercise rows */
.ex-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ex-row:first-of-type { border-top: none; }
.ex-thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; }
.ex-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 5px; color: var(--muted); font-size: 8.5px; text-transform: uppercase; letter-spacing: .3px; line-height: 1.15; }
.ex-name { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.ex-name .flag { font-size: 9px; color: #1a1300; background: var(--amber); border-radius: 5px; padding: 1px 6px; margin-left: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.ex-dose { color: var(--amber); font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.ex-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ex-tags span { font-size: 10px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; text-transform: capitalize; }
.chip { font-size: 11px; font-weight: 600; color: var(--amber); border: 1px solid var(--amber-dim); border-radius: 999px; padding: 3px 11px; text-transform: capitalize; }
/* history */
.hist-item { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--line); }
.hist-item:first-child { border-top: none; }
.hist-item .meta small { color: var(--muted); font-size: 13px; }
.hist-score { font-family: var(--font-cond); font-weight: 700; font-size: 26px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none;
  place-items: center; z-index: 50; padding: 20px; }
.modal-back.show { display: grid; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  width: 100%; max-width: 420px; padding: 24px; }
.modal h3 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .5px; font-size: 22px; margin-bottom: 4px; }
.modal .sub { margin-bottom: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; color: var(--text); font-family: var(--font); font-size: 16px; }
.field input:focus { outline: none; border-color: var(--amber); }
.modal .err { color: var(--significant); font-size: 13.5px; min-height: 18px; margin: 4px 0 10px; }
.modal .switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.modal .switch a { cursor: pointer; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--amber); color: #1a1300; font-weight: 600; padding: 12px 20px; border-radius: 10px;
  opacity: 0; transition: all .3s ease; z-index: 60; font-size: 14.5px; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,193,7,.25); border-top-color: var(--amber);
  border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.center-load { text-align: center; padding: 50px 0; color: var(--muted); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
