/* =====================================================================
   AR Anatomi Pencernaan Sapi — Stylesheet
   Tema: sci-tech navy + teal + amber, glass blur, soft glow.
   Mobile-first, responsif, prefers-reduced-motion-aware.
   ===================================================================== */

:root {
  --bg-1: #050a18;
  --bg-2: #0a1628;
  --bg-3: #112340;
  --teal: #4cd6c4;
  --teal-soft: #4cd6c455;
  --teal-glow: #4cd6c4aa;
  --amber: #ffc56b;
  --amber-soft: #ffc56b55;
  --rose: #ff7aa2;
  --text: #eaf2ff;
  --text-dim: #b6c4d8;
  --text-mute: #7d8aa3;
  --danger: #ff6b6b;
  --glass: rgba(14, 25, 46, 0.6);
  --glass-strong: rgba(14, 25, 46, 0.85);
  --border: rgba(125, 200, 220, 0.18);
  --border-strong: rgba(125, 200, 220, 0.35);
  --shadow-glow: 0 8px 32px rgba(76, 214, 196, 0.15), 0 2px 12px rgba(0, 0, 0, 0.5);
  --radius: 18px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--bg-1);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ============== AMBIENT BACKGROUND ============== */
#ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#ambient .gradient {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(76, 214, 196, 0.18), transparent 60%),
    radial-gradient(40% 40% at 90% 100%, rgba(255, 197, 107, 0.12), transparent 60%),
    radial-gradient(50% 60% at 50% 50%, rgba(126, 86, 224, 0.18), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 60%, var(--bg-3));
  animation: gradientShift 18s ease-in-out infinite alternate;
}
@keyframes gradientShift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -3%) scale(1.05); }
}
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============== SCREENS ============== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 380ms ease, transform 380ms ease, visibility 380ms;
  pointer-events: none;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.ar-stage { padding: 0; align-items: stretch; justify-content: stretch; }

/* ============== CARDS (Onboarding / Permission / Loading / Unsupported) ============== */
.onboarding-card,
.permission-card,
.loading-card,
.unsupported-card {
  width: min(440px, 100%);
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-glow);
  text-align: center;
  animation: cardIn 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.onboarding-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px var(--teal-glow));
  margin-bottom: 8px;
}
.onboarding-card h1,
.permission-card h2,
.loading-card h2,
.unsupported-card h2 {
  margin: 8px 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  color: var(--text-dim);
  line-height: 1.55;
  margin: 6px 0 18px;
  font-size: 0.97rem;
}

.onboarding-steps {
  display: grid;
  gap: 10px;
  margin: 10px 0 22px;
  text-align: left;
}
.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(76, 214, 196, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #2da090);
  color: var(--bg-1);
  font-weight: 700;
  font-size: 0.9rem;
}
.step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.tiny-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.4;
}

/* ============== BUTTONS ============== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  user-select: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), #2da090);
  color: #04111a;
  box-shadow: 0 8px 24px rgba(76, 214, 196, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px) scale(0.99); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border-strong);
  margin-top: 10px;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* ============== PERMISSION ============== */
.permission-icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px var(--teal-glow));
}
.permission-card p {
  color: var(--text-dim);
  line-height: 1.55;
  margin: 8px 0;
  font-size: 0.94rem;
}
.permission-error {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: var(--radius-sm);
  color: #ffd0d0;
  font-size: 0.88rem;
  text-align: left;
  line-height: 1.5;
}
.permission-error strong { color: #ff9a9a; display: block; margin-bottom: 4px; }
.help-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--teal);
  font-size: 0.88rem;
  text-decoration: none;
  border-bottom: 1px dashed var(--teal-soft);
}
.ios-note {
  font-size: 0.85rem !important;
  color: var(--amber) !important;
  background: rgba(255, 197, 107, 0.08);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber);
}

