:root {
  --eco-blue: #004793;
  --eco-blue-dark: #003369;
  --eco-blue-soft: #e8f0f9;
  --eco-accent: #ffa34f;
  --eco-green: #2f9e83;
  --ink: #16202e;
  --ink-soft: #5a6679;
  --line: #e4e9f0;
  --bg: #f5f8fc;
  --white: #ffffff;
  --ok: #1f9d63;
  --ok-bg: #e7f6ee;
  --ko: #d8475a;
  --ko-bg: #fdecee;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 71, 147, 0.08);
  --shadow-hover: 0 16px 40px rgba(0, 71, 147, 0.16);
  --t: 220ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(0, 71, 147, .45); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =================== DARK MODE =================== */
body.dark {
  --eco-blue-soft: #1b2b44;
  --ink: #e6edf6;
  --ink-soft: #9fb0c4;
  --line: #27344c;
  --bg: #0e1726;
  --white: #172233;
  --ok-bg: #133127;
  --ko-bg: #361b22;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, .55);
}
body.dark .cat-card__name, body.dark .cat-head h1, body.dark .hero h1,
body.dark .quiz__title, body.dark .results-head h1 { color: #6ea8e6; }
body.dark .settings__value, body.dark .quiz-list-card__go { color: #fff; }

/* =================== HEADER (barre bleu foncé ecotous.tn) =================== */
.site-header {
  background: linear-gradient(180deg, #004f9f 0%, var(--eco-blue) 100%);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(0, 35, 75, .25);
}
.site-header__inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand__logo { height: 42px; width: auto; display: block; filter: brightness(0) invert(1); }
.brand__logo-plain { height: 44px; width: auto; display: block; }
.brand__quiz {
  font-weight: 800; font-size: 13px; color: #fff;
  letter-spacing: .5px; padding: 3px 10px;
  background: rgba(255, 255, 255, .18); border-radius: 999px;
}

.main-nav { margin-left: auto; }
.main-menu { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.main-menu > li { position: relative; }
.main-menu > li > a {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 13px; text-decoration: none;
  font-weight: 600; font-size: 14.5px; color: #fff;
  border-radius: 10px; transition: color var(--t), background var(--t); white-space: nowrap;
}
.main-menu > li > a:hover { background: rgba(255, 255, 255, .15); }
.nav-quiz > a { background: rgba(255, 255, 255, .16); }
.caret {
  width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .75; transition: transform var(--t);
}
.has-sub:hover .caret { transform: rotate(-135deg) translateY(-2px); }

.sub-menu {
  list-style: none; margin: 0; padding: 8px;
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--t), transform var(--t), visibility var(--t); z-index: 60;
}
.has-sub:hover > .sub-menu,
.has-sub.open > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch .sub-menu { left: auto; right: 0; min-width: 150px; }
.sub-menu a {
  display: block; padding: 9px 12px; text-decoration: none;
  font-size: 14px; color: var(--ink-soft); border-radius: 9px; transition: color var(--t), background var(--t);
}
.sub-menu a:hover { color: var(--eco-blue); background: var(--eco-blue-soft); }

.header-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.header-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: none; background: transparent; color: #fff; text-decoration: none;
  border-radius: 10px; transition: background var(--t); cursor: pointer;
}
.header-icon:hover { background: rgba(255, 255, 255, .15); }
.header-arrow { background: rgba(255, 255, 255, .14); }
.icon-sun { display: none; }
body.dark .header-icon .icon-sun { display: block; }
body.dark .header-icon .icon-moon { display: none; }

.burger {
  display: none; width: 42px; height: 42px; border: none; background: transparent;
  border-radius: 10px; padding: 0; flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform var(--t), opacity var(--t); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .burger { display: flex; }
  .main-nav {
    position: fixed; inset: 65px 0 auto 0; background: var(--white);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height var(--t); margin: 0;
  }
  .main-nav.open { max-height: calc(100vh - 65px); overflow-y: auto; }
  .main-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px clamp(16px, 4vw, 40px) 20px; }
  .main-menu > li > a { justify-content: space-between; padding: 13px 8px; border-radius: 8px; color: var(--ink); }
  .main-menu > li > a:hover { background: var(--eco-blue-soft); color: var(--eco-blue); }
  .nav-quiz > a { background: var(--eco-blue-soft); color: var(--eco-blue); }
  .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: none; border-left: 2px solid var(--eco-blue-soft); border-radius: 0; margin: 0 0 6px 12px;
    max-height: 0; overflow: hidden; padding: 0 8px; transition: max-height var(--t), padding var(--t);
  }
  .has-sub.open > .sub-menu { max-height: 500px; padding: 4px 8px; }
  .has-sub:hover > .sub-menu { max-height: 0; } /* hover ne s'applique pas sur mobile */
  .has-sub.open:hover > .sub-menu { max-height: 500px; }
}

/* =================== LAYOUT =================== */
.app {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 5vw, 48px) 50px;
  min-height: 62vh;
}
.loader { text-align: center; color: var(--ink-soft); padding: 80px 0; }

