:root {
  color-scheme: dark;
  --ink: #f4f5f8;
  --muted: #9ba6ba;
  --navy: #101c33;
  --panel: rgba(19, 32, 55, .82);
  --line: rgba(195, 211, 238, .15);
  --gold: #e9c987;
  --gold-light: #f5dfaf;
  --blue: #84a9f4;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -10%, #26395a 0%, #172744 37%, #101c33 78%);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(70px); opacity: .15; }
.ambient-one { width: 220px; height: 220px; top: 210px; right: -140px; background: #7899dc; }
.ambient-two { width: 180px; height: 180px; top: 700px; left: -125px; background: #c49c61; opacity: .12; }
.page-shell { position: relative; z-index: 1; width: calc(100% - 36px); max-width: 500px; margin: 0 auto; padding: 22px 0 26px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-family: Manrope, sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-decoration: none; }
.brand-light { color: var(--gold); }
.brand-mark { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(233,201,135,.75); border-radius: 7px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 2px; border-radius: 4px; background: var(--gold); }
.brand-mark span:nth-child(1) { height: 6px; }.brand-mark span:nth-child(2) { height: 12px; }.brand-mark span:nth-child(3) { height: 8px; }
.top-pill { border: 1px solid var(--line); border-radius: 30px; padding: 7px 10px; color: #bac5d8; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.status-dot { display: inline-block; width: 5px; height: 5px; margin: 0 5px 1px 0; border-radius: 50%; background: #9dd8ba; box-shadow: 0 0 8px #9dd8ba; }
.hero { position: relative; min-height: 270px; padding: 54px 0 18px; }
.eyebrow, .step-label { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .19em; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow-line { width: 23px; height: 1px; background: var(--gold); }
h1, h2, p { margin-top: 0; }
h1 { position: relative; z-index: 1; margin: 18px 0 12px; font-family: Manrope, sans-serif; font-size: clamp(37px, 10vw, 48px); line-height: 1.08; letter-spacing: -.055em; font-weight: 700; }
h1 span { color: var(--gold-light); }
.hero-copy { position: relative; z-index: 1; max-width: 315px; margin: 0; color: #b6c0d1; font-size: 13px; line-height: 1.75; }
.hero-orbit { position: absolute; width: 132px; height: 132px; top: 55px; right: -1px; opacity: .78; }
.orbit { position: absolute; inset: 5px; border: 1px solid rgba(233,201,135,.2); border-radius: 50%; }
.orbit-a { transform: scaleY(.55) rotate(-35deg); }.orbit-b { transform: scaleY(.55) rotate(35deg); }
.orbit-core { position: absolute; inset: 42px; display: grid; place-items: center; border: 1px solid rgba(233,201,135,.5); border-radius: 50%; background: radial-gradient(circle, rgba(233,201,135,.2), rgba(233,201,135,.02)); box-shadow: 0 0 32px rgba(233,201,135,.11); }
.orbit-core span { color: var(--gold-light); font-size: 27px; }
.orbit-spark { position: absolute; color: var(--gold-light); }.spark-a { top: 8px; right: 29px; font-size: 15px; }.spark-b { bottom: 15px; left: 13px; font-size: 20px; }
.form-card, .result-card { border: 1px solid rgba(204,218,243,.18); border-radius: 23px; background: linear-gradient(145deg, rgba(26,43,71,.94), rgba(17,30,51,.95)); box-shadow: 0 22px 55px rgba(2,8,20,.22), inset 0 1px rgba(255,255,255,.04); }
.form-card { padding: 23px 20px 20px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.card-heading h2, .result-card h2 { margin: 8px 0 0; font-family: Manrope, sans-serif; font-size: 20px; letter-spacing: -.04em; }
.number-mark { color: var(--gold-light); font-family: Manrope, sans-serif; font-size: 22px; font-weight: 700; }
.number-mark span { color: #8090aa; font-size: 12px; font-weight: 500; }
.field-label { display: block; margin-bottom: 9px; color: #e4e9f2; font-size: 12px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: #97a9c6; stroke-width: 1.5; stroke-linecap: round; }
.input-wrap input { width: 100%; height: 49px; padding: 0 14px 0 43px; border: 1px solid rgba(191,208,237,.17); border-radius: 12px; outline: none; background: rgba(7,16,31,.35); color: #fff; font-size: 16px; transition: border .2s, box-shadow .2s; }
.input-wrap input::placeholder { color: #73829a; }.input-wrap input:focus { border-color: rgba(233,201,135,.8); box-shadow: 0 0 0 3px rgba(233,201,135,.08); }
.camera-heading { display: flex; flex-wrap: wrap; gap: 0 10px; justify-content: space-between; align-items: baseline; margin-top: 22px; }
.field-hint { color: #7f8da4; font-size: 9px; }
.camera-view { position: relative; width: 100%; height: 0; padding-bottom: 75%; overflow: hidden; border: 1px solid rgba(183,202,234,.25); border-radius: 13px; background: #070f1e; -webkit-clip-path: inset(0 round 13px); clip-path: inset(0 round 13px); }
.camera-view video, .camera-view img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.camera-view p { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; color: #8392aa; text-align: center; font-size: 12px; }
.camera-message { min-height: 1.5em; margin: 8px 0 0; color: #b6c0d1; font-size: 11px; line-height: 1.5; }
.camera-controls { display: flex; gap: 10px; margin: 10px 0 20px; }
.camera-button { flex: 1; min-width: 0; min-height: 48px; padding: 10px; border: 1px solid rgba(191,208,237,.25); border-radius: 10px; background: rgba(7,16,31,.35); color: #e4e9f2; font-size: 14px; font-weight: 600; cursor: pointer; }
.camera-button-primary { border-color: rgba(233,201,135,.6); color: var(--gold-light); }
.camera-button:disabled { opacity: .55; cursor: wait; }
.camera-button:focus-visible, .submit-button:focus-visible, .download-button:focus-visible, .text-button:focus-visible, .retry-button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.submit-button, .download-button, .retry-button { display: flex; width: 100%; min-height: 51px; align-items: center; justify-content: space-between; padding: 0 16px 0 19px; border: 0; border-radius: 12px; background: linear-gradient(100deg, #f0d9a6, #d8b773); color: #172239; font-family: Manrope, sans-serif; font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 8px 25px rgba(213,180,116,.16); transition: transform .2s, filter .2s; }
.submit-button:active, .download-button:active, .retry-button:active { transform: scale(.99); }.submit-button:disabled { opacity: .55; cursor: wait; }.button-arrow { font-size: 21px; font-weight: 500; }
.result-card { margin-top: 17px; padding: 21px 20px 20px; }.result-topline { display: flex; align-items: center; justify-content: space-between; }.result-badge { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.progress-area, .result-area, .error-area { padding: 27px 0 4px; text-align: center; }.loader-art { position: relative; display: grid; width: 78px; height: 78px; margin: 0 auto 18px; place-items: center; color: var(--gold-light); font-size: 30px; }.loader-ring { position: absolute; inset: 3px; border: 1px solid rgba(233,201,135,.23); border-top-color: var(--gold-light); border-radius: 50%; animation: spin 1.6s linear infinite; }.progress-area h2, .result-area h2, .error-area h2 { margin: 0 0 7px; font-size: 18px; }.progress-area p, .result-area p, .error-area p { margin: 0 auto; max-width: 290px; color: #9eacc1; font-size: 11px; line-height: 1.6; }
.progress-track { height: 5px; margin-top: 23px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.09); }.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #cba96c, #f0d9a6); transition: width .35s; }.progress-meta { display: flex; justify-content: space-between; margin-top: 9px; color: #8392aa; font-size: 9px; }
.result-image-wrap { overflow: hidden; margin-bottom: 20px; border: 1px solid rgba(233,201,135,.3); border-radius: 14px; background: rgba(0,0,0,.2); }.result-image-wrap img { display: block; width: 100%; max-height: 620px; object-fit: contain; }.result-area h2 { margin-top: 2px; }.download-button { margin-top: 19px; }.download-button span:last-child { font-size: 20px; }.text-button { margin-top: 15px; padding: 9px 15px; border: 0; background: transparent; color: #c3ccda; font-size: 11px; cursor: pointer; }
.error-icon { display: grid; width: 38px; height: 38px; margin: 0 auto 13px; place-items: center; border: 1px solid rgba(242,135,135,.3); border-radius: 50%; color: #f2a0a0; font-size: 20px; }.retry-button { justify-content: center; margin-top: 18px; }.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 520px) { .page-shell { padding-top: 30px; }.hero { min-height: 300px; padding-top: 65px; }.hero-orbit { right: 7px; top: 66px; transform: scale(1.12); }.form-card { padding: 27px 25px 23px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Admin QR page */
.admin-card { margin-top: 46px; padding: 26px; border: 1px solid rgba(204,218,243,.18); border-radius: 22px; background: rgba(19,32,55,.9); text-align: center; }
.admin-card h1 { margin: 12px 0; font-size: 27px; }
.admin-card p { color: #aab6c9; font-size: 12px; line-height: 1.65; }
.qr-image { display: block; width: min(100%, 320px); margin: 22px auto; padding: 12px; border-radius: 15px; background: #fff; }
.url-box { padding: 12px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; color: var(--gold-light); font-size: 11px; }
.admin-note { margin-top: 18px; color: #8492a8 !important; font-size: 10px !important; }