/* ============== LOADING ============== */
.spinner {
  width: 56px;
  height: 56px;
  margin: 4px auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(76, 214, 196, 0.18);
  border-top-color: var(--teal);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { color: var(--text-dim); margin: 4px 0 14px; font-size: 0.92rem; }
.progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  border-radius: 999px;
  transition: width 350ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 12px var(--teal-glow);
}
.loading-percent { font-size: 0.8rem; color: var(--text-mute); margin: 0; }

/* ============== AR STAGE ============== */
/* Latar hitam di belakang feed kamera: mencegah warna navy muncul di celah/letterbox. */
#ar-stage {
  background: #000;
}
.ar-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #000;
  overflow: hidden;
}
/* Override inline styles yang diset MindAR pada elemen video & canvas-nya.
   object-fit: cover → feed kamera selalu memenuhi layar (tidak ada bar hitam/biru). */
.ar-container video,
.ar-container canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  min-width: 100%;
  min-height: 100%;
}

/* ============== BRANDING ============== */
.branding {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: #fff;
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  max-width: calc(100% - 24px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.branding.hidden-during-onboarding { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.branding.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.branding img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}
.branding-text { line-height: 1.1; }
.branding .title {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000;
}
.branding .subtitle {
  font-size: 0.66rem;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ============== TRACKING STATUS ============== */
.tracking-status {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.tracking-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: pulseDot 1.4s ease-in-out infinite;
}
.tracking-status.active .dot {
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal-glow);
  animation: none;
}
.tracking-status.active .label::before { content: ''; }
@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}

/* ============== MODE SWITCHER ============== */
.mode-switcher {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 12px;
  z-index: 50;
  display: inline-flex;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
}
.mode-btn {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color 200ms ease, background 200ms ease, transform 200ms ease;
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--teal), #2da090);
  color: #04111a;
  box-shadow: 0 2px 10px var(--teal-soft);
}

/* On very narrow screens stack mode below status to avoid overlap */
@media (max-width: 480px) {
  .mode-switcher {
    top: auto;
    bottom: calc(16px + var(--safe-bottom));
    right: 50%;
    transform: translateX(50%);
  }
  .mode-btn { font-size: 0.72rem; padding: 7px 12px; }
}

/* ============== SOUND TOGGLE ============== */
.sound-toggle {
  position: fixed;
  right: 14px;
  bottom: calc(72px + var(--safe-bottom));
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}
.sound-toggle .icon-off { display: none; }
.sound-toggle.muted .icon-on { display: none; }
.sound-toggle.muted .icon-off { display: block; }

/* ============== INSTALL PROMPT ============== */
.install-btn {
  position: fixed;
  left: 14px;
  bottom: calc(14px + var(--safe-bottom));
  z-index: 50;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.8rem;
  color: var(--text);
}
.install-btn:hover { background: rgba(76, 214, 196, 0.12); }

/* ============== MARKER FLASH (saat marker ditemukan) ============== */
.marker-flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, rgba(76, 214, 196, 0.55), transparent 60%);
}
.marker-flash.flash {
  animation: flashPulse 700ms ease-out;
}
@keyframes flashPulse {
  0%   { opacity: 0; }
  20%  { opacity: 0.95; }
  100% { opacity: 0; }
}

/* ============== MARKER TOAST ============== */
.marker-toast {
  position: fixed;
  top: calc(54px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 60;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--teal), #2da090);
  color: #04111a;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 24px var(--teal-glow);
  opacity: 0;
  transition: opacity 260ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.marker-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.marker-toast .check {
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  font-size: 0.78rem;
}

/* ============== SCAN INSTRUCTION ============== */
.scan-instruction {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 400ms ease;
}
.scan-instruction.hidden { opacity: 0; }

.scan-frame {
  position: relative;
  width: min(72vw, 320px);
  aspect-ratio: 1 / 1;
  margin-bottom: 24px;
}
.scan-frame .corner {
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: var(--teal);
  border-style: solid;
  border-width: 0;
  filter: drop-shadow(0 0 6px var(--teal-glow));
}
.scan-frame .corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 12px; }
.scan-frame .corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 12px; }
.scan-frame .corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 12px; }
.scan-frame .corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 12px; }
.scan-frame .scan-line {
  position: absolute;
  left: 6%; right: 6%; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 12px var(--teal-glow);
  animation: scanLine 2.4s ease-in-out infinite;
}
@keyframes scanLine {
  0%, 100% { top: 6%; opacity: 0.6; }
  50%      { top: 92%; opacity: 1; }
}