/* =================== HERO =================== */
.hero { text-align: center; padding: 12px 0 26px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; margin: 0 0 12px; color: var(--eco-blue); line-height: 1.15; }
.hero p { font-size: clamp(15px, 2.2vw, 18px); color: var(--ink-soft); max-width: 640px; margin: 0 auto; }
.hero__stats { display: inline-flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.hero__stat b { display: block; font-size: 26px; color: var(--eco-blue); font-weight: 800; }
.hero__stat span { font-size: 13px; color: var(--ink-soft); }

/* =================== SETTINGS (slider) =================== */
.settings {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin: 26px 0 6px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.settings__label { font-weight: 700; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.settings__icon { color: var(--eco-blue); display: grid; place-items: center; }
.settings__slide { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 240px; }
.settings__range {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; flex: 1;
  background: linear-gradient(90deg, var(--eco-blue) var(--fill, 50%), var(--eco-blue-soft) var(--fill, 50%));
}
.settings__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--eco-blue); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,71,147,.4); cursor: pointer;
}
.settings__range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--eco-blue);
  border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,71,147,.4); cursor: pointer;
}
.settings__value {
  min-width: 58px; text-align: center; font-weight: 800; font-size: 16px; color: var(--white);
  background: var(--eco-blue); border-radius: 999px; padding: 6px 4px;
}
.settings__hint { font-size: 12.5px; color: var(--ink-soft); width: 100%; }
.settings__link {
  margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--eco-blue);
  text-decoration: none; white-space: nowrap;
}
.settings__link:hover { text-decoration: underline; }

/* =================== SECTION TITLE =================== */
.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-soft); margin: 30px 0 16px;
}

/* =================== CATEGORY GRID =================== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.cat-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--eco-blue), var(--eco-green)); opacity: 0; transition: opacity var(--t);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }
.cat-card:hover::before { opacity: 1; }
.cat-card__icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--eco-blue-soft); border-radius: 14px; color: var(--eco-blue);
}
.cat-card__icon svg { width: 28px; height: 28px; }
.cat-card__name { font-size: 18px; font-weight: 700; color: var(--eco-blue); margin: 4px 0 0; }
.cat-card__desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; flex: 1; }
.cat-card__count { font-size: 13px; font-weight: 600; color: var(--eco-green); margin-top: 6px; }
.cat-card__count.is-empty { color: var(--ink-soft); opacity: .7; }

/* =================== BACK LINK =================== */
.back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600;
  color: var(--eco-blue); text-decoration: none; margin-bottom: 20px; background: none; border: none; padding: 0;
}
.back:hover { text-decoration: underline; }

/* =================== QUIZ LIST =================== */
.cat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.cat-head__icon { width: 56px; height: 56px; display: grid; place-items: center; background: var(--eco-blue-soft); border-radius: 14px; color: var(--eco-blue); }
.cat-head__icon svg { width: 28px; height: 28px; }
.cat-head h1 { font-size: clamp(22px, 4vw, 32px); margin: 0; color: var(--eco-blue); }
.cat-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }

