/* =========================================================
   ROOT / KOLORY
========================================================= */
:root {
  --primary: #1d4ed8;
  --primary-soft: rgba(29,78,216,.15);
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --success: #198754;
  --border: #c7cdd8;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f4f6fb;
  --card: #ffffff;
}

/* =========================================================
   RESET
========================================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}


/* =========================================================
   LAYOUT
========================================================= */
.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 32px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.progress {
  height: 11px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,#198754,#1eb94d);
  transition: width .5s ease;
}

.step { display: none !important; }
.step.active {
  display: block !important;
  animation: fadeIn .25s ease;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.row {
  display: flex;
  gap: 32px;
}

.col { flex: 1; }

/* =========================================================
   HEADINGS
========================================================= */
h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--muted);
}

.hint {
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
  margin: 0px 7px 11px 0px;	 
}

/* =========================================================
   FIELD
========================================================= */
.field {
  position: relative;
  margin-bottom: 18px;
}

/* =========================================================
   INPUTY
========================================================= */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  width: 100%;
  height: 56px;
  padding: 16px 18px;
  font-size: 17px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f1f6ff;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input::placeholder { color: transparent; }


input:focus,
select:focus,
textarea:focus {
  font-weight: 600;
}



input:focus,
select:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* =========================================================
   FLOATING LABEL
========================================================= */
.field.floating input {
  padding: 26px 44px 8px 48px;
}

.field.floating label {
  position: absolute;
  left: 48px;
  top: 18px;
  font-size: 15px;
  color: var(--muted);
  pointer-events: none;
  transition: all .2s ease;
}

.field.floating input:focus + label,
.field.floating input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 12px;
  color: var(--primary);
}

/* =========================================================
   IKONY
========================================================= */
.field.icon::before {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 18px;
  opacity: .6;
  pointer-events: none;
}
/* .field.icon.name::before    { mask-image: url("./icons/name.svg"); } */
.field.icon.name::before { content: "👤"; }
.field.icon.surname::before { content: "🧑‍💼"; }
.field.icon.pesel::before { content: "🆔"; }
.field.icon.phone::before { content: "📞"; }

/* =========================================================
   RADIO / CHECKBOX – POPRAWIONY LAYOUT
========================================================= */

.radio-group, 
.check-group {
    display: grid;
    grid-template-columns: repeat(2, max-content);  /* max 2 kolumny do pokazania */
    column-gap: 61px;
    row-gap: 5px;
    margin-top: 24px;
}


/* ⬇️ KLUCZOWE – label NIE rozciąga się na całą kolumnę */
.radio-group label,
.check-group label {
  display: inline-flex;            /* zamiast flex */
  align-items: center;
  gap: 10px;

  justify-self: start;             /* 🔑 ogranicza szerokość */
  width: fit-content;              /* 🔑 tło tylko pod treścią */

  min-height: 44px;                /* równa wysokość wizualna */
  padding: 6px 12px;

  border-radius: 10px;
  cursor: pointer;

  transition: background .15s ease;
}

/* input radio / checkbox */
.radio-group input,
.check-group input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

/* zaznaczona odpowiedź */
.radio-group label:has(input:checked),
.check-group label:has(input:checked) {
  background: #eef2ff;
  font-weight: 600;
  color: #1e3a8a;
}


/* =========================================================
   PANELE WARUNKOWE
========================================================= */
.right-panel {
  border-left: 2px dashed var(--border);
  padding: 10px 10px 0px 10px;
  background: #fafbff;
  border-radius: 12px;
}

/* =========================================================
   ERROR
========================================================= */
.error {
  display: none;
  margin-top: 6px;
  font-weight: 600;
  padding: 10px 12px 10px 36px;
  font-size: 15px;
  color: var(--danger);
  position: relative;
}

.error.show { display: block; }

.error::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-color: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* =========================================================
   RANGE OK
========================================================= */
.range-ok {
  display: none;
  font-weight: 600;
  margin-top: 6px;
  padding: 10px 12px 10px 36px;
  font-size: 18px;
  color: var(--success);
  position: relative;
}

.range-ok::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  
}

/* =========================================================
   ACTIONS
========================================================= */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

button {
  padding: 14px 26px;
  font-size: 15px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}

.actions button {
  min-width: 140px;
}


button.secondary {
  background: #6b7280;
}

button.login {
  background: #47735f;
}

