/* =====================================================================
   Micro Labs — World Pharmacy Week 2026
   Mobile-first; tablet layout from 600px, wide tablet / desktop from 900px.
   ===================================================================== */

:root {
  --teal:        #0E7C8A;
  --teal-deep:   #0A5A66;
  --teal-dark:   #073F48;
  --mint:        #EAF5F5;
  --mint-edge:   #CFE6E7;
  --ink:         #12262A;
  --ink-soft:    #4A6167;
  --paper:       #FFFFFF;
  --page:        #F4F8F8;
  --good:        #17795E;
  --good-bg:     #E4F4EE;
  --bad:         #A3342C;
  --bad-bg:      #FBECEA;
  --gold:        #C98A1B;

  --radius:      14px;
  --radius-lg:   20px;
  --shadow:      0 2px 10px rgba(7, 63, 72, .08);
  --shadow-lift: 0 8px 26px rgba(7, 63, 72, .14);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --shell: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: .04em; }

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--teal);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 50;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------------------------------------------------------------- shell */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* --------------------------------------------------------------- header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--mint-edge);
  padding-block: .75rem;
  padding-top: calc(.75rem + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .shell { display: flex; justify-content: center; }
.logo { max-height: 38px; width: auto; }
.logo-fallback {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-deep);
  letter-spacing: .01em;
}

main.shell { padding-block: 1.25rem 2.5rem; }

/* --------------------------------------------------------------- footer */
.site-footer {
  background: var(--teal-dark);
  color: #CDE6E8;
  text-align: center;
  padding-block: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  font-size: .875rem;
}
.site-footer p { margin: 0 0 .25rem; }
.site-footer .muted { color: #8FB9BE; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--paper);
  border: 1px solid var(--mint-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
}

/* ----------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(165deg, var(--teal) 0%, var(--teal-deep) 70%, var(--teal-dark) 100%);
  border-color: transparent;
  color: #fff;
  text-align: center;
  padding-block: 2rem;
}
.eyebrow {
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .75rem;
  color: #A9DCE1;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.theme-band {
  background: rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.theme-label {
  display: block;
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #A9DCE1;
  margin-bottom: .35rem;
}
.theme-text {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}
.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0;
}
.hero .tagline { color: #DFF1F2; }

/* ----------------------------------------------------------------- form */
.form { margin-top: 1.25rem; }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--teal-deep);
}
.field input {
  width: 100%;
  font: inherit;
  font-size: 16px;              /* prevents iOS zoom on focus */
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: .8rem .9rem;
  min-height: 48px;             /* comfortable touch target */
  transition: border-color .15s ease, background .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(14, 124, 138, .18);
}

.grid-2 { display: grid; gap: 0; }

/* honeypot */
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  min-height: 52px;
  padding: .85rem 1.4rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease, background .15s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }

.btn-ghost {
  background: transparent;
  color: var(--teal-deep);
  border-color: var(--mint-edge);
}
.btn-ghost:hover { background: var(--mint); }

.btn-block { width: 100%; }

.btn-cta {
  font-size: 1.05rem;
  margin-top: .5rem;
  box-shadow: var(--shadow-lift);
}

/* --------------------------------------------------------------- alerts */
.alert {
  background: var(--bad-bg);
  border: 1px solid #EDC4BF;
  border-radius: var(--radius);
  color: var(--bad);
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert ul { margin: 0; padding-left: 1.1rem; }

/* ----------------------------------------------------------------- quiz */
.quiz-head { margin-bottom: 1.25rem; }
.quiz-head .eyebrow { color: var(--teal); }
.quiz-greeting {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.progress {
  background: var(--mint-edge);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  background: var(--teal);
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width .35s ease;
}
.progress-text {
  font-size: .8rem;
  color: var(--ink-soft);
  margin: .4rem 0 0;
}

.question { position: relative; padding-top: 2.25rem; }

.question.is-entering { animation: rise .3s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.q-number {
  position: absolute;
  top: -18px;
  left: 1.25rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lift);
}

.q-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  margin: .75rem 0 1.25rem;
  text-wrap: pretty;
}
.q-prompt:focus { outline: none; }

.options { display: grid; gap: .6rem; }

.option {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--mint);
  border: 1.5px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  min-height: 56px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  touch-action: manipulation;
}
.option:hover:not(:disabled) { border-color: var(--teal); }
.option:active:not(:disabled) { transform: scale(.99); }
.option:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.option:disabled { cursor: default; opacity: 1; }

.option-letter {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--mint-edge);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: .9rem;
  display: grid;
  place-items: center;
}
.option-text { flex: 1 1 auto; }

