/* ESG INSPIRE súťaž. Mobil na prvom mieste, farby a písma podľa ESG KLUBU (esgklub-web DESIGN.md).
   Dials: DESIGN_VARIANCE 6, MOTION_INTENSITY 6, VISUAL_DENSITY 3. */

:root {
  --deep: #0D3634;
  --deep-2: #082322;
  --teal: #55AAA5;
  --teal-hover: #66B9B4;
  --mint: #9FE0DB;
  --purple: #7E1D75;
  --purple-hover: #93268A;
  --white: #FFFFFF;
  --text: #F2F7F6;
  --text-soft: rgba(242, 247, 246, .74);
  --text-faint: rgba(242, 247, 246, .52);
  --glass: rgba(255, 255, 255, .08);
  --glass-strong: rgba(255, 255, 255, .13);
  --glass-line: rgba(255, 255, 255, .16);
  --ok: #7FE0B0;
  --bad: #FF9C93;
  --sans: 'Montserrat', system-ui, Arial, sans-serif;
  --display: 'Merriweather Sans', 'Montserrat', Arial, sans-serif;
  --pad: 20px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--deep);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mint); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}

/* ---------- Obrazovka ---------- */

.screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  max-width: 560px;
  margin: 0 auto;
}

.media {
  position: absolute;
  inset: 0 0 auto 0;
  height: 62dvh;
  z-index: -1;
  overflow: hidden;
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  transform-origin: 50% 40%;
  animation: kenburns 9s var(--ease-out) both;
}
.media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13,54,52,.55) 0%, rgba(13,54,52,0) 20%, rgba(13,54,52,0) 38%, rgba(13,54,52,.8) 70%, var(--deep) 92%);
}
.media--full { height: 100dvh; }
.media--full::after {
  background: linear-gradient(180deg, rgba(13,54,52,.5) 0%, rgba(13,54,52,0) 20%, rgba(13,54,52,.15) 45%, rgba(8,35,34,.92) 78%, var(--deep-2) 100%);
}
.media--dim img { filter: blur(18px) saturate(1.1); transform: scale(1.15); animation: none; opacity: .55; }
.media--dim { height: 100dvh; }
.media--dim::after { background: linear-gradient(180deg, rgba(13,54,52,.3), var(--deep) 85%); }

@keyframes kenburns {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--pad) 0;
  min-height: 60px;
}

.logo { height: 34px; width: auto; display: block; }

.body {
  margin-top: auto;
  padding: 0 var(--pad) calc(env(safe-area-inset-bottom, 0px) + 22px);
}

/* vstup obsahu */
.enter > * { animation: rise .55s var(--ease-out) both; }
.enter > *:nth-child(2) { animation-delay: .06s; }
.enter > *:nth-child(3) { animation-delay: .12s; }
.enter > *:nth-child(4) { animation-delay: .18s; }
.enter > *:nth-child(5) { animation-delay: .24s; }
.enter > *:nth-child(6) { animation-delay: .3s; }

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

/* ---------- Úvod ---------- */

.event {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.event .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(85,170,165,.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(85,170,165,0); }
  100% { box-shadow: 0 0 0 0 rgba(85,170,165,0); }
}

.intro-title {
  font-size: clamp(32px, 9.4vw, 46px);
  margin-bottom: 14px;
}
.intro-title em {
  font-style: normal;
  color: var(--mint);
}
.lead {
  color: var(--text-soft);
  font-size: 16px;
  margin: 0 0 20px;
  max-width: 34ch;
}

.prizes {
  margin: 0 0 22px;
}
.prizes-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 0 8px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 14px;
  font-weight: 600;
}
.chips svg { color: var(--mint); flex: none; }

.fine {
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  margin: 12px 0 0;
}

/* ---------- Tlačidlá ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  transition: transform .18s var(--ease-out), background-color .2s, box-shadow .2s, opacity .2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.btn-primary {
  background: var(--purple);
  color: var(--white);
  box-shadow: 0 12px 34px -8px rgba(126,29,117,.75), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: var(--purple-hover); }
.btn-teal {
  background: var(--teal);
  color: var(--deep);
  box-shadow: 0 12px 30px -10px rgba(85,170,165,.7);
}
.btn-teal:hover { background: var(--teal-hover); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn .arrow { transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.icon-btn {
  width: 44px; height: 44px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  background: rgba(13,54,52,.35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .18s var(--ease-out);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.icon-btn[disabled] { visibility: hidden; }

/* ---------- Otázka ---------- */

.progress {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.progress span {
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  position: relative;
}
.progress span::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.progress span.done::after,
.progress span.now::after { transform: scaleX(1); }
.progress span.now::after { background: var(--mint); }

.q-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--mint);
  margin: 0 0 8px;
}
.q-title {
  font-size: clamp(23px, 6.4vw, 30px);
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(4,20,19,.6);
}
.intro-title, .lead { text-shadow: 0 2px 20px rgba(4,20,19,.55); }
@media (max-height: 700px) {
  .media { height: 52dvh; }
}
.stage-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 18px;
}
.stage-line svg { flex: none; margin-top: 2px; color: var(--mint); }