button.secondary:hover {
  background: #4b5563;
}

/* =========================================================
   RANGE
========================================================= */
.anthro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
}

.range-field input[type="range"] {
  width: 100%;
  margin: 8px 0 10px;
}

.range-readout span {
  font-size: 24px;
  color: #0ea5e9;
}



@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes pop {
  0% { transform: scale(.95); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.range-field.shake .error { animation: shake .35s; }
.range-field.pop .range-ok { animation: pop .35s; }

/* =========================================================
   SUCCESS
========================================================= */
.success {
  text-align: center;
  padding: 60px 20px;
}

.success h3 {
  font-size: 22px;
  color: var(--success);
}

/* =========================================================
   UTILS / MOBILE
========================================================= */
.hidden {
  display: none !important;
}



@media (max-width: 900px) {
  .row { flex-direction: column; }
  .right-panel { border-left: none; padding-left: 0; margin-top: 20px; }
  .anthro-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   RADIO – WYRÓŻNIENIE ZAZNACZONEJ ODPOWIEDZI
========================================================= */

.radio-group label:has(input:checked) {
  background: #eef2ff;
  font-weight: 600;
  color: #1e3a8a;
}

/* =========================================================
   LICZNIK KROKU (np. Strona 2 z 12)
========================================================= */
.step-counter {
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--muted);
}

/* =========================================================
   STEP BADGE (To jest X strona z Y do wypełnienia)
========================================================= */
.step-badge {
    display: inline-block;
    margin: 8px auto;
    padding: 8px 18px;
    background: #6f9f8f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    white-space: nowrap;
    text-align: center;
}

.actions button:first-child {
  justify-self: start;
}

.actions button:last-child {
  justify-self: end;
}

/* =========================================================
   WALIDACJA – INPUT
========================================================= */
.field.valid input,
.field.valid select {
  border-color: var(--success);
  background: #ecfdf5;
}

.field.invalid input,
.field.invalid select {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* =========================================================
   IKONA ✔ / ✖ (TYLKO FLOATING)
========================================================= */
.field.floating.valid::after,
.field.floating.invalid::after {
  position: absolute;
  right: 16px;
  top: 18px;
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
}

.field.floating.valid::after {
  content: "✔";
  color: var(--success);
}

.field.floating.invalid::after {
  content: "✖";
  color: var(--danger);
}


/* =========================================================
   HINT
========================================================= */
.field .hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   STEP BADGE – MOBILE FIX
========================================================= */


@media (max-width: 900px) {
  .actions {
    flex-wrap: wrap;
    gap: 14px;
  }

  .actions button {
    flex: 0 0 auto;
  }

  .step-badge {
    order: 3; /* zawsze pod przyciskami */
    width: 100%;
    margin-top: 8px; /* Uproszczenie */
    text-align: center;
  }
  
}


.error.show { 
  display: block; /* Wyświetla błąd, gdy jest dodana klasa .show */
}

.error::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("../icons/error-triangle.svg") no-repeat center / contain;
  -webkit-mask: url("../icons/error-triangle.svg") no-repeat center / contain;
}

/* =========================================================
   PODŚWIETLENIE POLA PRZY SCROLLU DO BŁĘDU
========================================================= */
.field.scroll-highlight {
  animation: highlightField 1.4s ease;
}

@keyframes highlightField {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
  30% {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.field:has(
  input[name="first_name"],
  input[name="last_name"],
  input[name="password"],
  input[name="pesel"],
  input[name="phone"],
  input[name="email"]
).scroll-highlight {
  animation: none !important;
  box-shadow: none !important;
}


/* =========================================================
   FONT DLA LICZB (PESEL, TELEFON, RANGE, NUMERY)
========================================================= */

/* inputy stricte liczbowe */
input[type="number"],
input[type="tel"],
.range-number,
.range-readout span {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* PESEL i telefon – jeszcze czytelniejsze */
.field.icon.pesel input,
.field.icon.phone input {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* przy focusie lekko mocniej */
.field.icon.pesel input:focus,
.field.icon.phone input:focus {
  font-weight: 600;
}

/* =========================================================
   RANGE – LOGIKA WYŚWIETLANIA ERROR / OK
========================================================= */
.range-field.invalid .error {
  display: block;
}

.range-field.valid .range-ok {
  display: block;
}


/* =========================================================
   PROGRESS – OPIS PROCENTOWY
========================================================= */
.progress {
  position: relative;
}

.progress-percent {
  margin-top: 0px;
  font-size: 17px;
  font-weight: 500;
  color: #374151;
  text-align: right;
  letter-spacing: 0.02em;
}

/* liczby wyróżnione */
.progress-percent strong {
  font-weight: 700;
  color: #1d4ed8;
}

/* kropka-separator */
.progress-percent strong + strong {
  color: #0f766e;
}

/* mobile */
@media (max-width: 600px) {
  .progress-percent {
    text-align: center;
    font-size: 13px;
  }
}

/* =========================================================
   PROGRESS – BUŹKA
========================================================= */
.progress-smile {
  display: inline-block;
  margin-left: 4px;
  font-size: 16px;
  transform: translateY(1px);
  opacity: 0.9;
}

/* delikatna animacja po zmianie kroku */
.progress-smile {
  animation: smilePop .35s ease;
}

@keyframes smilePop {
  0%   { transform: scale(.8); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.separate {
  border-top: 1px solid #e5e7eb;
}

label {
	font-weight: 500;
}

.reset-btn {
  margin-top: 20px;
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.reset-btn:hover {
  background: #fecaca;
}


/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: modalIn .25s ease-out;
}

.modal h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #223c61;
}

.modal p {
  font-size: 15px;
  line-height: 1.5;
  color: #444;
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-actions .secondary {
  background: #e6eaf1;
  color: #223c61;
}

.modal-actions .danger {
  background: #c0392b;
  color: #fff;
}

.modal-actions button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions button:hover {
  opacity: 0.9;
}

.overlay.hidden {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999; /* 🔥 ponad wszystko */
}

.modal-box {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}


@keyframes modalIn {
  from {
    transform: scale(.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* =========================================================
   WALIDACJA RANGE – RAMKA JAK DLA INNYCH POL
========================================================= */


@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.error.shake {
  animation: shake 0.35s ease;
}

/* ===== PRAWA KOLUMNA – WYSUWANIE ===== */
#smokingDetails {
  transform: translateX(40px);
  opacity: 0;
  transition:
    transform 0.45s ease,
    opacity 0.35s ease;
  will-change: transform, opacity;
}

/* stan widoczny */
#smokingDetails.show {
  transform: translateX(0);
  opacity: 1;
}

/* hidden nie używa display:none (bo zabija animację) */
#smokingDetails.hidden {
  visibility: hidden;
  pointer-events: none;
  
  
}

.right-panel {
  transform: translateX(40px);
  opacity: 0;
  transition:
    transform 0.45s ease,
    opacity 0.35s ease;
}

.right-panel.show {
  transform: translateX(0);
  opacity: 1;
}

.right-panel.hidden {
  display: none;
}



/* =========================================================
   TOP NAVIGATION
========================================================= */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 20px;
  margin-bottom: 12px;

  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.top-nav-left .brand {
  font-weight: 700;
  font-size: 18px;
  color: #1f2937;
  text-decoration: none;
}

.top-nav-right {
  display: flex;
  gap: 12px;
}

.link-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
}

.link-btn:hover {
  text-decoration: none;
}

.link-btn.primary {
  font-weight: 600;
  color: #2563eb;
}

@media (max-width: 640px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .top-nav-right {
    width: 100%;
    justify-content: flex-end;
  }
}

.progress-wrapper {
  margin-bottom: 16px;
}


.progress-percent {
  margin-top: 6px;
  text-align: right;   /* 👈 PRAWA STRONA */
  font-size: 14px;
  color: #374151;
}

#stepBadgeContainer {
  display: flex;
  justify-content: center;
}

/* =========================================================
   SELECT – DOSTOSOWANIE DO ISTNIEJĄCEGO CSS
========================================================= */

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 56px;
  padding: 16px 48px 16px 18px;

  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;

  color: var(--text);
  background-color: #f1f6ff;

  border: 1px solid var(--border);
  border-radius: 8px;

  cursor: pointer;

  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

/* STRZAŁKA */
select {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

/* PLACEHOLDER (— wybierz —) */
select:has(option[value=""]:checked) {
  color: var(--muted);
  font-weight: 400;
}

/* HOVER */
select:hover {
  background-color: #ffffff;
}

/* FOCUS – IDENTYCZNY JAK INPUT */
select:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  font-weight: 600;
}

/* WALIDACJA – SPÓJNA Z INPUTAMI */
.field.valid select {
  border-color: var(--success);
  background: #ecfdf5;
}

.field.invalid select {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* DISABLED */
select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* =========================================================
   LABEL – LEKKI ODSTĘP OD POLA
========================================================= */

.field > label {
  display: block;
  margin-bottom: 10px;
}


/* =========================================================
   TYPOGRAFIA PYTAŃ I ODPOWIEDZI (HIERARCHIA)
========================================================= */

/* Tytuł sekcji – np. "8. Palenie tytoniu" */
.step h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
  color: #223c61;
}

/* Pytania – np. "8.1 Czy obecnie palisz..." */
.field > label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #223c61;
  margin-bottom: 10px;
  line-height: 1.45;
}

/* Grupa odpowiedzi */
.radio-group {
  margin-top: 6px;
}

/* Odpowiedzi – "Tak / Nie / ..." */
.radio-group label {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
}

/* Zaznaczona odpowiedź */
.radio-group label:has(input:checked) {
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 600;
}

/* Odstęp między pytaniami */
.step .field {
  margin-bottom: 26px;
}

/* =========================================================
   PODSUMOWANIE – ZGODY (WERSJA LEKKA / FORMULARZOWA)
========================================================= */

.consent-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;

  display: block;            /* ⬅️ NIE grid, NIE flex */
}

/* checkbox + tekst w jednej linii */
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}

/* sam checkbox */
.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* gwiazdka */
.req {
  color: #dc2626;
  margin-left: 4px;
}

/* tekst prawny pod spodem */
.consent-text {
  margin-top: 6px;
  margin-left: 28px;

  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;

  white-space: normal;
  word-break: break-word;
}

/* MARKETING – delikatniejszy */
.consent-box:not(.required) {
  background: #fbfbfd;
}

/* CAPTCHA */
.captcha-box {
  margin-top: 20px;
}

.captcha-box label {
  font-weight: 600;
}


.field.check-group.required {
  border-left: 4px solid #2563eb;
  padding-left: 16px;
}

/* =========================================================
   MOBILE – 1 KOLUMNA (NAPRAWIA ROZJEŻDŻANIE)
========================================================= */
@media (max-width: 640px) {
  .radio-group,
  .check-group {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .radio-group label,
  .check-group label {
    width: 100%;
  }
}

@keyframes okShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
}

.range-ok.shake {
  animation: okShake 0.3s ease;
}




.progress-wrapper {
  position: sticky;
  top: 56px; /* dokładna wysokość .top-nav */

  z-index: 100;
  background: #ffffff;

  padding: 8px 20px 12px;
  border-bottom: 1px solid #e5e7eb;
}


.progress {
  height: 10px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #198754, #1eb94d);
  transition: width 0.4s ease;
}

@media (max-width: 640px) {
  .progress-wrapper {
    top: 72px; /* navbar jest wyższy na mobile */
  }
}


.user-info {
  margin: 0 10px;
  font-weight: 600;
  color: #1f2937;
}

/* ================= LOGIN MODAL ================= */

.modal-login {
  max-width: 420px;
  padding: 32px;
  position: relative;
}

.modal-login h3 {
  margin: 0 0 8px;
  font-size: 22px;
  text-align: center;
}

.modal-subtitle {
  text-align: center;
  color: #6b7280;
  margin-bottom: 20px;
  font-size: 14px;
}

.modal-form .field {
  margin-bottom: 16px;
}

.modal-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
}

.modal-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(29,78,216,.15);
}

.modal-login .full {
  width: 100%;
  margin-top: 10px;
}

.modal-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}