.option.is-selected { border-color: var(--teal); }
.option.is-correct {
  background: var(--good-bg);
  border-color: var(--good);
}
.option.is-correct .option-letter { background: var(--good); color: #fff; border-color: var(--good); }
.option.is-wrong {
  background: var(--bad-bg);
  border-color: var(--bad);
}
.option.is-wrong .option-letter { background: var(--bad); color: #fff; border-color: var(--bad); }

.feedback {
  margin: 1rem 0 0;
  font-size: .9rem;
  font-weight: 600;
  min-height: 1.25rem;
}
.feedback.is-good  { color: var(--good); }
.feedback.is-bad   { color: var(--bad); }
.feedback.is-quiet { color: var(--ink-soft); font-weight: 400; }

/* question navigation */
.quiz-nav {
  display: flex;
  gap: .6rem;
  margin-top: 1.25rem;
}
.quiz-nav .btn-back { flex: 0 0 auto; min-width: 6rem; }
.quiz-nav .btn-next { flex: 1 1 auto; }
.quiz-nav .btn-next:disabled {
  background: var(--mint-edge);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.quiz-nav .btn-next:disabled:active { transform: none; }

/* --------------------------------------------------------------- result */
.result-card { text-align: center; }

.thumb {
  font-size: 3.25rem;
  line-height: 1;
  margin-bottom: .5rem;
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.result-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 6vw, 2rem);
  color: var(--teal-deep);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.score-ring {
  --pct: 0;
  width: 150px;
  height: 150px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--teal) calc(var(--pct) * 1%), var(--mint-edge) 0);
}
.score-inner {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  align-content: center;
}
.score-value {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal-deep);
}
.score-label { font-size: .8rem; color: var(--ink-soft); }

.recognition {
  background: var(--mint);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  margin-bottom: 1.5rem;
}
.recognition h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--teal-deep);
}
.recognition p { margin: 0; color: var(--ink-soft); }

.summary {
  margin: 0 0 1.5rem;
  text-align: left;
  display: grid;
  gap: .5rem;
}
.summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--mint-edge);
  padding-bottom: .5rem;
}
.summary dt { font-size: .85rem; color: var(--ink-soft); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }

.qr { margin: 0 0 1.5rem; }
.qr img {
  margin: 0 auto .5rem;
  border: 1px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: .5rem;
  background: var(--paper);
}
.qr figcaption { text-align: center; }

.result-actions { display: grid; gap: .6rem; margin-top: 1.5rem; }

/* ------------------------------------------------------------ dashboard */
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.25rem; }
.stat {
  background: var(--paper);
  border: 1px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: 1rem;
}
.stat-value { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--teal-deep); }
.stat-label { font-size: .8rem; color: var(--ink-soft); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 640px; }
table.data th, table.data td { padding: .6rem .5rem; text-align: left; border-bottom: 1px solid var(--mint-edge); }
table.data th { color: var(--teal-deep); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
table.data tbody tr:nth-child(odd) { background: #FAFDFD; }

.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* ==================================================================
   Tablet — portrait, 600px and up
   ================================================================== */
@media (min-width: 600px) {
  :root { --shell: 44rem; }

  body { font-size: 17px; }

  .shell { padding-inline: 1.75rem; }
  main.shell { padding-block: 2rem 3.5rem; }

  .card { padding: 2rem 1.75rem; }

  .hero { padding-block: 3rem 2.5rem; }
  .theme-text { font-size: 1.3rem; }

  .grid-2 { grid-template-columns: 1fr 1fr; gap: 0 1rem; }

  .options { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .q-prompt { font-size: 1.3rem; }
  .btn-next { max-width: 20rem; margin-inline: auto; display: flex; }

  .result-actions { grid-template-columns: 1fr 1fr; max-width: 24rem; margin-inline: auto; }
  .share-actions  { grid-template-columns: 1fr 1fr; }
  .share-actions .btn-wa { grid-column: 1 / -1; }

  .stats { grid-template-columns: repeat(4, 1fr); }
}

/* ==================================================================
   Large tablet / landscape and desktop — 900px and up
   ================================================================== */
@media (min-width: 900px) {
  :root { --shell: 52rem; }

  .hero-title { font-size: 2.75rem; }
  .logo { max-height: 46px; }

  .question { padding: 2.5rem 2.25rem 2.25rem; }
  .q-number { left: 2.25rem; }
}

/* Admin needs more width than the campaign pages. */
.page-admin { --shell: 72rem; }



/* ==================================================================
   Required-field marks and inline errors
   ================================================================== */
.req {
  color: var(--bad);
  margin-left: .15rem;
  font-weight: 700;
}
.optional {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: .78rem;
  margin-left: .35rem;
}
.field.has-error input {
  border-color: var(--bad);
  background: var(--bad-bg);
}
.field-error {
  color: var(--bad);
  font-size: .8rem;
  margin: .3rem 0 0;
  font-weight: 600;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==================================================================
   Share the campaign
   ================================================================== */
.share-card h2 { font-size: 1.15rem; }

.share-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mint-edge);
  animation: rise .3s ease both;
}

.share-link {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}
.share-link input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink-soft);
  background: var(--page);
  border: 1.5px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  min-height: 48px;
}
.share-link .btn { flex: 0 0 auto; min-height: 48px; padding-inline: 1rem; }

