/* ============================================================
 * 5C-CCG assessment - vizuál
 * Paleta vychádza z log Global Babysitters Hub: šalviová zelená,
 * broskyňovo-piesková, teplý krém, s jemným ružovým akcentom (ICQAW).
 * ============================================================ */

:root {
  --bg: #f6f0e4;
  --card-bg: #ffffff;
  --ink: #33382b;
  --muted: #7b7d6b;

  --sage-100: #eef3e2;
  --sage-200: #dbe6c6;
  --sage-400: #a7ba86;
  --sage-600: #7a9560;
  --sage-700: #5d7548;
  --sage-800: #44583a;

  --peach-100: #faf0e2;
  --peach-200: #f1dcc0;
  --peach-400: #e6c29a;

  --pink: #d0557f;
  --line: #e7e0cf;
  --line-strong: #d8cfb8;
  --error: #b3261e;
  --focus: #3b82f6;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 28px rgba(83, 96, 52, .10), 0 1px 3px rgba(83, 96, 52, .08);
  --maxw: 780px;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  background:
    radial-gradient(620px 420px at -5% -5%, var(--peach-200) 0%, transparent 70%),
    radial-gradient(720px 520px at 105% 12%, var(--sage-200) 0%, transparent 70%),
    radial-gradient(640px 480px at 40% 110%, var(--peach-100) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 18px 96px;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(122, 149, 96, .22);
  border-radius: var(--radius);
  padding: 30px 30px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

h1 { font-size: 24px; line-height: 1.25; margin: 0 0 10px; color: var(--sage-800); }
.subtitle { color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- intro ---------- */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 34px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 2px dashed var(--peach-200);
}
/* Logá sú orezané na viditeľný obsah; GBH je zámerne väčšie ako ICQAW */
.brand img { display: block; width: auto; max-width: 100%; }
.brand .brand-gbh { height: 84px; }
.brand .brand-icqaw { height: 52px; }

.intro-head { text-align: center; margin-bottom: 8px; }
.intro-head h1 { font-size: 22px; letter-spacing: .02em; }
#intro-subtitle { font-weight: 700; }

h2.section-heading {
  font-size: 17px;
  margin: 26px 0 8px;
  color: var(--sage-800);
  display: flex;
  align-items: center;
  gap: 10px;
}
h2.section-heading::before {
  content: "";
  width: 8px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--sage-400), var(--peach-400));
  flex-shrink: 0;
}
#intro-sections p { margin: 8px 0; }
#intro-sections a { color: var(--sage-700); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
#intro-sections p.compact { margin: 0; }
#intro-sections h2 + p.compact { margin-top: 8px; }
#intro-sections ul, #intro-sections ol { margin: 8px 0 8px 22px; padding: 0; }
#intro-sections li { margin: 5px 0; }
#intro-sections li::marker { color: var(--sage-600); font-weight: 700; }
.kv-list { list-style: none; margin-left: 0 !important; }
.kv-list li { margin: 8px 0; padding: 8px 14px; background: var(--peach-100); border-radius: 12px; }
.kv-list .kv-label { font-weight: 700; color: var(--sage-800); }

.closing-bold {
  font-weight: 700;
  margin: 22px 0 0;
  padding: 14px 16px;
  background: var(--sage-100);
  border-left: 5px solid var(--sage-600);
  border-radius: 12px;
}
.required-note { color: var(--muted); font-size: 14px; margin-top: 0; }

/* ---------- forms ---------- */
.field { margin: 18px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--sage-800); }
.req { color: var(--pink); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.hint.center { text-align: center; margin-top: 14px; }

input[type=text], input[type=email], select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fdfbf6;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:hover, input[type=email]:hover, select:hover { border-color: var(--sage-400); }
input[type=text]:focus, input[type=email]:focus, select:focus {
  outline: none;
  border-color: var(--sage-600);
  box-shadow: 0 0 0 4px rgba(122, 149, 96, .22);
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 13px 26px;
  border: 2px solid var(--sage-600);
  border-radius: 999px;
  background: #fff;
  color: var(--sage-700);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--sage-600), var(--sage-700));
  border-color: var(--sage-700);
  color: #fff;
  box-shadow: 0 6px 16px rgba(93, 117, 72, .30);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(93, 117, 72, .36); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