.modal-close:hover {
  color: #000;
}

@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-6px); }
  80%  { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

.modal.shake {
  animation: shake 0.35s ease;
}

.modal-form .field.invalid input {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* ===== LOGIN SUCCESS ===== */
.login-success {
  padding: 28px 20px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;

  color: #166534;               /* zielony tekst */
  background: #ecfdf5;          /* jasna zieleń */
  border-radius: 12px;

  animation: loginPop 0.45s ease;
}

/* subtelna animacja */
@keyframes loginPop {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}


/* ================= LOGIN BUTTON LOADER ================= */
.login-btn {
  position: relative;
}

.login-btn.loading .btn-text {
  visibility: hidden;
}

.login-btn.loading .btn-loader {
  display: inline-block;
}

.btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


body.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}


.login-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #16a34a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
  animation: toastIn .35s ease;
  z-index: 9999;
}

.login-toast.hidden {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


/* ===== TOAST / SYSTEM KOMUNIKATÓW ===== */

.toast-stack {
  position: fixed;
  left: 90%;
  bottom: 11px;
  transform: translateX(-50%);
  z-index: 10000;

  display: flex;
  flex-direction: column;
  gap: 12px;

  pointer-events: none;
}

/* pojedynczy toast */
.toast {
  min-width: 260px;
  max-width: 360px;

  padding: 16px 18px 20px;
  border-radius: 10px 10px 10px 0px;

  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: center;

  box-shadow: 0 14px 34px rgba(0,0,0,.28);

  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: auto;

  transition:
    opacity .45s ease,
    transform .55s cubic-bezier(.22,.61,.36,1);
}

/* wejście */
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* wyjście */
.toast.hide {
  opacity: 0;
  transform: translateY(14px) scale(0.95);
}

/* warianty */
.toast.success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.toast.info {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.toast.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* pasek czasu */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;

  background: rgba(255,255,255,0.77);
  border-radius: 0px 14px 14px 0px;

  transform-origin: left;
  transform: scaleX(1);
}

.toast-progress.run {
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* mobile */
@media (max-width: 840px) {
  .toast-stack {
    bottom: 45px;
    left: 50%;
    width: calc(100% - 32px);
  }
}






/* =========================================================
   TOP NAV – PANEL STYLE
========================================================= */

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 101;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 20px;

  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
    border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}


/* MOBILE (max 600px) */ @media (max-width: 600px) { .nav-right { flex-direction: column; /* układ pionowy */ align-items: flex-start; /* wyrównanie do lewej */ gap: 6px; /* mniejsze odstępy */ } }


/* ===== LEFT ===== */
.nav-left {
  display: flex; 
  align-items: center;
  gap: 31px;
}

.nav-brand {
  font-size: 21px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
  white-space: nowrap;
}

/* ===== RIGHT ===== */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== BUTTONS ===== */
.nav-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  transition:
    background .15s ease,
    color .15s ease,
    box-shadow .15s ease;
}