.share-status {
  margin: .5rem 0 0;
  font-size: .85rem;
  font-weight: 600;
  color: var(--good);
  min-height: 1.2rem;
  text-align: center;
}

/* ==================================================================
   Celebration
   ================================================================== */
.celebrate {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.globe {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto .75rem;
  animation: pop .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.globe-svg { width: 100%; height: 100%; overflow: visible; }
.globe-sea  { fill: var(--teal); }
.globe-land { fill: #7FD4CB; }
.globe-rim {
  fill: none;
  stroke: var(--teal-dark);
  stroke-width: 2.5;
}
.globe-meridian {
  fill: none;
  stroke: rgba(255, 255, 255, .45);
  stroke-width: 1.5;
}
.globe-spin { animation: spin 14s linear infinite; }
@keyframes spin {
  from { transform: translateX(0); }
  to   { transform: translateX(-120px); }
}

.globe-thumb {
  position: absolute;
  right: -6px;
  bottom: -4px;
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(7, 63, 72, .3));
  animation: thumbIn .5s .35s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes thumbIn {
  from { transform: scale(.2) rotate(-25deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.result-eyebrow { color: var(--teal); }

.result-title .name {
  color: var(--teal);
  white-space: nowrap;
}

.score-ring { transition: none; }
.result-card.is-settled .score-ring {
  animation: ringPulse .5s ease;
}
@keyframes ringPulse {
  50% { transform: scale(1.04); }
}

/* ==================================================================
   Answer review (shown only at the end)
   ================================================================== */
.review {
  text-align: left;
  margin-bottom: 1.5rem;
  border: 1px solid var(--mint-edge);
  border-radius: var(--radius);
  background: var(--page);
  overflow: hidden;
}
.review-heading {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--teal-deep);
  margin-bottom: .75rem;
  text-align: center;
}

/* the disclosure header */
.review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem 1rem;
  min-height: 52px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--teal-deep);
  user-select: none;
}
.review-summary::-webkit-details-marker { display: none; }
.review-summary:hover { background: var(--mint); }
.review-summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.review-chevron {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-right: 2.5px solid var(--teal);
  border-bottom: 2.5px solid var(--teal);
  transform: rotate(45deg);
  transition: transform .2s ease;
  margin-bottom: 4px;
}
.review[open] .review-chevron {
  transform: rotate(225deg);
  margin-bottom: -2px;
}
.review[open] .review-summary { border-bottom: 1px solid var(--mint-edge); }
.review[open] .review-summary-text::after { content: ' (tap to hide)'; font-weight: 400; color: var(--ink-soft); font-size: .85em; }

.review-body {
  padding: 1rem;
  animation: rise .25s ease both;
}
.review-body .review-item:last-child { margin-bottom: 0; }

.review-item {
  border: 1px solid var(--mint-edge);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: .6rem;
  background: var(--page);
}
.review-item.is-right { background: var(--good-bg); border-color: #BFE3D6; }
.review-item.is-wrong { background: var(--bad-bg); border-color: #EDC4BF; }

.review-q {
  font-weight: 600;
  font-size: .92rem;
  margin: 0 0 .5rem;
  line-height: 1.4;
}
.review-num {
  display: inline-block;
  font-family: var(--serif);
  color: var(--teal-deep);
  margin-right: .4rem;
}

.review-a, .review-correct {
  margin: 0;
  font-size: .88rem;
  color: var(--ink-soft);
}
.review-correct { margin-top: .3rem; color: var(--bad); }
.review-item.is-right .review-a { color: var(--good); }

.review-mark {
  font-weight: 700;
  margin-right: .25rem;
}
.review-item.is-right .review-mark { color: var(--good); }
.review-item.is-wrong .review-mark { color: var(--bad); }



/* ==================================================================
   Shareable card
   ================================================================== */
.sharecard { margin-bottom: 1.5rem; }

.card-image {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin-inline: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--mint-edge);
  box-shadow: var(--shadow-lift);
  background: #0A5A66;
  aspect-ratio: 1080 / 1920;
}

.share-actions {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}
.share-actions .btn { width: 100%; }

.btn-wa {
  background: #25D366;
  color: #08331A;
  font-weight: 700;
}
.btn-wa:hover { background: #1FBE5A; }

.share-hint {
  margin: .75rem 0 0;
  text-align: center;
  line-height: 1.45;
}

/* ------------------------------------------------------ preferences/print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .result-actions, .celebrate,
  .share-card, .share-actions, .share-hint { display: none; }
  .review[open] .review-body { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
