/* ══════════════════════════════════════════════════════════════════════
   LiteSpec demo engine — shared styles
   Fixed 1280x720 stage designed for clean screen recording.
   ══════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #0F2744;
  --navy2:  #16233A;
  --panel:  #0D1F35;
  --blue:   #38BDF8;
  --blue2:  #0EA5E9;
  --slate:  #64748B;
  --slate-l:#94A3B8;
  --green:  #22C55E;
  --red:    #EF4444;
  --amber:  #F59E0B;
  --line:   rgba(255,255,255,0.08);
  --navy-gradient: linear-gradient(150deg, #1B3A5C 0%, #0F2744 45%, #081523 100%);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #081523;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #fff;
}
/* The 1280x720 stage auto-centers and scales to fit any window,
   so recordings letterbox on navy instead of clipping. */
#stage {
  position: absolute; top: 50%; left: 50%;
  width: 1280px; height: 720px;
  transform: translate(-50%, -50%);
  transform-origin: center;
  background: var(--navy-gradient);
  overflow: hidden;
  box-shadow: 0 0 120px rgba(0,0,0,0.5);
}
.serif { font-family: 'DM Serif Display', Georgia, serif; }
.mono  { font-family: 'SF Mono', 'Fira Code', Menlo, monospace; }

/* faint dot grid over the stage */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(56,189,248,0.06) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ── Scene system ── */
.scene {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.55s ease;
  display: flex; align-items: center; justify-content: center;
}
.scene.active { opacity: 1; pointer-events: auto; }

/* step chip pinned top-center */
.step-chip {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(56,189,248,0.10); border: 1px solid rgba(56,189,248,0.22);
  border-radius: 6px; padding: 5px 16px;
  font-size: 11px; font-weight: 700; color: var(--blue); letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap;
}

/* ── Progress + replay (positioned within the stage) ── */
#progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.08); z-index: 999; }
#progress-fill { height: 100%; background: var(--blue); width: 0; }
#replay {
  position: absolute; bottom: 18px; right: 22px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 12px; font-family: inherit; letter-spacing: 0.05em;
  padding: 6px 14px; border-radius: 20px; cursor: pointer;
  z-index: 999; opacity: 0; transition: opacity 0.4s;
}
#replay.show { opacity: 1; }
#brand-corner {
  position: absolute; bottom: 16px; left: 22px; z-index: 999;
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
}
#brand-corner svg { opacity: 0.75; }

/* ── Animation helpers ── */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2,0.8,0.4,1); }
.fade-up.in { opacity: 1; transform: translateY(0); }
.fade-in { opacity: 0; transition: opacity 0.5s ease; }
.fade-in.in { opacity: 1; }
.pop { opacity: 0; transform: scale(0.92); transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2,0.9,0.35,1.2); }
.pop.in { opacity: 1; transform: scale(1); }

/* ── Title scene ── */
.t-tag {
  display: inline-block; background: rgba(56,189,248,0.14); color: var(--blue);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 4px; margin-bottom: 22px;
}
.t-title { font-size: 58px; line-height: 1.08; margin-bottom: 18px; }
.t-title em { font-style: normal; color: var(--blue); }
.t-sub { font-size: 19px; color: var(--slate-l); line-height: 1.6; max-width: 640px; margin: 0 auto; }
.t-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 34px; font-size: 21px; font-weight: 700; }
.t-logo span { color: var(--blue); }

/* ── Caption scene ── */
.cap-title { font-size: 36px; margin-bottom: 26px; text-align: center; }
.cap-lines { max-width: 660px; margin: 0 auto; }
.cap-line {
  display: flex; gap: 14px; align-items: flex-start;
  font-size: 16.5px; color: #CBD5E1; line-height: 1.55; margin-bottom: 16px; text-align: left;
}
.cap-line svg { flex-shrink: 0; margin-top: 3px; }