.quiz-list { display: grid; gap: 14px; margin-top: 22px; }
.quiz-list-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-decoration: none; color: inherit; cursor: pointer; transition: transform var(--t), box-shadow var(--t);
}
.quiz-list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quiz-list-card__body { min-width: 0; }
.quiz-list-card__title { font-weight: 700; font-size: 16px; margin: 0 0 4px; color: var(--ink); }
.quiz-list-card__meta { font-size: 13px; color: var(--ink-soft); }
.quiz-list-card__go {
  flex: none; font-weight: 700; font-size: 14px; color: var(--white);
  background: var(--eco-blue); padding: 10px 16px; border-radius: 999px; white-space: nowrap;
}

/* =================== QUIZ PLAYER =================== */
.quiz {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow);
}
.quiz__title { font-size: clamp(20px, 3.5vw, 28px); margin: 0 0 4px; color: var(--eco-blue); }
.quiz__source { font-size: 13px; color: var(--ink-soft); margin: 0 0 18px; }
.quiz__progress { height: 8px; background: var(--eco-blue-soft); border-radius: 999px; overflow: hidden; margin-bottom: 24px; }
.quiz__progress-bar { height: 100%; background: linear-gradient(90deg, var(--eco-blue), var(--eco-green)); width: 0%; transition: width .3s ease; }

.q { margin-bottom: 26px; }
.q__text { font-weight: 600; font-size: 17px; margin: 0 0 14px; line-height: 1.4; }
.q__num {
  display: inline-flex; min-width: 26px; height: 26px; align-items: center; justify-content: center;
  background: var(--eco-blue); color: var(--white); border-radius: 8px; font-size: 13px; font-weight: 700; margin-right: 10px;
}
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font: inherit; font-size: 15px; color: var(--ink);
  transition: border-color var(--t), background var(--t);
}
.option:hover:not(:disabled) { border-color: var(--eco-blue); background: var(--eco-blue-soft); }
.option:disabled { cursor: default; }
.option__letter {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px;
  background: var(--eco-blue-soft); color: var(--eco-blue); font-weight: 700; font-size: 14px;
}
.option.is-selected { border-color: var(--eco-blue); background: var(--eco-blue-soft); }
.option.is-selected .option__letter { background: var(--eco-blue); color: var(--white); }
.option.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.option.is-correct .option__letter { background: var(--ok); color: var(--white); }
.option.is-wrong { border-color: var(--ko); background: var(--ko-bg); }
.option.is-wrong .option__letter { background: var(--ko); color: var(--white); }

.explanation {
  margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-soft);
  background: var(--bg); border-left: 3px solid var(--eco-blue); border-radius: 0 10px 10px 0; padding: 10px 14px;
}
.explanation strong { color: var(--eco-blue); }
.exp-source { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--eco-blue); text-decoration: none; }
.exp-source:hover { text-decoration: underline; }

/* Liste des articles sources dans le résultat */
.src-list { display: grid; gap: 8px; }
.src-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  font-size: 14px; font-weight: 600; transition: border-color var(--t), transform var(--t);
}
.src-link:hover { border-color: var(--eco-blue); transform: translateX(2px); }
.src-link svg { width: 18px; height: 18px; color: var(--eco-blue); flex: none; }
.src-link span:nth-child(2) { flex: 1; min-width: 0; }
.src-go { color: var(--eco-blue); font-weight: 700; }

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 15px; padding: 13px 26px;
  border-radius: 999px; border: 1.5px solid transparent; text-decoration: none;
  transition: transform .12s ease, box-shadow var(--t), background var(--t);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--eco-blue); color: var(--white); }
