:root {
  color-scheme: dark;
  --bg: #07131f;
  --surface: #0d1f31;
  --surface-2: #102941;
  --card: rgba(255,255,255,.08);
  --card-strong: rgba(255,255,255,.13);
  --text: #f5fbff;
  --muted: #a7bed1;
  --line: rgba(255,255,255,.14);
  --brand: #35d5ff;
  --brand-2: #7cffc4;
  --danger: #ff6d7a;
  --ok: #70ffba;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
  --radius: 26px;
  --radius-sm: 16px;
  --max: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef8ff;
  --surface: #ffffff;
  --surface-2: #dff4ff;
  --card: rgba(4,40,62,.07);
  --card-strong: rgba(4,40,62,.12);
  --text: #061421;
  --muted: #4d687a;
  --line: rgba(4,40,62,.13);
  --shadow: 0 24px 80px rgba(9,46,69,.16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(53,213,255,.22), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(124,255,196,.15), transparent 28rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; padding: 18px 0 48px; }
.site-header { position: sticky; top: 12px; z-index: 10; display:flex; justify-content:space-between; align-items:center; gap:16px; padding: 12px; margin-bottom: 28px; border: 1px solid var(--line); background: rgba(7,19,31,.78); backdrop-filter: blur(18px); border-radius: 999px; box-shadow: var(--shadow); }
:root[data-theme="light"] .site-header { background: rgba(255,255,255,.78); }
.brand, .top-actions { display:flex; align-items:center; gap:10px; }
.brand-mark { width: 42px; height: 42px; display:grid; place-items:center; border-radius: 50%; color:#061421; font-weight:900; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.brand small { display:block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.icon-btn { min-height: 42px; padding: 0 14px; border-radius: 999px; border:1px solid var(--line); background: var(--card); color: var(--text); }
.hero-grid { display:grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.hero-copy, .alarm-card, .panel, .camera-card, .verify-card { border: 1px solid var(--line); background: linear-gradient(180deg, var(--card-strong), var(--card)); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-copy { padding: clamp(28px, 6vw, 64px); }
.eyebrow { margin:0 0 10px; color: var(--brand-2); text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2.2rem, 8vw, 5.4rem); line-height: .92; letter-spacing: -.07em; margin-bottom: 18px; }
h2 { font-size: clamp(1.45rem, 4vw, 2.35rem); line-height: 1; letter-spacing: -.04em; margin-bottom: 10px; }
.hero-text { color: var(--muted); max-width: 62ch; font-size: 1.05rem; line-height: 1.7; }
.hero-actions, .camera-actions, .dialog-actions { display:flex; flex-wrap:wrap; gap: 12px; }
.btn { min-height: 48px; display:inline-flex; align-items:center; justify-content:center; gap: 10px; border: 0; border-radius: 999px; padding: 0 20px; font-weight: 850; transition: transform .2s ease, opacity .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color:#061421; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-ghost { color: var(--text); background: var(--card); border: 1px solid var(--line); }
.btn-disabled { color: var(--muted); background: var(--card); border: 1px solid var(--line); cursor:not-allowed; opacity:.72; }
.full { width: 100%; }
.alarm-card { padding: 24px; display:flex; flex-direction:column; justify-content:space-between; gap: 14px; }
.status-pill { align-self:flex-start; padding: 8px 12px; border-radius: 999px; background: var(--card); border:1px solid var(--line); color: var(--muted); font-weight:800; }
.alarm-card h2 { font-size: clamp(3rem, 12vw, 6rem); margin: 0; letter-spacing: -.08em; }
.lock-display { display:flex; align-items:center; gap: 10px; padding: 18px; border-radius: var(--radius-sm); background: rgba(255,109,122,.12); border:1px solid rgba(255,109,122,.28); }
.lock-display.unlocked { background: rgba(112,255,186,.12); border-color: rgba(112,255,186,.34); }
.microcopy { color: var(--muted); font-size: .9rem; line-height: 1.5; margin-bottom: 0; }
.panel-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel { padding: 24px; }
.section-heading.center { text-align:center; max-width: 760px; margin-inline:auto; margin-bottom: 20px; }
label { display:grid; gap: 8px; color: var(--muted); font-weight: 750; margin: 0 0 14px; }
input, select { width:100%; min-height: 50px; color: var(--text); background: var(--surface); border:1px solid var(--line); border-radius: 16px; padding: 0 14px; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(53,213,255,.14); }
.stats-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0; }
.stats-grid div { padding: 18px; border-radius: var(--radius-sm); background: var(--card); border:1px solid var(--line); }
.stats-grid strong { display:block; font-size: 2rem; letter-spacing: -.05em; }
.stats-grid span { display:block; color: var(--muted); font-size:.85rem; }
.meter { height: 12px; overflow:hidden; border-radius: 999px; background: var(--card); border:1px solid var(--line); }
.meter span { display:block; width:0%; height:100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .25s ease; }
.challenge-section { margin: 38px 0 20px; }
.challenge-layout { display:grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 20px; align-items:start; }
.camera-card, .verify-card { padding: 18px; }
.video-wrap { position:relative; overflow:hidden; border-radius: 24px; background:#02070d; aspect-ratio: 3 / 4; display:grid; place-items:center; border:1px solid var(--line); }
video#cameraFeed { width:100%; height:100%; object-fit:cover; transform: scaleX(-1); }
.guide-frame { position:absolute; inset: 12% 13% 14%; border: 3px dashed rgba(124,255,196,.75); border-radius: 30px; display:flex; align-items:flex-end; justify-content:center; padding: 12px; color: #061421; font-weight:900; text-shadow: none; }
.guide-frame span { background: rgba(124,255,196,.85); padding: 8px 10px; border-radius: 999px; }
.recording-dot { position:absolute; top:14px; right:14px; padding: 8px 10px; border-radius: 999px; background: rgba(255,109,122,.14); color: var(--danger); border:1px solid rgba(255,109,122,.4); font-weight:900; opacity:0; }
.recording-dot.is-active { opacity:1; animation:pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.camera-actions { margin-top: 14px; }
.verify-card { position: sticky; top: 92px; }
.score-ring { width: 180px; height: 180px; margin: 0 auto 18px; border-radius:50%; display:grid; place-items:center; align-content:center; background: conic-gradient(var(--brand-2) var(--score, 0%), var(--card) 0); border:1px solid var(--line); }
.score-ring strong { font-size: 2.5rem; letter-spacing:-.06em; }
.score-ring span { color: var(--muted); font-weight: 800; }
.countdown { text-align:center; font-size: 2.5rem; font-weight: 900; margin-bottom: 12px; }
.check-list { list-style:none; padding:0; margin: 18px 0; display:grid; gap: 10px; }
.check-list li { padding: 13px 14px 13px 42px; position:relative; border-radius: 16px; background: var(--card); color: var(--muted); border:1px solid var(--line); }
.check-list li::before { content:""; position:absolute; left:14px; top:50%; translate:0 -50%; width:16px; height:16px; border-radius:50%; background: rgba(255,109,122,.75); }
.check-list li.is-ok { color: var(--text); }
.check-list li.is-ok::before { background: var(--ok); box-shadow: 0 0 18px rgba(112,255,186,.55); }
.history-panel { margin-top: 20px; }
.history-list { display:grid; gap: 10px; margin-bottom: 16px; }
.history-item { display:flex; justify-content:space-between; gap: 16px; padding: 14px; border-radius: 16px; background: rgba(112,255,186,.08); border:1px solid rgba(112,255,186,.22); }
.history-item.failed { background: rgba(255,109,122,.08); border-color: rgba(255,109,122,.22); }
dialog { border:0; padding:0; background:transparent; color:var(--text); }
dialog::backdrop { background: rgba(1,8,15,.76); backdrop-filter: blur(10px); }
.dialog-card { width:min(480px, calc(100vw - 28px)); padding: 26px; border-radius: 28px; border:1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.review-dialog video { width:100%; border-radius: 18px; background:#000; margin-bottom: 14px; }
@media (max-width: 860px) {
  .app-shell { width:min(100% - 22px, var(--max)); padding-top: 10px; }
  .site-header { top: 8px; }
  .hero-grid, .panel-grid, .challenge-layout { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px; }
  .verify-card { position: static; }
  .camera-actions .btn { flex: 1 1 100%; }
  .stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand small { display:none; }
  .hero-actions .btn { width:100%; }
  .alarm-card h2 { font-size: 4rem; }
}
