/* RZ Vision Screening — frontend, mobile-first, a11y-conscious. */
.rzv-app {
  --rzv-fg: #1a1a1a;
  --rzv-muted: #555;
  --rzv-bg: #fff;
  --rzv-accent: #1769aa;
  --rzv-accent-dark: #0f4c75;
  --rzv-border: #cfd8e3;
  --rzv-radius: 12px;
  --rzv-scale: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
  color: var(--rzv-fg);
  font-size: calc(17px * var(--rzv-scale));
  line-height: 1.55;
}
.rzv-app.rzv-zoom { --rzv-scale: 1.18; }

/* Defensywny reset — styl motywu strony nie może rozdmuchać czcionek ani
   rozjechać układu testu (różne motywy mają duże h2/h3/img/blockquote). */
.rzv-app, .rzv-app * { box-sizing: border-box; }
.rzv-app img { max-width: 100%; height: auto; }
.rzv-app h2, .rzv-app h3 { line-height: 1.22; font-weight: 700; color: var(--rzv-fg); padding: 0; }
.rzv-app p, .rzv-app ul, .rzv-app ol, .rzv-app blockquote { margin: 0 0 8px; }
.rzv-app blockquote { padding-left: 12px; }
.rzv-app small { font-size: .82em; }

/* Hero — czysta, mobilna karta pierwszego ekranu */
.rzv-hero {
  text-align: center;
  margin: 0 0 16px;
  padding: 20px 16px;
  background: linear-gradient(180deg, #f4f9fd 0%, #ffffff 100%);
  border: 1px solid var(--rzv-border);
  border-radius: var(--rzv-radius);
}
.rzv-logo { display: block; max-height: 64px; max-width: 72%; width: auto; height: auto; margin: 0 auto 12px; object-fit: contain; }
.rzv-title { font-size: 1.45em; line-height: 1.2; margin: 0 0 6px; }
.rzv-lead { color: var(--rzv-muted); font-size: 1em; margin: 0 auto 8px; max-width: 32em; }
.rzv-signature, .rzv-counter { color: var(--rzv-muted); font-size: .82em; margin: 2px 0; }
.rzv-facts { font-size: .82em; color: var(--rzv-accent-dark); font-weight: 600; margin: 8px 0 0; }
.rzv-badges { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.rzv-badges li { background: #eaf3fb; color: var(--rzv-accent-dark); border-radius: 999px; padding: 2px 10px; font-size: .78em; }
.rzv-testimonial { font-style: italic; color: var(--rzv-muted); border-left: 3px solid var(--rzv-border); margin: 10px auto 0; padding: 4px 12px; max-width: 92%; font-size: .9em; }
.rzv-trust-links { margin: 8px 0 0; }
.rzv-trust-links a { color: var(--rzv-accent); margin: 0 6px; font-size: .82em; }

.rzv-disclaimer {
  background: #f3f6fb;
  border: 1px solid var(--rzv-border);
  border-radius: var(--rzv-radius);
  padding: 12px 14px;
  font-size: .9em;
  color: var(--rzv-muted);
  margin-bottom: 18px;
}

.rzv-progress {
  height: 12px;
  background: #e6ebf2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.rzv-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rzv-accent), #3a9bd9);
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.rzv-progress__label {
  font-size: .9em;
  font-weight: 600;
  color: var(--rzv-accent-dark);
  margin: 0 0 16px;
  text-align: center;
}

.rzv-section { margin: 14px 0 6px; font-size: 1.05em; }

.rzv-q {
  border: 1px solid var(--rzv-border);
  border-radius: var(--rzv-radius);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.rzv-q--flag { border-color: #e0b400; background: #fffdf3; }
.rzv-q__label { font-weight: 600; padding: 0; }
.rzv-q__help { color: var(--rzv-muted); font-size: .85em; margin: 3px 0 6px; line-height: 1.4; }

.rzv-options { display: grid; gap: 8px; margin-top: 10px; }
.rzv-options--inline { grid-template-columns: 1fr 1fr; }

.rzv-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--rzv-border);
  border-radius: 10px;
  cursor: pointer;
}
.rzv-option:hover { border-color: var(--rzv-accent); }
.rzv-option input { width: 20px; height: 20px; accent-color: var(--rzv-accent); }
.rzv-option:has(input:checked) {
  border-color: var(--rzv-accent);
  background: #eaf3fb;
}

.rzv-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.rzv-btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.rzv-btn--primary { background: var(--rzv-accent); color: #fff; }
.rzv-btn--primary:hover { background: var(--rzv-accent-dark); }
.rzv-btn--ghost { background: transparent; border: 1px solid var(--rzv-border); color: var(--rzv-fg); }

.rzv-field { display: block; margin: 0 0 12px; }
.rzv-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.rzv-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--rzv-border);
  border-radius: 10px;
  font-size: 1em;
  box-sizing: border-box;
}
.rzv-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: .92em; }
.rzv-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rzv-accent); }