#start-btn, #submit-btn, #code-btn { margin-top: 12px; width: 100%; font-size: 17px; }

.error-text { color: var(--error); font-weight: 700; }

/* ---------- progress ---------- */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 0 12px;
  margin-bottom: 4px;
}
.progress-inner {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(122, 149, 96, .25);
  border-radius: 22px;
  padding: 9px 22px 9px 16px;
  box-shadow: 0 4px 16px rgba(83, 96, 52, .10);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 18px;
}
/* logo vľavo hore v pevnej lište - ostáva viditeľné pri skrolovaní testu */
.bar-logo { display: block; height: 50px; width: auto; flex: 0 0 auto; }
.bar-progress { flex: 1 1 auto; min-width: 0; }
#progress-label { font-size: 14px; font-weight: 700; color: var(--sage-800); }
.progress-track {
  margin-top: 7px;
  height: 10px;
  background: var(--sage-100);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sage-400), var(--sage-700));
  border-radius: 999px;
  transition: width .25s ease;
}

/* ---------- question cards ---------- */
.q {
  position: relative;
  background: var(--card-bg);
  border: 1px solid rgba(122, 149, 96, .20);
  border-left: 7px solid var(--peach-400);
  border-radius: var(--radius);
  padding: 24px 26px 26px;
  margin: 0 0 22px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.q.answered { border-left-color: var(--sage-600); }
.q.answered::after {
  content: "\2713";
  position: absolute;
  top: 16px; right: 18px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sage-600);
  color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.q.unanswered-flag {
  border-left-color: var(--error);
  background: #fff6f5;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .15), var(--shadow);
}

.q-header { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.q-code {
  display: inline-block;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .03em;
  color: #000;
  background: var(--sage-100);
  border: 1px solid var(--sage-200);
  padding: 4px 16px;
  border-radius: 999px;
}
.q-req { color: var(--pink); font-weight: 800; }

.q-text { margin: 0 0 16px; font-size: 17px; color: var(--ink); }
.q-text p { margin: 0; }
.q-text p + p { margin-top: 14px; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: #fdfbf6;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.opt:hover { border-color: var(--sage-400); background: var(--sage-100); }
.opt:focus-within { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: 1px; }
.opt.checked {
  border-color: var(--sage-600);
  background: var(--sage-100);
  box-shadow: 0 2px 10px rgba(93, 117, 72, .16);
}

/* vlastné radio */
.opt input[type=radio] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin: 2px 0 0;
  border: 2px solid var(--sage-400);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.opt input[type=radio]::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .12s;
}
.opt input[type=radio]:checked { border-color: var(--sage-700); background: var(--sage-700); }
.opt input[type=radio]:checked::before { transform: scale(1); }

/* linear scale */
.scale { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.scale .opt {
  flex: 1 1 64px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 8px;
}
.scale .opt input[type=radio] { margin: 0; }
.scale .opt .scale-num { font-weight: 800; font-size: 17px; color: var(--sage-800); }

/* ---------- question images ---------- */
.q-image-wrap { margin: 4px 0 18px; display: flex; justify-content: center; }
.q-image {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 260px;
  object-fit: cover;
  object-position: center;
  border: 4px solid #fff;
  outline: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(83, 96, 52, .18);
  pointer-events: none;   /* obrázok sa nedá rozkliknúť ani otvoriť do celej obrazovky */
  user-select: none;
  -webkit-user-drag: none;
  background: var(--peach-100);
  transition: transform .15s;
}
.q-image:hover { transform: scale(1.015); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(38, 44, 30, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

/* ---------- submit / states ---------- */
.submit-area { text-align: center; }

.spinner {
  width: 46px; height: 46px;
  border: 5px solid var(--sage-100);
  border-top-color: var(--sage-600);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.assessment-code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  background: var(--peach-100);
  border: 1px dashed var(--peach-400);
  border-radius: 12px;
  padding: 10px 16px;
  display: inline-block;
}

/* ---------- súhlas (Participant Agreement and Consent Form) ---------- */
/* Karta vyplní okno: dokument sa skroluje vo vnútri, tlačidlo "I Agree" ostáva stále na očiach. */
/* na obrazovke so súhlasom sa spodná rezerva stránky (96 px pre otázky) nepotrebuje */
body.is-consent #app { padding-bottom: 28px; }
.consent-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  min-height: 470px;
  max-height: 1000px;
  margin-bottom: 0;
  padding-bottom: 24px;
}
.consent-card .brand { flex: 0 0 auto; padding-bottom: 14px; margin-bottom: 14px; }
.consent-card .brand .brand-gbh { height: 54px; }
.consent-card .brand .brand-icqaw { height: 34px; }
.consent-frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fdfbf6;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.consent-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 28px 28px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.consent-scroll:focus-visible { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: -3px; }
.consent-meter { flex: 0 0 auto; height: 6px; background: var(--sage-100); }
.consent-meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sage-400), var(--sage-700));
  transition: width .12s linear;
}
/* nápoveda pod dokumentom: tučná, väčšia, VEĽKÝMI PÍSMENAMI (želanie majiteľa 30. 11. 2026) */
.consent-hint { flex: 0 0 auto; margin: 10px 0 0; text-align: center; font-size: 16px; font-weight: 800; text-transform: uppercase; color: var(--muted); min-height: 1.5em; }
.consent-hint.done { color: var(--sage-700); font-weight: 700; }
.consent-agree { flex: 0 0 auto; }

/* text dokumentu */
.consent-doc { font-size: 12px; line-height: 1.55; color: var(--ink); }
.consent-doc p { margin: 0 0 8px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.consent-doc strong { color: var(--sage-800); }
.consent-doc a { color: var(--sage-700); font-weight: 700; overflow-wrap: anywhere; }
.consent-doc .nw { white-space: nowrap; }

.consent-doc .c-title {
  margin: 0 0 5px;
  font-size: 15px;
  letter-spacing: .03em;
  text-align: center;
  color: var(--sage-800);
}
.consent-doc .c-subtitle {
  margin: 0 0 10px;
  padding-bottom: 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #8a6a3b;
  border-bottom: 2px solid var(--peach-400);
}
.consent-doc .c-notice {
  margin: 0 0 14px;
  padding: 9px 14px;
  background: var(--sage-100);
  border-left: 5px solid var(--sage-600);
  border-radius: 12px;
  font-style: italic;
}
.consent-doc .c-notice p { margin: 0; }
.consent-doc .c-notice strong { font-style: normal; }
.consent-doc .c-pre { margin: 14px 0 4px; font-size: 13px; color: var(--sage-800); }
.consent-doc .c-section {
  margin: 18px 0 7px;
  padding-bottom: 4px;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--sage-800);
  border-bottom: 2px solid var(--peach-400);
}
.consent-doc .c-sub { margin: 12px 0 4px; font-size: 12px; color: var(--sage-700); }
.consent-doc .c-note { font-size: 11px; font-style: italic; color: var(--muted); text-align: left; }
.consent-doc .c-item { display: flex; gap: .6em; }
.consent-doc .c-lab { flex: 0 0 1.9em; font-weight: 700; color: var(--sage-800); }
.consent-doc .c-txt { flex: 1 1 auto; min-width: 0; }

.consent-doc .c-list { margin: 3px 0 10px; padding-left: 20px; }
.consent-doc .c-list li { margin: 3px 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.consent-doc .c-list li::marker { color: var(--sage-600); }

.consent-doc .c-domains {
  margin: 10px 0 14px;
  border: 1px solid var(--sage-200);
  border-radius: 14px;
  overflow: hidden;
}
.consent-doc .c-domains-head {
  margin: 0;
  padding: 9px 14px;
  background: var(--sage-800);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.consent-doc .c-domains .c-list { margin: 0; padding: 12px 18px 12px 40px; background: #fff; }

/* tlačidlo "☑ I AGREE" pod dokumentom (zamknuté, kým človek nedoskroluje na koniec) */
.consent-agree {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px 18px;
  font: inherit;
  text-align: center;
  color: #fff;
  background: var(--sage-800);
  border: 2px solid var(--sage-800);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(68, 88, 58, .30);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, opacity .15s;
}
.consent-agree:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(68, 88, 58, .38); }
.consent-agree:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent-agree:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.consent-agree .agree-title { display: block; font-size: 18px; font-weight: 800; letter-spacing: .06em; }
.consent-agree .agree-text { display: block; margin-top: 4px; font-size: 14px; font-style: italic; opacity: .92; }
.consent-agree .nw { white-space: nowrap; }
.consent-agree .c-check {
  display: inline-block;
  position: relative;
  width: 20px; height: 20px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid #fff;
  border-radius: 5px;
}
.consent-agree .c-check::after {
  content: "";
  position: absolute;
  left: 4px; top: 0;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* lokálne vývojové pomôcky (zobrazia sa len pri `npm run dev:nodb`) */
.dev-fill {
  position: fixed; left: 14px; bottom: 14px; z-index: 60;
  font: inherit; font-size: 13px; font-weight: 700;
  background: #2c3326; color: #fff; border: 0; border-radius: 10px;
  padding: 9px 14px; opacity: .85; cursor: pointer;
}
.dev-fill:hover { opacity: 1; }
.dev-note { margin-top: 14px; padding: 8px 12px; background: #fff6d9; border: 1px dashed #d4b24c; border-radius: 10px; font-size: 14px; }

/* nízke okná (menší notebook): menej "okolia", viac miesta pre text súhlasu */
@media (max-height: 720px) {
  .consent-card { min-height: 360px; padding-top: 16px; padding-bottom: 16px; }
  .consent-card .brand { padding-bottom: 8px; margin-bottom: 8px; }
  .consent-card .brand .brand-gbh { height: 40px; }
  .consent-card .brand .brand-icqaw { height: 26px; }
  .consent-hint { margin-top: 6px; font-size: 14.5px; }
  .consent-agree { padding: 8px 14px; margin-top: 8px; }
  .consent-agree .agree-title { font-size: 16px; }
  .consent-agree .agree-text { font-size: 12px; margin-top: 2px; }
}

@media (max-width: 560px) {
  #app { padding: 16px 12px 80px; }
  .card { padding: 22px 18px; }
  .q { padding: 20px 16px 22px; border-left-width: 6px; }
  .q.answered::after { top: 12px; right: 12px; }
  .brand .brand-gbh { height: 64px; }
  .brand .brand-icqaw { height: 40px; }
  .bar-logo { height: 32px; }
  .progress-inner { gap: 12px; padding: 8px 14px 8px 12px; }
  .scale .opt { flex-basis: 44px; padding: 10px 4px; }
  .q-image { height: 200px; }
  .q-text { font-size: 16px; }

  body.is-consent #app { padding-bottom: 16px; }
  .consent-card { height: calc(100vh - 32px); height: calc(100dvh - 32px); padding: 16px 14px 18px; }
  .consent-card .brand { padding-bottom: 10px; margin-bottom: 10px; gap: 10px 22px; }
  .consent-card .brand .brand-gbh { height: 42px; }
  .consent-card .brand .brand-icqaw { height: 28px; }
  .consent-scroll { padding: 16px 16px 22px; }
  .consent-doc { font-size: 11.5px; }
  .consent-doc p, .consent-doc .c-list li { text-align: left; hyphens: manual; -webkit-hyphens: manual; }
  .consent-doc .c-title { font-size: 14px; }
  .consent-agree { padding: 11px 12px; margin-top: 10px; }
  .consent-agree .agree-title { font-size: 16px; }
  .consent-agree .agree-text { font-size: 12.5px; }
  .consent-doc .c-domains .c-list { padding-left: 34px; }
}