/* ── Mock app card ── */
.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  overflow: hidden;
}
.app-bar {
  background: #162032; height: 40px;
  display: flex; align-items: center; padding: 0 14px; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.app-dot { width: 10px; height: 10px; border-radius: 50%; }
.app-url {
  flex: 1; background: rgba(255,255,255,0.07); border-radius: 6px; height: 22px;
  display: flex; align-items: center; padding: 0 12px; margin: 0 10px;
  font-size: 11px; color: rgba(255,255,255,0.4); font-family: monospace;
}
.app-body { padding: 26px 30px; }
.app-h {
  font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 18px;
  display: flex; align-items: center; gap: 9px;
}
.app-h .dotlab {
  width: 22px; height: 22px; border-radius: 6px; background: var(--blue);
  color: var(--navy); font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Mock form fields ── */
.f-grid { display: grid; gap: 14px; }
.f-grid.c2 { grid-template-columns: 1fr 1fr; }
.f-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.f-field { }
.f-label { font-size: 11.5px; font-weight: 600; color: var(--slate-l); margin-bottom: 6px; letter-spacing: 0.02em; }
.f-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px; height: 44px;
  display: flex; align-items: center; padding: 0 14px;
  font-size: 15px; color: #fff;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.f-box .unit { margin-left: auto; font-size: 12px; color: var(--slate); }
.f-box.focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
  background: rgba(56,189,248,0.06);
}
.f-box.select::after {
  content: ''; margin-left: auto;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--slate);
}
.caret::after {
  content: ''; display: inline-block; width: 2px; height: 18px;
  background: var(--blue); margin-left: 2px;
  animation: blink 0.85s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Demo button ── */
.d-btn {
  background: linear-gradient(180deg, #4CC9FA 0%, #38BDF8 45%, #0EA5E9 100%);
  color: #06283D; font-size: 15px; font-weight: 800;
  padding: 14px 0; border-radius: 10px; text-align: center;
  box-shadow: 0 6px 26px rgba(56,189,248,0.30), inset 0 1px 0 rgba(255,255,255,0.45);
  transition: transform 0.15s;
}
.d-btn.navy { background: #1E3A5F; color: #fff; box-shadow: 0 6px 22px rgba(0,0,0,0.3); }
.d-btn.pressed { transform: scale(0.96); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
  border-radius: 6px; padding: 5px 13px;
}
.badge.pass { background: rgba(34,197,94,0.14); color: #4ADE80; border: 1px solid rgba(34,197,94,0.35); }
.badge.fail { background: rgba(239,68,68,0.14); color: #F87171; border: 1px solid rgba(239,68,68,0.35); }
.badge.cond { background: rgba(245,158,11,0.14); color: #FCD34D; border: 1px solid rgba(245,158,11,0.35); }
.badge.info { background: rgba(56,189,248,0.12); color: var(--blue); border: 1px solid rgba(56,189,248,0.3); }

/* ── Result bars ── */
.bar-row { margin-bottom: 12px; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--slate-l); margin-bottom: 5px; }
.bar-track { height: 10px; background: rgba(255,255,255,0.07); border-radius: 5px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; width: 0; border-radius: 5px; transition: width 0.9s cubic-bezier(0.2,0.8,0.3,1); }

/* ── Demo table ── */
.d-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.d-table th {
  padding: 9px 13px; text-align: left; color: var(--slate);
  font-weight: 600; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(255,255,255,0.03); white-space: nowrap;
}
.d-table td { padding: 10px 13px; color: #E2E8F0; border-top: 1px solid rgba(255,255,255,0.05); }
.d-table tr.rowin { animation: rowin 0.45s ease both; }
@keyframes rowin { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ── Stat cards ── */
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { border-radius: 10px; padding: 15px 17px; border: 1px solid; }
.stat-card .k { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 4px; text-transform: uppercase; }
.stat-card .v { font-size: 12px; color: var(--slate-l); line-height: 1.45; }
.stat-card.tone-pass { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); }
.stat-card.tone-pass .k { color: #4ADE80; }
.stat-card.tone-cond { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }
.stat-card.tone-cond .k { color: #FCD34D; }
.stat-card.tone-fail { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.stat-card.tone-fail .k { color: #F87171; }
.stat-card.tone-info { background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.2); }
.stat-card.tone-info .k { color: var(--blue); }

/* ── Big number ── */
.big-num { font-size: 46px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.big-num small { font-size: 18px; color: var(--slate-l); font-weight: 600; }

/* ── Report (B&W print mock) ── */
.print-sheet {
  background: #fff; color: #111; border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.55);
  padding: 26px 30px; font-size: 10.5px; line-height: 1.5;
}
.print-sheet .ph { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.print-sheet .ph .co { font-family: 'DM Serif Display', serif; font-size: 17px; color: #000; }
.print-sheet .ph .meta { text-align: right; font-size: 8.5px; color: #333; line-height: 1.5; }
.print-sheet .ptitle { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.print-sheet .psec { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: #eee; border-left: 3px solid #000; padding: 3px 6px; margin: 8px 0 5px; }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: 8.5px; }
.print-sheet td, .print-sheet th { border: 1px solid #000; padding: 3px 6px; text-align: left; }
.print-sheet th { background: #e6e6e6; }
.print-sheet .pfoot { margin-top: 10px; border-top: 1px solid #000; padding-top: 6px; font-size: 7.5px; color: #333; display: flex; align-items: center; gap: 5px; }

/* ── Outro ── */
.outro-check { width: 92px; height: 92px; margin: 0 auto 26px; }
.outro-check circle { stroke: rgba(56,189,248,0.3); stroke-width: 2.5; fill: rgba(56,189,248,0.06); }
.outro-check path {
  stroke: var(--blue); stroke-width: 5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
}
.outro-check path.draw { animation: drawcheck 0.55s ease forwards; }
@keyframes drawcheck { to { stroke-dashoffset: 0; } }
.outro-title { font-size: 42px; margin-bottom: 14px; }
.outro-sub { font-size: 17px; color: var(--slate-l); margin-bottom: 30px; max-width: 560px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.outro-url {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(56,189,248,0.10); border: 1px solid rgba(56,189,248,0.3);
  border-radius: 10px; padding: 13px 30px;
  font-size: 20px; font-weight: 700; color: var(--blue); letter-spacing: 0.01em;
}
