@font-face {
  font-family: Inter;
  src: url("fonts/e4af272ccee01ff0-s.p.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #f8fafc;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warn-bg: #eff6ff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Header ------------------------------------------------------------------ */

.quiz-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}

.logo-wrap { text-align: center; margin-bottom: 12px; }
.logo { max-height: 68px; width: auto; }

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .35s ease;
}

.back-button {
  position: absolute;
  top: 16px;
  left: 12px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.back-button:hover { background: var(--surface); }

/* Content ----------------------------------------------------------------- */

.quiz-main { flex: 1; }

.quiz-content {
  padding: 24px 20px 40px;
}

.fade-in { animation: fadeIn .3s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.layer { margin-bottom: 18px; }
.layer:last-child { margin-bottom: 0; }

.content h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}

.content h2 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
.content h3 { font-size: 17px; line-height: 1.35; margin: 0 0 6px; }
.content p  { margin: 0 0 10px; }
.content p:last-child { margin-bottom: 0; }

.ql-align-center { text-align: center; }

/* Options ----------------------------------------------------------------- */

.options { display: grid; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.option:hover { border-color: #cbd5e1; background: var(--surface); }

.option.active {
  border-color: var(--accent);
  background: var(--warn-bg);
}

.option-emoji { font-size: 20px; flex-shrink: 0; }

.radio {
  width: 19px;
  height: 19px;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.option.active .radio,
.image-option.active .radio {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3.5px #fff;
}

.option-label { flex: 1; }
.option-label strong { display: block; margin-bottom: 2px; }

.image-options {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-option {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.image-option img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.image-option-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 500;
}

.image-option.active { border-color: var(--accent); }

/* Buttons ----------------------------------------------------------------- */

.layer-button { margin: 20px 0; }

.action-button {
  display: block;
  width: 100%;
  padding: 17px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.action-button:hover { background: var(--accent-dark); }
.action-button:active { transform: scale(.99); }

.action-button[aria-disabled="true"] {
  background: #cbd5e1;
  cursor: not-allowed;
}

.action-button.pulse { animation: pulse 1.9s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.45); }
  60%      { box-shadow: 0 0 0 13px rgba(37,99,235,0); }
}

/* Media ------------------------------------------------------------------- */

.layer-image { text-align: center; }

.media {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}

.media.contain { object-fit: contain; max-height: 280px; }

/* Alerts ------------------------------------------------------------------ */

.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  border-left: 4px solid var(--accent);
  font-size: 15px;
}

.alert-box.danger {
  background: var(--danger-bg);
  border-left-color: var(--danger);
}

.alert-box p { margin: 0 0 6px; }
.alert-box p:last-child { margin-bottom: 0; }

/* Loading ----------------------------------------------------------------- */

.loading-box { text-align: center; padding: 22px 0; }
.loading-title { font-weight: 600; margin-bottom: 10px; }

.loading-percent {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.loading-track {
  height: 9px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
}

/* Chart ------------------------------------------------------------------- */

.chart-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: #fff;
}

.chart-box canvas { width: 100%; height: 250px; display: block; }

/* Quotes ------------------------------------------------------------------ */

.quote-list { display: grid; gap: 12px; }

.quote-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}

.quote-stars { color: #f59e0b; font-size: 14px; letter-spacing: 1px; margin-bottom: 8px; }

.quote-card blockquote {
  margin: 0 0 10px;
  font-size: 15px;
  white-space: pre-line;
}

.quote-card strong { font-size: 14px; color: var(--muted); font-weight: 600; }

.quote-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.quote-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

/* Arguments --------------------------------------------------------------- */

.argument-grid { display: grid; gap: 12px; }

.argument-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  font-size: 15px;
}

.argument-card h3 { font-size: 16px; }

/* Price ------------------------------------------------------------------- */

.price-card {
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}

.price-featured {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 9px;
}

.price-body { padding: 20px 16px; background: #fff; }
.price-before { color: var(--muted); font-size: 15px; text-decoration: line-through; }

.price-value {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 4px 0;
}

.price-after { color: var(--muted); font-size: 14px; }
.price-title { margin-top: 10px; font-size: 14px; }
.price-title p { margin: 0; }

/* Timer ------------------------------------------------------------------- */

.timer-box {
  text-align: center;
  padding: 11px;
  background: var(--danger-bg);
  border-radius: var(--radius);
  color: var(--danger);
  font-weight: 600;
  font-size: 15px;
  margin-top: 12px;
}

.timer-box p { margin: 0; }
.timer-box span { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Spacers & footer -------------------------------------------------------- */

.spacer-1 { height: 10px; }
.spacer-2 { height: 22px; }
.spacer-3 { height: 36px; }

.quiz-footer {
  padding: 18px 20px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.quiz-footer a { color: var(--muted); }
.sep { margin: 0 7px; }

/* Fallback: hide images that fail to load --------------------------------- */

img.is-broken { display: none; }
.image-option img.is-broken { display: block; min-height: 90px; }

/* Accessibility ----------------------------------------------------------- */

:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 481px) {
  .app-shell { box-shadow: 0 0 0 1px var(--line); min-height: 100vh; }
}
