/* 305-EN-DOLOR landing pages: shared brand tokens, components and quiz styles. */

:root {
  /* Brand colors taken from 305endolor.com */
  --red: #b42233;
  --red-dark: #951b2a;
  --red-bright: #e3121b;
  --red-tint: #fbeaec;
  --navy: #263c69;
  --navy-deep: #132239;
  --navy-ink: #0d182b;
  --blue: #1e4fa0;
  --bg: #f6f9fc;
  --soft: #edf3f9;
  --card: #ffffff;
  --ink: #111827;
  --muted: #4a5565;
  --border: #d6dfea;
  --green: #16a34a;
  --gold: #f5b301;

  --font-heading: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgb(13 24 43 / .06), 0 8px 24px rgb(13 24 43 / .08);
  --shadow-lg: 0 2px 6px rgb(13 24 43 / .08), 0 24px 60px rgb(13 24 43 / .18);
  --gutter: 16px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.i18n-pending [data-i18n] { visibility: hidden; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.12; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.site-logo img { height: 48px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-note { display: none; font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--navy);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.lang-toggle::before {
  content: ""; width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lang-toggle:hover { border-color: var(--navy); }
@media (min-width: 760px) {
  .site-header .container { height: 76px; }
  .site-logo img { height: 62px; }
  .header-note { display: inline; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: var(--radius);
  font-family: var(--font-heading); font-weight: 700; font-size: 16px; letter-spacing: -.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgb(180 34 51 / .28); }
.btn-primary:hover { background: var(--red-dark); }
.btn-lg { min-height: 58px; font-size: 18px; padding: 0 28px; }
.btn-block { width: 100%; }

/* ---------- Trust chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.chips li::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-ink); color: #aab6ca; padding: 28px 0 32px; font-size: 12px; line-height: 1.6; }
.site-footer p + p { margin-top: 10px; }
.site-footer a { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 6px; padding: 0; list-style: none; }

/* ==========================================================================
   Quiz
   ========================================================================== */
.quiz { position: relative; scroll-margin-top: 90px; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 10px; }
.quiz-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px 4px 2px; margin-left: -2px;
  border: 0; background: none; color: var(--muted);
  font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 6px;
}
.quiz-back svg { width: 18px; height: 18px; }
.quiz-back:hover { color: var(--ink); }
.quiz-count { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.quiz-progress { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-bottom: 22px; }
.quiz-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--red-bright)); transition: width .4s ease; }

.quiz-body { transition: opacity .28s ease, transform .28s ease; }
.quiz-body.is-entering { opacity: 0; transform: translateX(18px); }
.quiz-title { font-size: clamp(22px, 4.6vw, 28px); font-weight: 800; outline: none; }
.quiz-sub { margin-top: 8px; color: var(--muted); }

.quiz-options { display: grid; gap: 10px; margin-top: 20px; }
.quiz-options--yesno { grid-template-columns: 1fr 1fr; }
.quiz-option {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 14px 44px 14px 14px;
  text-align: left; color: var(--ink);
  background: #fff; border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.quiz-option:focus-visible { border-color: var(--red); }
@media (hover: hover) {
  .quiz-option:hover { border-color: var(--red); box-shadow: 0 4px 14px rgb(180 34 51 / .12); }
}
.quiz-option:active { transform: scale(.99); }
.quiz-option-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--red-tint); color: var(--red);
}
.quiz-option-icon svg { width: 24px; height: 24px; }
.quiz-option-text { display: grid; gap: 2px; }
.quiz-option-text strong { font-family: var(--font-heading); font-size: 17px; font-weight: 700; line-height: 1.25; }
.quiz-option-text small { font-size: 14px; color: var(--muted); }
.quiz-option-check {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); color: transparent; background: #fff;
}
.quiz-option-check svg { width: 14px; height: 14px; }
.quiz-option.is-selected { border-color: var(--red); background: #fff7f8; }
.quiz-option.is-selected .quiz-option-check { background: var(--red); border-color: var(--red); color: #fff; }
.quiz-options--yesno .quiz-option { flex-direction: column; justify-content: center; text-align: center; gap: 8px; padding: 18px 10px; min-height: 120px; }
.quiz-options--yesno .quiz-option-text strong { font-size: 20px; }
.quiz-options--yesno .quiz-option-check { top: 12px; right: 12px; transform: none; }
.quiz-options--yesno .quiz-option[data-value="no"] .quiz-option-icon { background: var(--soft); color: var(--navy); }

.quiz-form { display: grid; gap: 14px; margin-top: 20px; }
.quiz-field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.quiz-field input {
  width: 100%; height: 54px; padding: 0 14px;
  font-size: 17px; color: var(--ink);
  background: #fff; border: 2px solid var(--border); border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.quiz-field input::placeholder { color: #9aa5b5; }
.quiz-field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgb(38 60 105 / .14); }
.quiz-field input[aria-invalid="true"] { border-color: var(--red-bright); }
.quiz-error, .quiz-form-error { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--red-bright); }
.quiz-form-error { margin: 0; }
.quiz-submit { min-height: 58px; font-size: 18px; margin-top: 4px; }
.quiz-consent { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.quiz-consent a { color: inherit; }
.quiz-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.quiz-private { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.quiz-private svg { width: 14px; height: 14px; }

/* Scan step */
.quiz-scan { list-style: none; padding: 0; margin: 22px 0 18px; display: grid; gap: 12px; }
.quiz-scan li {
  display: flex; align-items: center; gap: 12px; font-weight: 600;
  opacity: .35; animation: scan-in .4s ease forwards; animation-delay: var(--d);
}
.quiz-scan-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: transparent; flex: none; animation: scan-dot .4s ease forwards; animation-delay: calc(var(--d) + 450ms); }
.quiz-scan-dot svg { width: 14px; height: 14px; }
.quiz-scan-bar { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.quiz-scan-bar span { display: block; height: 100%; width: 0; background: var(--red); animation: scan-bar var(--t) linear forwards; }
@keyframes scan-in { to { opacity: 1; } }
@keyframes scan-dot { to { background: var(--green); color: #fff; } }
@keyframes scan-bar { to { width: 100%; } }

/* Done */
.quiz-done { text-align: center; }
.quiz-done-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--green); color: #fff; box-shadow: 0 0 0 8px rgb(22 163 74 / .14); }
.quiz-done-icon svg { width: 32px; height: 32px; }
.quiz-done .quiz-sub { max-width: 440px; margin: 10px auto 0; }
.quiz-done-next { margin: 24px 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.quiz-done-list { text-align: left; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.quiz-done-list li { counter-increment: step; display: flex; gap: 12px; font-size: 15px; }
.quiz-done-list li::before { content: counter(step); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .quiz-body, .quiz-progress span, .quiz-option { transition: none; }
  .quiz-scan li, .quiz-scan-dot, .quiz-scan-bar span { animation-duration: .01ms; animation-delay: 0ms; }
}