/* variants */
.nav-btn.primary {
  background: #2563eb;
  color: #ffffff;
}

.nav-btn.primary:hover {
  background: #1d4ed8;
}

.nav-btn.ghost {
  background: #f1f5f9;
  color: #1f2937;
}

.nav-btn.ghost:hover {
  background: #e5e7eb;
}

.nav-btn.danger {
  background: #fee2e2;
  color: #7f1d1d;
}

.nav-btn.danger:hover {
  background: #fecaca;
}

/* ===== USER ===== */
.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 10px;
  border-radius: 999px;

  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.nav-user .avatar {
  font-size: 16px;
}

.nav-user .login {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

/* ===== MOBILE ===== */
@media (max-width: 350px) {
  .top-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  

  .nav-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

.nav-counter {
  font-size: 14px;
  color: #374151;
  margin-left: 12px;
  white-space: nowrap;
}

.nav-counter strong {
  font-size: 16px;
  color: #2563eb;
  font-weight: 700;
  display: inline-block;
  min-width: 24px;
  text-align: center;
}




@media (max-width: 768px) {

  .nav-counter {
    width: 100%;
    text-align: center;
    font-size: 12px;          /* 👈 mniejsza czcionka */
    margin: 6px 0 10px;       /* 👈 ODSTĘP od progress */
    line-height: 1.4;
  }

  .nav-counter strong {
    font-size: 13px;
  }

  /* 🔹 oddech między licznikiem a procentami */
  .progress-wrapper {
    margin-top: 4px;
  }
}

.survey-summary {
  max-width: 720px;
  margin: 48px auto;
  padding: 32px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  font-family: 'Inter', system-ui, sans-serif;
  color: #374151;
  text-align: center;
}

.survey-summary h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1f4e5f;
  margin-bottom: 18px;
}

.survey-summary em {
  font-style: normal;
    color: #1d4ed8;
   font-weight: 700;
}

.summary-success {
  font-size: 18px;
  margin-bottom: 16px;
}

.summary-success strong {
  color: #198754;
  font-size: 20px;
}

.survey-summary p {
  font-size: 15px;
  line-height: 1.65;
  margin: 12px 0;
}

.summary-contact {
  margin-top: 22px;
  padding: 16px 18px;
  background: #f0f8fa;
  border-left: 4px solid #1f4e5f;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
}

.summary-contact a {
  color: #1d4ed8;
  text-decoration: none;
}

.summary-contact {
  display: grid;
  gap: 6px;
}
.summary-contact strong {
  color: #0f3f4a;
}

.summary-contact p {
  font-size: 15px;
  line-height: 1px;
}


.summary-footer {
  margin-top: 26px;
  font-size: 17px;
  color: #1f4e5f;
}

.summary-hours {
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
}

.summary-actions {
  margin-top: 30px;
}

.summary-btn {
  display: inline-block;
  margin-top: 8px;
  background: #1d4ed8;
  color: #fff;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}

.summary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.3);
}