.btn--primary:hover { background: var(--eco-blue-dark); box-shadow: var(--shadow); }
.btn--primary:disabled { background: #b8c6d8; cursor: not-allowed; box-shadow: none; }
.btn--ghost { background: var(--white); color: var(--eco-blue); border-color: var(--eco-blue); }
.btn--ghost:hover { background: var(--eco-blue-soft); }
.quiz__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* =================== WIZARD (une question à la fois) =================== */
.quiz-progress-bar {
  position: sticky; top: 64px; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); padding: 10px 0; margin-bottom: 6px;
}
.quiz-progress-bar__track { flex: 1; height: 10px; background: var(--eco-blue-soft); border-radius: 999px; overflow: hidden; }
.quiz-progress-bar__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--eco-blue), var(--eco-green)); border-radius: 999px; transition: width .3s ease; }
.quiz-progress-bar__label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

.quiz.wizard { padding-bottom: 18px; }
.q__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.q__step { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--eco-blue); margin: 0; }
.q__article { display: inline-flex; align-items: center; gap: 6px; }
.q__article svg { width: 16px; height: 16px; }
.wizard .q__text { font-size: clamp(18px, 2.6vw, 22px); margin: 0 0 20px; }
.wizard .option { padding: 15px 16px; font-size: 15.5px; }

.wizard-nav {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-top: 16px; box-shadow: var(--shadow);
}
.wizard-nav__count { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.btn--finish { background: var(--ok); }
.btn--finish:hover { background: #18794d; }

/* =================== NAME CARD =================== */
.namecard {
  max-width: 520px; margin: 24px auto; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(26px, 5vw, 44px);
}
.namecard__icon { width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--eco-blue-soft); color: var(--eco-blue); border-radius: 50%; }
.namecard__icon svg { width: 32px; height: 32px; }
.namecard h1 { color: var(--eco-blue); margin: 0 0 8px; font-size: 26px; }
.namecard__sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; }
.namecard__input { width: 100%; margin-bottom: 14px; text-align: center; font-size: 16px; }
.namecard__go { width: 100%; }

/* =================== REVIEW (détail des réponses) =================== */
.review { display: grid; gap: 14px; }
.review-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.review-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.review-num { width: 26px; height: 26px; display: grid; place-items: center; background: var(--eco-blue); color: #fff; border-radius: 8px; font-size: 13px; font-weight: 700; }
.review-badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.review-badge.is-ok { background: var(--ok-bg); color: var(--ok); }
.review-badge.is-ko { background: var(--ko-bg); color: var(--ko); }
.review-q { font-weight: 600; font-size: 16px; margin: 0 0 12px; line-height: 1.4; }
.review-opts { display: grid; gap: 8px; }
.review-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14.5px; }
.review-opt.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.review-opt.is-correct .option__letter { background: var(--ok); color: #fff; }
.review-opt.is-wrong { border-color: var(--ko); background: var(--ko-bg); }
.review-opt.is-wrong .option__letter { background: var(--ko); color: #fff; }
.review-expl { font-size: 14px; color: var(--ink-soft); background: var(--bg); border-left: 3px solid var(--eco-blue); border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 12px 0 0; line-height: 1.5; }
.review-expl strong { color: var(--eco-blue); }
.review-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.review-src-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); min-width: 0; }
.review-src-title svg { width: 16px; height: 16px; color: var(--eco-blue); flex: none; }
.review-src-actions { display: flex; gap: 8px; flex: none; }
.btn--sm { padding: 8px 14px; font-size: 13px; }