.rzv-field-error { color: #b00020; font-size: .85em; display: block; margin-top: 4px; }

.rzv-cta { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rzv-border); }
.rzv-cta__hint { color: var(--rzv-muted); font-size: .88em; }
.rzv-incentive {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: #eaf3fb;
  border-left: 4px solid var(--rzv-accent);
  border-radius: 0 10px 10px 0;
}
.rzv-incentive__icon { font-size: 1.6em; line-height: 1; }
.rzv-incentive__text { font-size: .95em; line-height: 1.45; color: var(--rzv-fg); }
.rzv-incentive__text small { color: var(--rzv-muted); display: inline-block; margin-top: 4px; }

.rzv-result {
  border: 1px solid var(--rzv-border);
  border-left-width: 6px;
  border-radius: var(--rzv-radius);
  padding: 18px 20px;
}
.rzv-result__title { margin: 0 0 8px; }
.rzv-result__reco { margin: 12px 0; }
.rzv-result__disclaimer { color: var(--rzv-muted); font-size: .82em; margin-top: 14px; }
.rzv-result--low { border-left-color: #2e7d32; }
.rzv-result--control { border-left-color: #6a9c00; }
.rzv-result--optometric { border-left-color: #c79100; }
.rzv-result--high { border-left-color: #e65100; }
.rzv-result--priority, .rzv-result--urgent { border-left-color: #b00020; background: #fff5f6; }

.rzv-signals ul { margin: 6px 0 0; padding-left: 20px; }

.rzv-alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .92em;
}
.rzv-alert--error { background: #fdecef; border: 1px solid #f3b6c0; color: #b00020; }
.rzv-alert--notice { background: #e9f6ec; border: 1px solid #b6dcc0; color: #1e5631; }

.rzv-zoom-toggle {
  position: sticky;
  top: 8px;
  margin-left: auto;
  display: block;
  width: fit-content;
  margin-bottom: 8px;
}

*:focus-visible { outline: 2px solid var(--rzv-accent-dark); outline-offset: 2px; }

/* Preferred-time pick lists */
.rzv-pref { display: flex; gap: 8px; flex-wrap: wrap; }
.rzv-pref__sel {
  flex: 1 1 30%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--rzv-border);
  border-radius: 10px;
  font-size: .95em;
  background: #fff;
}

/* Consents — three checkboxes of identical size (shared profile) */
.rzv-consents { margin: 8px 0; }
.rzv-consent { margin: 0 0 10px; }
.rzv-consent .rzv-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.rzv-consent .rzv-check input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 1px 0 0;
  box-sizing: border-box;
  accent-color: var(--rzv-accent);
}
.rzv-consent__more { margin: 2px 0 0 32px; }
.rzv-consent__more summary { cursor: pointer; color: var(--rzv-accent); font-size: .82em; list-style: revert; }
.rzv-consent__full {
  max-height: 160px;
  overflow: auto;
  font-size: .8em;
  line-height: 1.4;
  color: var(--rzv-muted);
  background: #f7f9fc;
  border: 1px solid var(--rzv-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}

/* Wizard */
.rzv-step--js { display: none; } /* shown by JS only */
.rzv-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 0;
  background: linear-gradient(to top, var(--rzv-bg) 70%, rgba(255,255,255,0));
}
.rzv-nav .rzv-btn { flex: 1 1 auto; }
.rzv-btn--choice {
  background: #fff;
  border: 2px solid var(--rzv-border);
  color: var(--rzv-fg);
  text-align: left;
}
.rzv-btn--choice.is-sel { border-color: var(--rzv-accent); background: #eaf3fb; }
.rzv-test-options { display: grid; gap: 8px; margin-top: 12px; }
.rzv-test-q { font-weight: 600; font-size: .9em; margin: 8px 0 0; }
.rzv-eye-instr { background: #f7f9fc; border: 1px solid var(--rzv-border); border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; font-size: .9em; }
.rzv-eye-instr p { margin: 3px 0; line-height: 1.4; }
.rzv-eye-steps { margin: 4px 0 2px 16px; padding: 0; }
.rzv-eye-steps li { margin: 2px 0; line-height: 1.35; }
.rzv-eye-pick { background: #eaf3fb; border-left: 3px solid var(--rzv-accent); padding: 5px 9px; margin-top: 6px; border-radius: 0 6px 6px 0; }

.rzv-option--path { align-items: flex-start; padding: 14px 16px; }
.rzv-option--path small { color: var(--rzv-muted); display: block; margin-top: 2px; line-height: 1.4; }
.rzv-option--rec { border-color: var(--rzv-accent); background: #f4f9fd; }
.rzv-rec-badge {
  display: inline-block;
  background: var(--rzv-accent);
  color: #fff;
  font-size: .75em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}
/* Color (Ishihara) + visual field tests */
.rzv-ishihara { background: #fff; }
.rzv-field-area svg { max-width: 100%; }
.rzv-field-done { font-weight: 600; text-align: center; padding: 10px; background: #eaf3fb; border-radius: 8px; line-height: 1.45; font-size: .95em; }
.rzv-field-phase { text-align: center; font-size: .92em; margin: 6px 0; padding: 5px 9px; background: #fff5e6; border-left: 4px solid #e65100; border-radius: 0 6px 6px 0; }
.rzv-field-pause { text-align: center; padding: 12px; background: #fff5e6; border: 2px dashed #e65100; border-radius: 10px; font-size: .9em; }
.rzv-field-miss-hint { display: inline-block; margin-top: 4px; color: #b00020; }
.rzv-btn--miss { background: #b00020 !important; color: #fff !important; border-color: #b00020 !important; font-weight: 700; }
.rzv-btn--miss.is-sel { background: #800015 !important; }
.rzv-field-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) {
  .rzv-field-options { grid-template-columns: 1fr 1fr; }
  .rzv-field-options .rzv-btn--miss { grid-column: 1 / -1; }
}

.rzv-alert--top { font-size: 1.05em; }

.rzv-rf-note { margin-top: 12px; }

/* On-screen tests */
.rzv-optotype-row {
  font-family: "Courier New", monospace;
  font-weight: 700;
  letter-spacing: .25em;
  text-align: center;
  line-height: 1.4;
  margin: 6px 0;
  color: #000;
}
.rzv-svg { display: block; margin: 12px auto; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--rzv-border); border-radius: 8px; }
/* Vertical card calibration — measures the short edge of the card. */
.rzv-cal-vert {
  position: relative;
  width: 120px;
  margin: 14px auto;
}
.rzv-cal-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #111;
  transform: translateX(-50%);
}
.rzv-cal-cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 38px; /* ~1 cm pomocniczy wąs */
  height: 2px;
  background: #111;
}
.rzv-cal-cap--top { top: 0; }
.rzv-cal-cap--bottom { bottom: 0; }
/* Suwak kalibracji na ciemnym pasku — biały suwak na białym tle był niewidoczny. */
.rzv-cal-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 38px;
  margin: 12px 0;
  padding: 0 12px;
  background: #1d2b3a;
  border-radius: 10px;
  cursor: pointer;
}
.rzv-cal-range:focus { outline: 2px solid var(--rzv-accent); outline-offset: 2px; }
.rzv-cal-range::-webkit-slider-runnable-track { height: 6px; background: #cfe0f0; border-radius: 999px; }
.rzv-cal-range::-moz-range-track { height: 6px; background: #cfe0f0; border-radius: 999px; }
.rzv-cal-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #ffd34d; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer; }
.rzv-cal-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #ffd34d; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer; }
.rzv-cal-label { display: block; font-weight: 600; margin-top: 8px; }

@media (max-width: 480px) {
  .rzv-app { padding: 12px; font-size: calc(18px * var(--rzv-scale)); }
  .rzv-options--inline { grid-template-columns: 1fr; }
  .rzv-title { font-size: 1.35em; }
  .rzv-option { padding: 12px 14px; min-height: 48px; }
  .rzv-btn { width: 100%; }
  .rzv-actions { flex-direction: column; }

  /* Przyciski odpowiedzi w testach ekranowych zawsze pod kciukiem:
     przypięte do dołu ekranu, gdy treść nad nimi jest wysoka. */
  .rzv-test-options, .rzv-field-options, .rzv-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: linear-gradient(to top, var(--rzv-bg) 80%, rgba(255,255,255,0));
    padding: 10px 0 8px;
    margin-top: 4px;
  }
  /* Mniej pustego miejsca u góry kroku → przyciski bliżej widoku. */
  .rzv-section { margin: 8px 0 6px; }
  .rzv-eye-instr { margin: 4px 0 8px; }
  /* Plansza pola widzenia (nie wymaga kalibracji) — ogranicz wysokość, by
     instrukcja + plansza + przyciski mieściły się bez przewijania. */
  .rzv-svg.rzv-field { max-height: 34vh; }
}