.summary-check {
  font-size: 15px;
  color: #22c55e;
  margin-bottom: 8px;
}


/* MOBILE */
@media (max-width: 600px) {
  .survey-summary {
    margin: 24px 14px;
    padding: 22px;
  }

  .survey-summary h1 {
    font-size: 19px;
  }

  .summary-contact {
    font-size: 13px;
  }
}

/* 🔢 NUMER ANKIETY */
.summary-id {
  text-align: center;
  margin: 12px 0 18px;
  font-size: 16px;
  color: #4b5563;
}

.summary-id strong {
  font-size: 20px;
  color: #1d4ed8;
}

/* =========================================================
   PODSUMOWANIE – ANIMACJA WEJŚCIA
========================================================= */

.final-summary {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}

.final-summary.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* małe podbicie numeru ankiety */
.final-summary.show .summary-id strong {
  display: inline-block;
  animation: pop 0.45s ease 0.25s both;
}


@keyframes pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.final-summary.show {
  animation: glow 0.6s ease;
}

@keyframes glow {
  0%   { box-shadow: 0 0 0 rgba(0,0,0,0); }
  100% { box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
}

.counter-bump {
  animation: bump 0.4s ease;
}

@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}



.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.badge-id {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
}

.badge-id.position {
  background: #a0c1b9;
  color: #3c443f;
}