/* =================== MODAL (iframe article) =================== */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(8, 20, 40, .6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: clamp(10px, 3vw, 40px); animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal__box { background: var(--white); border-radius: 16px; width: min(1000px, 100%); height: min(88vh, 100%); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--eco-blue); color: #fff; }
.modal__title { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.modal__head .btn--ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.modal__head .btn--ghost:hover { background: rgba(255,255,255,.28); }
.modal__close { width: 36px; height: 36px; border: none; background: rgba(255,255,255,.15); color: #fff; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; }
.modal__close:hover { background: rgba(255,255,255,.3); }
.modal__body { flex: 1; background: #fff; }
.modal__body iframe { width: 100%; height: 100%; border: 0; display: block; }

/* =================== RESULT =================== */
.result {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); text-align: center;
}
.result__ring {
  width: 140px; height: 140px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--eco-green) var(--pct, 0%), var(--eco-blue-soft) 0); position: relative;
}
.result__ring::after { content: ""; position: absolute; inset: 12px; background: var(--white); border-radius: 50%; }
.result__score { position: relative; z-index: 1; font-size: 30px; font-weight: 800; color: var(--eco-blue); }
.result__score small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.result__msg { font-size: 20px; font-weight: 700; margin: 6px 0 4px; color: var(--ink); }
.save-note { font-size: 13.5px; font-weight: 600; margin: 0 0 16px; }
.save-note.is-ok { color: var(--ok); }
.save-note.is-warn { color: #b8741a; }
.result__sub { color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; }

.result__save {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; text-align: left; margin: 0 0 18px;
}
.result__save-title { font-weight: 700; font-size: 15px; margin: 0 0 12px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.result__save-row { display: flex; gap: 10px; flex-wrap: wrap; }
.result__input {
  flex: 1; min-width: 200px; font: inherit; font-size: 15px; padding: 12px 15px;
  border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--white);
}
.result__input:focus { border-color: var(--eco-blue); outline: none; }
.result__saved-note { font-size: 13.5px; color: var(--ok); font-weight: 600; margin: 10px 0 0; display: none; }
.result__saved-note.show { display: block; }

.result__article { background: var(--eco-blue-soft); border-radius: 14px; padding: 18px 20px; text-align: left; margin: 0 0 22px; }
.result__article-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--eco-blue); display: flex; align-items: center; gap: 6px; }
.result__article-title { font-weight: 700; font-size: 16px; margin: 6px 0 12px; color: var(--ink); }
.result__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* =================== RESULTS HISTORY =================== */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.results-head h1 { font-size: clamp(22px, 4vw, 32px); margin: 0; color: var(--eco-blue); }
.results-table { width: 100%; border-collapse: collapse; margin-top: 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results-table th, .results-table td { padding: 13px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.results-table th { background: var(--eco-blue-soft); color: var(--eco-blue); font-weight: 700; }
.results-table tr:last-child td { border-bottom: none; }
.results-table .score-badge { font-weight: 700; color: var(--eco-blue); }

/* =================== EMPTY =================== */
.empty { text-align: center; color: var(--ink-soft); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: 50px 24px; }

/* =================== FOOTER =================== */
.site-footer { background: #0c2440; color: #cdd8e6; margin-top: 30px; }
.footer-top { max-width: 1080px; margin: 0 auto; padding: 40px clamp(16px, 5vw, 48px) 10px; text-align: center; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; }
.footer-menu a { color: #cdd8e6; text-decoration: none; font-size: 14px; font-weight: 500; transition: color var(--t); }
.footer-menu a:hover { color: var(--white); }
.footer-divider { height: 1px; background: rgba(255,255,255,.12); margin: 22px auto; max-width: 900px; }
.footer-copy-top { font-size: 14px; color: #aebcd0; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footer-copy-top img { height: 28px; width: auto; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); background: #081a30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1080px; margin: 18px auto 0; padding: 18px clamp(16px, 5vw, 48px);
}
.footer-social { display: flex; align-items: center; gap: 10px; }
.footer-social__title { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #aebcd0; margin-right: 4px; }
.footer-social a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #cdd8e6; transition: background var(--t), color var(--t), transform var(--t);
}
.footer-social a:hover { background: var(--eco-blue); color: var(--white); transform: translateY(-2px); }
.footer-mail { font-size: 14px; color: #aebcd0; }

@media (max-width: 560px) {
  .quiz-list-card { flex-direction: column; align-items: flex-start; }
  .quiz-list-card__go { align-self: stretch; text-align: center; }
  .hero__stats { gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