.answers {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.answer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px 12px 12px;
  border-radius: 20px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: left;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  transition: transform .2s var(--spring), background-color .2s, border-color .2s, box-shadow .25s, color .2s;
  touch-action: manipulation;
}
.answer:active { transform: scale(.975); }
.answer:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.answer .letter {
  width: 38px; height: 38px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(85,170,165,.2);
  color: var(--mint);
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  transition: background-color .2s, color .2s;
}
.answer .check {
  margin-left: auto;
  flex: none;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s, transform .35s var(--spring);
}
.answer[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--deep);
  box-shadow: 0 14px 34px -12px rgba(85,170,165,.9);
}
.answer[aria-pressed="true"] .letter { background: var(--deep); color: var(--mint); }
.answer[aria-pressed="true"] .check { opacity: 1; transform: none; }

@media (hover: hover) {
  .answer:hover { background: var(--glass-strong); border-color: rgba(255,255,255,.28); }
  .answer[aria-pressed="true"]:hover { background: var(--teal-hover); }
}

/* ---------- Formulár ---------- */

.card {
  background: rgba(13,54,52,.62);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border-radius: 28px;
  padding: 22px 18px 20px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}
.form-title { font-size: clamp(26px, 7.4vw, 34px); margin-bottom: 8px; }
.form-lead { color: var(--text-soft); margin: 0 0 20px; font-size: 15px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 340px) { .row { grid-template-columns: 1fr; } }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 6px 4px;
}
.field label .opt { color: var(--text-faint); font-weight: 500; }
.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  border-color: var(--teal);
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 4px rgba(85,170,165,.25);
}
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field-error {
  font-size: 13px;
  color: var(--bad);
  margin: 6px 0 0 4px;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 6px 0 18px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.45;
}
.consent input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 26px; height: 26px;
  margin: 0;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.06);
  display: grid; place-items: center;
  transition: background-color .2s, border-color .2s;
}
.consent input::after {
  content: '';
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--deep);
  border-bottom: 2.5px solid var(--deep);
  transform: translateY(-2px) rotate(-45deg) scale(0);
  transition: transform .25s var(--spring);
}
.consent input:checked { background: var(--teal); border-color: var(--teal); }
.consent input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.consent input:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }
.consent input[aria-invalid="true"] { border-color: var(--bad); }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--mint); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

.alert {
  background: rgba(255,156,147,.12);
  border: 1px solid rgba(255,156,147,.45);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  margin: 0 0 14px;
}

.spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Výsledky ---------- */

.results {
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--pad) calc(env(safe-area-inset-bottom, 0px) + 32px);
}
.results .logo { margin-bottom: 26px; }

.score {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.ring { width: 112px; height: 112px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.14); }
.ring .bar {
  stroke: var(--teal);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}
.ring .num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
}
.ring .num small { font-size: 16px; color: var(--text-soft); font-weight: 700; }
.score-title { font-size: clamp(22px, 6vw, 28px); margin-bottom: 6px; }
.score-text { color: var(--text-soft); margin: 0; font-size: 15px; }

.entered {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(126,29,117,.55), rgba(85,170,165,.28));
  border: 1px solid rgba(255,255,255,.18);
  margin: 0 0 28px;
}
.entered svg { flex: none; color: var(--white); margin-top: 2px; }
.entered strong { display: block; font-size: 16px; margin-bottom: 2px; }
.entered p { margin: 0; font-size: 14px; color: var(--text-soft); }

.review-title { font-size: 20px; margin: 0 0 14px; }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
}
.review img {
  width: 64px; height: 84px;
  object-fit: cover;
  border-radius: 12px;
}
.review h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 8px;
}
.verdict {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 14px;
  margin: 0 0 3px;
}
.verdict svg { flex: none; margin-top: 2px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.verdict.right { color: var(--text); }
.verdict b { font-weight: 700; }

.thanks {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  margin: 26px 0 0;
}

/* ---------- Pravidlá ---------- */

.sheet {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  border-radius: 28px 28px 0 0;
  background: #0F3E3B;
  color: var(--text);
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
}
.sheet::backdrop { background: rgba(4,18,17,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-up .4s var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { padding: 26px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 22px); position: relative; }
.sheet h2 { font-size: 21px; margin: 0 0 12px; padding-right: 48px; }
.sheet h2 + ul { margin-top: 0; }
.sheet ul { padding-left: 18px; margin: 0 0 24px; font-size: 14px; color: var(--text-soft); }
.sheet li { margin-bottom: 8px; }
.sheet li strong { color: var(--text); }
.sheet-close {
  position: absolute; top: 16px; right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.08);
  display: grid; place-items: center;
}

/* ---------- Konfety ---------- */

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Väčšie obrazovky ---------- */

@media (min-width: 700px) {
  body {
    background:
      radial-gradient(50% 40% at 15% 20%, rgba(126,29,117,.22), transparent 70%),
      radial-gradient(50% 50% at 85% 80%, rgba(85,170,165,.18), transparent 70%),
      var(--deep-2);
  }
  .screen { box-shadow: 0 0 80px rgba(0,0,0,.4); background: var(--deep); }
  .media, .media--full, .media--dim { height: 70vh; }
}

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

[tabindex="-1"]:focus { outline: none; }