.badge-id.details {
  background: #82a3c1;
  color: #ffffff;
}

.badge.pending {
  background: #fde68a;
  color: #92400e;
}

.badge.done {
  background: #bbf7d0;
  color: #166534;
}





/* ===== AKCJE ===== */
.panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-actions button {
    min-width: 64px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 12px;

  font-size: 11px;
  font-weight: 600;
  line-height: 1;

  border-radius: 7px;
  border: none;
  background: none;

  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background .2s ease,
    color .2s ease,
    box-shadow .2s ease,
    transform .18s ease;
}

.link-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.link-btn:hover {
  transform: translateY(-1px);
}

/* Warianty */
.link-btn.success {
  background: #47735f;
  color: #fff;
}

.link-btn.warning {
  background: #dd0909;
  color: #fff;
}

.link-btn.info {
  background: #098fdd;
  color: #fff;
}



.survey-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}

.survey-table thead {
  background: #145ba3;
}


.survey-table th,
.survey-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.survey-table th {
  background: rgb(255 255 255 / 39%);
  font-weight: 600;
}


.survey-table tbody tr {
  border-top: 1px solid #e5e7eb;
}

.survey-table tbody tr:hover {
  background: #f9fafb;
}



/* akcje */
.panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}


@media (max-width: 1000px) {

  .survey-table thead {
    display: none;
  }

  .survey-table,
  .survey-table tbody,
  .survey-table tr {
    display: block;
    width: 100%;
  }

  .survey-table tr {
    margin-bottom: 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    padding: 12px;
  }

  .survey-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px;
    border: none;
    font-size: 14px;
  }

  .survey-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
  }

  .panel-actions {
    justify-content: flex-end;
    margin-top: 8px;
  }
}











.card {
  background: var(--card);
  padding: 20px;
  border-radius: 10px;
}


.survey-details h3 {
  margin-top: 32px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 6px;
}

.detail-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}

.detail-row .label {
  font-weight: 600;
  color: #374151;
}

.detail-row .value {
  color: #111827;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-meta {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: #555;
}


.pagination {
  display: flex;
  flex-wrap: nowrap;          /* 🔥 NIE ZAWIJA */
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  overflow-x: auto;           /* awaryjnie mobile */
}

.pagination .page {
  min-width: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  background: #f1f5f9;
  color: #334155;
  text-decoration: none;
  transition: all .2s ease;
  white-space: nowrap;
}

