:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --text: #101418;
  --muted: #6b7280;
  --accent: #101418;
  --outline: #e5e7eb;
  --focus: rgba(16,20,24,0.15);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "SF Pro Display", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }

.kiosk-body { min-height: 100vh; }
.kiosk-shell { min-height: 100vh; display: flex; flex-direction: column; }

.kiosk-header { display: flex; flex-direction: column; gap: 12px; padding: 28px 32px 16px; background: var(--surface); border-bottom: 1px solid var(--outline); }
@media (min-width: 720px) {
  .kiosk-header { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (max-width: 719px) {
  .status-stack { align-items: flex-start; min-width: auto; }
  .status-rotator { text-align: left; }
}
.brand-block h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: 0.4px; }
.brand-block p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.status-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 180px; flex-shrink: 0; }
.status-rotator { display: flex; flex-direction: column; gap: 2px; text-align: right; min-height: 32px; opacity: 0.9; }
.status-label { font-size: 14px; font-weight: 600; color: var(--text); }
.status-sub { font-size: 13px; color: var(--muted); }
.status-rotator[data-level="peak"] .status-label { color: #b91c1c; }
.status-rotator[data-level="steady"] .status-label { color: #d97706; }
.status-rotator[data-level="calm"] .status-label { color: #16a34a; }

.kiosk-main { flex: 1; display: flex; flex-direction: column; gap: 28px; padding: 32px 24px 48px; max-width: 960px; width: 100%; margin: 0 auto; }

.card { background: var(--surface); border: 1px solid var(--outline); border-radius: 24px; padding: 28px; box-shadow: 0 18px 36px rgba(16,20,24,0.10); display: flex; flex-direction: column; gap: 24px; }
.card-head { display: flex; flex-direction: column; gap: 8px; }
.card-head h2 { margin: 0; font-size: 24px; font-weight: 700; }
.scan-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.scan-head h2 { font-size: 30px; margin: 0; }
.subhead { margin: 0; color: var(--muted); font-size: 15px; }

.scan-button { appearance: none; border: none; background: var(--accent); color: #ffffff; border-radius: 16px; padding: 20px; font-size: 20px; font-weight: 700; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; text-transform: uppercase; letter-spacing: 1px; }
.scan-button:hover { transform: translateY(-2px); box-shadow: 0 18px 28px rgba(16,20,24,0.18); }
.scan-button:active { transform: translateY(0); box-shadow: none; }
.scan-card { min-height: 60vh; align-items: center; justify-content: center; text-align: center; gap: 36px; align-self: stretch; padding: 48px 28px; }
.email-card { width: 100%; max-width: 520px; align-self: center; }
.scan-button-circle { width: 360px; height: 360px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; position: relative; }
.scan-button-circle::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(16,20,24,0.12); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,20,24,0.12); } 70% { box-shadow: 0 0 0 42px rgba(16,20,24,0); } 100% { box-shadow: 0 0 0 0 rgba(16,20,24,0); } }


.scan-preview { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 560px; margin: 0 auto; }
.preview-frame { position: relative; border-radius: 22px; overflow: hidden; background: var(--surface-alt); border: 1px solid var(--outline); }
#preview { width: 100%; display: block; background: #000; }
#frame { display: none; }
.aim-ring { position: absolute; inset: 12%; border: 2px solid rgba(255,255,255,0.8); border-radius: 24px; pointer-events: none; box-shadow: 0 0 0 2px rgba(0,0,0,0.1); animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%,100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.97); opacity: 1; }
}
.scan-status { font-size: 14px; color: var(--muted); }

.email-form { display: flex; flex-direction: column; gap: 14px; }
.email-form label { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.email-form input { padding: 14px 16px; font-size: 16px; border-radius: 14px; border: 1px solid var(--outline); background: var(--surface); color: var(--text); }
.email-form input:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.form-actions { display: flex; gap: 12px; justify-content: flex-start; }
.primary-btn { background: var(--accent); color: #ffffff; border: none; padding: 14px 28px; font-size: 16px; font-weight: 700; border-radius: 14px; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease; }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 20px rgba(16,20,24,0.15); }
.primary-btn:active { transform: translateY(0); box-shadow: none; }

.form-status { min-height: 18px; font-size: 14px; color: var(--muted); }

.kiosk-footer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 32px 32px; font-size: 14px; color: var(--muted); text-align: center; border-top: 1px solid var(--outline); background: var(--surface); }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(16,20,24,0.55); z-index: 999; }
.overlay.hidden { display: none !important; }
.overlay-card { background: var(--surface); border-radius: 24px; padding: 32px 40px; border: 1px solid var(--outline); box-shadow: 0 24px 48px rgba(16,20,24,0.25); text-align: center; }
.overlay-check { font-size: 48px; font-weight: 700; margin-bottom: 12px; color: var(--accent); }
.overlay-text { font-size: 22px; font-weight: 700; }

.hidden { display: none !important; }
.scan-debug { position: absolute; bottom: 12px; left: 12px; padding: 6px 10px; background: rgba(16,20,24,0.75); color: #fff; font-size: 12px; border-radius: 10px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #141820;
    --surface-alt: #1b1f29;
    --text: #f5f6f9;
    --muted: #9aa4b2;
    --outline: #222836;
    --accent: #f5f6f9;
    --focus: rgba(245,246,249,0.18);
  }
  .preview-frame { background: #0f1115; border-color: #2d3344; }
}

.footer-brand { font-family: "Oleo Script", "cursive"; font-weight: 700; color: var(--text); }

@media (max-width: 540px) {
  .scan-button-circle { width: 260px; height: 260px; font-size: 20px; }
}
@media (max-width: 360px) {
  .scan-button-circle { width: 220px; height: 220px; font-size: 18px; }
}