.scan-text {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  text-align: center;
}
.scan-text strong { color: var(--teal); }
.scan-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  text-align: center;
}

/* ============== HOTSPOTS ============== */
.hotspots-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
.hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  background: transparent;
  pointer-events: auto;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 240ms ease, transform 240ms ease;
}
.hotspot::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--teal) 60%, #1f7e6e);
  box-shadow:
    0 0 0 4px rgba(76, 214, 196, 0.18),
    0 0 14px 4px var(--teal-glow);
  animation: hotspotPulse 2.2s ease-in-out infinite, hotspotFloat 4s ease-in-out infinite;
}
.hotspot::after {
  content: attr(data-label);
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  transform: translate(-50%, 0);
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.hotspot:hover::after,
.hotspot.show-label::after { opacity: 1; }
.hotspot.active::before {
  background: radial-gradient(circle at 30% 30%, #fff, var(--amber) 60%, #b07530);
  box-shadow:
    0 0 0 5px rgba(255, 197, 107, 0.25),
    0 0 22px 6px var(--amber-soft);
  animation-duration: 1.2s, 4s;
}
.hotspot.dim { opacity: 0.35; }
.hotspot.hidden { opacity: 0; pointer-events: none; }

@keyframes hotspotPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}
@keyframes hotspotFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -3px; }
}

/* ============== GUIDED SHEET ============== */
.guided-sheet {
  position: fixed;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: min(560px, calc(100% - 24px));
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 14px 18px 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  animation: sheetIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.guided-sheet[hidden] { display: none; }
@keyframes sheetIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.guided-step-indicator {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  font-weight: 700;
}
.guided-sheet h3 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.guided-sheet p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
}
.guided-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.guided-actions .btn-primary,
.guided-actions .btn-secondary {
  min-height: 44px;
  font-size: 0.9rem;
  margin-top: 0;
}

@media (max-width: 480px) {
  .guided-sheet { bottom: calc(64px + var(--safe-bottom)); }
}

/* ============== MODAL ============== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 260ms ease;
}
.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(20, 35, 60, 0.96), rgba(10, 22, 40, 0.96));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(76, 214, 196, 0.1);
  animation: modalIn 360ms cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal.closing .modal-backdrop { animation: fadeOut 200ms ease forwards; }
.modal.closing .modal-card { animation: modalOut 240ms ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}
.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  transition: background 200ms ease, color 200ms ease;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.modal-header { margin-bottom: 14px; padding-right: 36px; }
.modal-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  background: rgba(76, 214, 196, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.modal-card h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-section { margin: 14px 0; }
.modal-section h4 {
  margin: 0 0 4px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-weight: 700;
}
.modal-section p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
}
.modal-section.fact {
  background: rgba(255, 197, 107, 0.08);
  border: 1px solid rgba(255, 197, 107, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 18px;
}
.modal-section.fact h4 { color: var(--amber); }

/* ============== UNSUPPORTED PREVIEW ============== */
.unsupported-card { color: var(--text-dim); }
.unsupported-card p { line-height: 1.55; }

/* ============== UTILITIES ============== */
[hidden] { display: none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  #ambient .gradient { animation: none; }
  .scan-frame .scan-line { animation: none; opacity: 0; }
  .hotspot::before { animation: none; }
}

/* Tablet+ */
@media (min-width: 768px) {
  .onboarding-card,
  .permission-card,
  .loading-card,
  .unsupported-card {
    padding: 36px 32px;
  }
  .onboarding-card h1 { font-size: 1.85rem; }
  .modal-card { padding: 32px 28px 28px; }
}