.pagination .page:hover {
  background: #e2e8f0;
}

.pagination .page.active {
  background: #2563eb;
  color: #fff;
}




.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;

  max-width: 420px;
  height: 50px;
  margin: 0 0 20px 0;
  padding: 10px 14px;

  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.search-icon {
  font-size: 20px;
  opacity: .6;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;

  font-size: 14px;
  font-weight: 500;
  background: transparent;
}

.search-bar input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

#clearSearch {
 border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    opacity: .4;
    transition: opacity .2s ease, transform .15s ease;
    color: red;
}

#clearSearch:hover {
  opacity: .9;
  transform: scale(1.1);
}

/* focus */
.search-bar:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* mobile */
@media (max-width: 600px) {
  .search-bar {
    max-width: 100%;
  }
}


/* placeholder – wszystkie przeglądarki */
#liveSearch::placeholder {
  color: #9ca3af;   /* szary */
  opacity: 1;       /* 🔴 WAŻNE – bez tego bywa niewidoczny */
}

/* Firefox */
#liveSearch::-moz-placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Edge / Safari */
#liveSearch::-webkit-input-placeholder {
  color: #9ca3af;
}


/* placeholder – wszystkie przeglądarki */
#q::placeholder {
  color: #9ca3af;   /* szary */
  opacity: 1;       /* 🔴 WAŻNE – bez tego bywa niewidoczny */
}

/* Firefox */
#q::-moz-placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Edge / Safari */
#q::-webkit-input-placeholder {
  color: #9ca3af;
}


.actions button.primary {
  position: relative;
}

/* disabled */
.actions button.primary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* spinner */
.actions button.primary.loading {
  color: transparent !important;
  pointer-events: none;
}

.actions button.primary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin .8s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}


.session-warning {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  background: #1f2937; /* dark */
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);

  display: flex;
  align-items: center;
  gap: 8px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.session-warning.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.session-warning.hidden {
  display: none;
}


.session-extend-btn {
  background: #0d6efd;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}





.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}



.app-footer {
  margin-top: 40px;
  padding: 20px 0;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  border-radius: 2px 2px 6px 6px;
  font-size: 13px;
  color: #64748b;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.footer-left {
  text-align: left;
  font-weight: 500;
}

.footer-center {
  text-align: center;
  color: #94a3b8;
}

.footer-right {
  text-align: right;
}

.footer-right a {
  color: #64748b;
  text-decoration: none;
  margin-left: 16px;
  transition: color .2s ease;
}

.footer-right a:hover {
  color: #2563eb;
}

.footer-dot {
  margin: 0 8px;
}


.footer-year {
  color: #475569;
  font-weight: 600;
}

.footer-version {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.footer-build {
  background: #eef2ff;
  color: #4338ca;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}

.footer-env {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  margin-left: 6px;
}

.footer-env.dev {
  background: #fff7ed;
  color: #ea580c;
}

.footer-env.prod {
  background: #ecfeff;
  color: #0284c7;
}


.footer-author {
  font-size: 12px;
  color: #64748b;
}

.footer-author a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.footer-author a:hover {
  text-decoration: underline;
}

.text-danger {
    color: #b00020 !important;
    background: #ffe5e8;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;      /* szerokość = szerokość tekstu */
    align-items: center;
    gap: 8px;                  /* odstęp między ikoną a tekstem */
    border: 1px solid #ffccd2;
    width: fit-content;        /* dopasowanie do treści */
    user-select: none;
}


.text-success {
    color: #0f7b2d !important;
    background: #e6f8ec;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;      /* szerokość = szerokość tekstu */
    align-items: center;
    gap: 8px;                  /* odstęp między ikoną a tekstem */
    border: 1px solid #c8efd6;
    width: fit-content;        /* dopasowanie do treści */
    user-select: none;
}


.error-page {
  min-height: calc(70vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fa;
}

.error-card {
  background: #fff;
  padding: 48px 56px;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
  text-align: center;
  max-width: 420px;
}

.error-card h1 {
  font-size: 72px;
  margin: 0;
  color: #dc2626;
}

.error-card h2 {
  margin: 12px 0 8px;
}

.error-card p {
  color: #555;
  margin-bottom: 28px;
}

.error-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.error-actions .btn {
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
}

.btn.secondary {
  background: #e5e7eb;
  color: #111;
}
