/* ── Reset & Base (Mobile-first: 320px) ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Brand display face — used on headings only; DM Sans stays for body */
@font-face {
  font-family: 'Diurnal Display';
  src: url('fonts/DiurnalDisplayL.ttf') format('truetype-variations'),
       url('fonts/DiurnalDisplayL.ttf') format('truetype');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #E5E7EB;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;
  /* Brand palette — Twój Lekarz */
  --blue-700:  #002F6C;   /* deep navy — pressed/hover */
  --blue-600:  #0050B5;   /* brand mid blue — primary action */
  --blue-500:  #33C5ED;   /* brand light — focus rings, accents */
  --blue-100:  #cfe6f7;   /* soft tints, fills */
  --blue-50:   #f0f9ff;   /* very pale page-tint backgrounds */
  --font-display: 'Diurnal Display', 'DM Sans', system-ui, sans-serif;
  --red-600:   #dc2626;
  --red-50:    #fef2f2;
  --amber-600: #d97706;
  --amber-50:  #fffbeb;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-50:  #f0fdf4;
  --radius:    6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  line-height: 1.55;
  min-height: 100vh;
  font-size: 0.9375rem;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute; top: -100px; left: 8px;
  background: var(--blue-600); color: #fff;
  padding: 8px 16px; z-index: 1000;
  font-weight: 500; text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }

/* ── Header ── */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 14px 20px;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.header-brand {
  display: flex; align-items: center; gap: 12px;
}
.header-logo { height: 44px; width: auto; }
.header-divider { color: var(--slate-300); font-size: 20px; }
.header-title {
  font-family: var(--font-display);
  font-size: 1.125rem; font-weight: 500; color: var(--blue-700);
  letter-spacing: -0.01em;
}
.header h1 {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 500;
  color: var(--blue-700); letter-spacing: -0.015em;
}

/* ── Accessibility Toolbar ── */
.a11y-toolbar {
  display: flex; gap: 4px; flex-shrink: 0;
}
.a11y-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--slate-50); border: 1px solid var(--slate-200);
  border-radius: var(--radius); cursor: pointer;
  color: var(--slate-600); transition: all var(--transition);
  padding: 0;
}
.a11y-btn:hover { background: var(--slate-100); color: var(--slate-900); }
.a11y-btn.active { background: var(--slate-900); color: var(--white); border-color: var(--slate-900); }
.a11y-btn svg { width: 16px; height: 16px; }

/* ── Main ── */
.main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }

/* ── Step Indicator ── */
.step-indicator {
  display: flex; align-items: center;
  margin-bottom: 24px; padding: 0; list-style: none;
}
.step-indicator li {
  display: flex; align-items: center;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--slate-400); white-space: nowrap;
}
.step-indicator li .num {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1.5px solid var(--slate-300); border-radius: 50%;
  background: var(--white); color: var(--slate-400);
  font-size: 0.8125rem; font-weight: 600; flex-shrink: 0;
  transition: all var(--transition);
}
.step-indicator li .label { display: none; }
.step-indicator li.active .num {
  background: var(--blue-600); border-color: var(--blue-600); color: #fff;
}
.step-indicator li.active { color: var(--blue-600); }
.step-indicator li.completed .num {
  background: var(--blue-600); border-color: var(--blue-600); color: #fff;
}
.step-indicator li.completed { color: var(--slate-700); }
.step-indicator .line {
  flex: 1; height: 1px; background: var(--slate-200);
  margin: 0 8px; min-width: 16px; transition: background var(--transition);
}
.step-indicator li.completed + .line { background: var(--slate-900); }

.step-progress-mobile {
  display: block;
  margin: -8px 0 20px;
  padding: 10px 14px;
  background: var(--blue-50);
  border-radius: var(--radius-md);
  color: var(--slate-700);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
}
.step-progress-mobile strong { color: var(--blue-600); font-weight: 600; }
@media (min-width: 480px) {
  .step-progress-mobile { display: none; }
}

/* ── Card ── */
.card {
  background: var(--white); border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); padding: 24px 20px; box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em;
  color: var(--blue-700); margin-bottom: 2px;
}
.card-subtitle { font-size: 0.8125rem; color: var(--slate-500); margin-bottom: 20px; }

/* ── Form Fields ── */
.field-group { margin-bottom: 16px; }
.field-row { display: flex; flex-direction: column; gap: 16px; }
.field-group label {
  display: block; font-size: 0.8125rem; font-weight: 500;
  color: var(--slate-600); margin-bottom: 4px;
}
.field-group label .req { color: var(--red-600); margin-left: 1px; }

input[type="text"], input[type="email"], input[type="tel"],
select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--slate-300); border-radius: var(--radius);
  background: var(--white); font-family: inherit;
  font-size: 0.9375rem; color: var(--slate-900);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--slate-400); }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
input[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--red-600);
  box-shadow: inset 3px 0 0 var(--red-600);
}
input[readonly] { background: var(--slate-50); color: var(--slate-600); }

.field-error {
  font-size: 0.8125rem; color: var(--red-600); margin-top: 4px;
  min-height: 0; overflow: hidden; transition: max-height 0.2s;
}
.field-error:empty { max-height: 0; }
.field-error:not(:empty) { max-height: 60px; }
.field-hint { font-size: 0.8125rem; color: var(--slate-400); margin-top: 3px; }

/* ── PESEL Feedback ── */
.pesel-feedback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pesel-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; font-size: 0.8125rem; font-weight: 500;
  border-radius: var(--radius);
}
.pesel-badge svg { width: 14px; height: 14px; }
.pesel-badge.gender-f { background: #fce7f3; color: #9d174d; }
.pesel-badge.gender-m { background: #dbeafe; color: #1e40af; }
.pesel-badge.dob { background: var(--blue-50); color: var(--blue-600); }

/* ── Gender Radio ── */
.gender-manual { margin-top: 8px; }
.gender-manual.hidden { display: none; }
.radio-group { display: flex; gap: 20px; margin-top: 6px; flex-wrap: wrap; }
.radio-group label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9375rem; font-weight: 400;
  color: var(--slate-900); cursor: pointer;
}
.radio-group input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue-600); }

/* ── Collapsible (Guardians) ── */
.collapsible-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--slate-50); border: 1px solid var(--slate-200);
  border-radius: var(--radius); padding: 10px 16px;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--blue-600); cursor: pointer;
  width: 100%; text-align: left; margin-top: 8px;
  transition: background var(--transition);
}
.collapsible-toggle:hover { background: var(--blue-50); }
.collapsible-toggle svg { width: 16px; height: 16px; transition: transform 0.2s; flex-shrink: 0; }
.collapsible-toggle.open svg { transform: rotate(90deg); }
.collapsible-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.collapsible-content.open { max-height: 1200px; }
.guardian-block { border-left: 2px solid var(--blue-100); padding: 16px 0 16px 16px; margin-top: 12px; }
.guardian-label { font-size: 0.875rem; font-weight: 600; color: var(--blue-600); margin-bottom: 12px; }

/* ── Declaration Accordions ── */
.decl-accordion {
  margin-bottom: 12px; border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.decl-accordion.enabled {
  border-color: var(--blue-500); box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--blue-600);
}
.decl-accordion.hidden-gender { display: none; }

.decl-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; cursor: pointer;
  transition: background var(--transition); user-select: none;
}
.decl-header:hover { background: var(--slate-50); }
.decl-accordion.enabled .decl-header { background: var(--blue-50); }

.decl-header input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--blue-600);
  flex-shrink: 0; cursor: pointer;
}
.decl-header .icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--slate-100); color: var(--slate-400);
  flex-shrink: 0; transition: all var(--transition);
}
.decl-accordion.enabled .decl-header .icon {
  background: var(--blue-100); color: var(--blue-600);
}
.decl-header .icon svg { width: 20px; height: 20px; }
.decl-header .decl-title { flex: 1; }
.decl-header .decl-title h3 { font-size: 0.9375rem; font-weight: 600; color: var(--slate-900); margin-bottom: 0; }
.decl-header .decl-title p { font-size: 0.8125rem; color: var(--slate-500); margin-top: 1px; }
.decl-header .decl-chevron {
  color: var(--slate-400); transition: transform 0.2s, color 0.2s; flex-shrink: 0;
}
.decl-header .decl-chevron svg { width: 18px; height: 18px; }
.decl-accordion.enabled .decl-chevron { transform: rotate(90deg); color: var(--blue-600); }

.decl-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.decl-accordion.enabled .decl-body { max-height: 600px; }
/* Położna opted out ("I use a midwife elsewhere"): keep the card open so the
   opt-out checkbox stays visible, but hide the now-irrelevant settings. */
.decl-accordion.optout-on .decl-body { max-height: 600px; }
.decl-accordion.optout-on .decl-body-inner > .field-group,
.decl-accordion.optout-on .decl-body-inner > .conditional-block { display: none; }
.decl-body-inner { padding: 0 20px 20px; border-top: 1px solid var(--slate-200); }

.conditional-block {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
  padding: 0 16px; border-radius: var(--radius);
}
.conditional-block.visible {
  max-height: 400px; padding: 16px;
  background: var(--amber-50); border-left: 3px solid var(--amber-600); margin-top: 12px;
}

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; color: var(--slate-900);
  margin-bottom: 8px; cursor: pointer; font-size: 0.9375rem;
}
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue-600); }

/* Reason sub-options — vertical list of (sometimes long) art. 9 ust. 5 circumstances */
.reason-group { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 8px; }
.reason-group .checkbox-label { align-items: flex-start; margin-bottom: 0; line-height: 1.45; }
.reason-group input[type="radio"] { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--blue-600); }

/* ── Review ── */
.review-section {
  margin-bottom: 16px; border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden;
}
.review-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.review-header h3 { font-size: 0.8125rem; font-weight: 600; color: var(--slate-700); }
.review-edit {
  font-size: 0.8125rem; color: var(--blue-600); text-decoration: none;
  font-weight: 500; cursor: pointer; background: none; border: none; font-family: inherit;
}
.review-edit:hover { text-decoration: underline; }
.review-body { padding: 8px 16px; }
.review-row { display: flex; padding: 6px 0; font-size: 0.875rem; border-bottom: 1px solid var(--slate-100); }
.review-row:last-child { border-bottom: none; }
.review-label { width: 40%; color: var(--slate-500); font-size: 0.8125rem; }
.review-value { flex: 1; font-weight: 500; color: var(--slate-900); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: background var(--transition), transform 0.1s; min-height: 44px;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-500); }
.btn-primary:disabled { background: var(--slate-300); cursor: wait; color: var(--slate-500); }
.btn-ghost { background: transparent; color: var(--slate-600); border: 1px solid var(--slate-200); }
.btn-ghost:hover { background: var(--slate-50); }
.nav-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }

/* ── Progress / Downloads ── */
.progress-bar { width: 100%; height: 3px; background: var(--slate-200); margin: 16px 0; overflow: hidden; border-radius: 2px; }
.progress-bar .fill { height: 100%; background: var(--blue-600); width: 0%; transition: width 0.3s; border-radius: 2px; }
.download-list { list-style: none; margin-top: 16px; }
.download-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid var(--slate-200);
  border-radius: var(--radius); margin-bottom: 8px; background: var(--green-50);
}
.download-list li svg { width: 18px; height: 18px; color: var(--green-700); flex-shrink: 0; }
.download-list li a { color: var(--green-700); font-weight: 500; text-decoration: none; font-size: 0.875rem; }
.download-list li a:hover { text-decoration: underline; }
.download-list li .size { color: var(--slate-400); font-size: 0.8125rem; }
.download-list li .dl-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.download-list li a.btn-download { margin-left: auto; flex-shrink: 0; color: #fff; font-weight: 600; padding: 7px 14px; font-size: 0.875rem; }
.download-list li a.btn-download:hover { text-decoration: none; filter: brightness(0.95); }
.download-list li a.btn-download svg { color: #fff; }
.status { font-size: 0.875rem; color: var(--slate-500); margin-top: 12px; }
.status.error { color: var(--red-600); }

/* ── Step Visibility ── */
.step { display: block; }
.step-layout { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.footer { text-align: center; padding: 24px 20px; font-size: 0.8125rem; color: var(--slate-400); }

/* ── Responsive ── */
@media (min-width: 480px) {
  .field-row { flex-direction: row; }
  .field-row > .field-group { flex: 1; }
  .nav-buttons { flex-direction: row; justify-content: space-between; }
  .nav-buttons .btn { width: auto; }
  .step-indicator li .label { display: inline; margin-left: 6px; }
}
@media (min-width: 768px) {
  .card { padding: 32px; }
  .main { padding: 28px 20px 48px; }
}

/* ── High Contrast Mode ── */
html.high-contrast {
  --slate-900: #000000;
  --slate-700: #1a1a1a;
  --slate-600: #2a2a2a;
  --slate-500: #333333;
  --slate-400: #555555;
  --slate-300: #666666;
  --slate-200: #333333;
  --slate-100: #1a1a1a;
  --slate-50:  #111111;
  --white:     #000000;
  --blue-700:  #1d4ed8;
  --blue-600:  #60a5fa;
  --blue-500:  #93c5fd;
  --blue-100:  #1e3a5f;
  --blue-50:   #0c1a2e;
  --red-600:   #ff6b6b;
  --red-50:    #3a1a1a;
  --amber-600: #fbbf24;
  --amber-50:  #3a2e1a;
  --green-700: #4ade80;
  --green-600: #86efac;
  --green-50:  #1a3a1a;
}
html.high-contrast body {
  background: #0a0a0a;
  color: #f0f0f0;
}
html.high-contrast .header {
  background: #000;
  border-color: #333;
}
html.high-contrast .header h1 { color: #f0f0f0; }
html.high-contrast .card {
  background: #111;
  border-color: #444;
  color: #f0f0f0;
}
html.high-contrast .card-title { color: #ffffff; }
html.high-contrast .card-subtitle { color: #aaa; }
html.high-contrast input[type="text"],
html.high-contrast input[type="email"],
html.high-contrast input[type="tel"],
html.high-contrast select,
html.high-contrast textarea {
  background: #1a1a1a;
  border-color: #555;
  color: #f0f0f0;
}
html.high-contrast input:focus,
html.high-contrast select:focus,
html.high-contrast textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
}
html.high-contrast input::placeholder { color: #777; }
html.high-contrast .field-group label { color: #ccc; }
html.high-contrast .field-hint { color: #888; }
html.high-contrast .step-indicator li { color: #888; }
html.high-contrast .step-indicator li .num {
  background: #222; border-color: #555; color: #aaa;
}
html.high-contrast .step-indicator li.active .num {
  background: #60a5fa; border-color: #60a5fa; color: #000;
}
html.high-contrast .step-indicator li.completed .num {
  background: #f0f0f0; border-color: #f0f0f0; color: #000;
}
html.high-contrast .step-indicator .line { background: #444; }
html.high-contrast .step-indicator li.completed + .line { background: #f0f0f0; }
html.high-contrast .btn-primary { background: #60a5fa; color: #000; }
html.high-contrast .btn-primary:hover { background: #5eead4; }
html.high-contrast .btn-ghost {
  color: #ccc; border-color: #555;
}
html.high-contrast .btn-ghost:hover { background: #222; }
html.high-contrast .decl-accordion { border-color: #444; }
html.high-contrast .decl-accordion.enabled { border-color: #60a5fa; }
html.high-contrast .decl-header:hover { background: #1a1a1a; }
html.high-contrast .decl-accordion.enabled .decl-header { background: #0c1a2e; }
html.high-contrast .decl-header .icon { background: #222; color: #888; }
html.high-contrast .decl-accordion.enabled .decl-header .icon { background: #1e3a5f; color: #60a5fa; }
html.high-contrast .decl-header .decl-title h3 { color: #f0f0f0; }
html.high-contrast .decl-header .decl-title p { color: #aaa; }
html.high-contrast .review-section { border-color: #444; }
html.high-contrast .review-header { background: #1a1a1a; border-color: #444; }
html.high-contrast .review-header h3 { color: #ddd; }
html.high-contrast .review-row { border-color: #333; }
html.high-contrast .review-label { color: #aaa; }
html.high-contrast .review-value { color: #f0f0f0; }
html.high-contrast .download-list li { background: #1a2a1a; border-color: #444; }
html.high-contrast .download-list li a { color: #4ade80; }
html.high-contrast .collapsible-toggle { background: #1a1a1a; border-color: #444; color: #60a5fa; }
html.high-contrast .collapsible-toggle:hover { background: #0c1a2e; }
html.high-contrast .guardian-block { border-color: #1e3a5f; }
html.high-contrast .conditional-block.visible { background: #2a2000; border-color: #fbbf24; }
html.high-contrast .pesel-badge.dob { background: #0c1a2e; color: #60a5fa; }
html.high-contrast .pesel-badge.gender-f { background: #2a1a2a; color: #f0abfc; }
html.high-contrast .pesel-badge.gender-m { background: #1a1a2a; color: #93c5fd; }
html.high-contrast .a11y-btn { background: #222; border-color: #555; color: #ccc; }
html.high-contrast .a11y-btn:hover { background: #333; color: #fff; }
html.high-contrast .a11y-btn.active { background: #60a5fa; color: #000; border-color: #60a5fa; }
html.high-contrast .footer { color: #666; }
html.high-contrast .radio-group label { color: #f0f0f0; }
html.high-contrast .checkbox-label { color: #f0f0f0; }
html.high-contrast .progress-bar { background: #333; }
html.high-contrast .progress-bar .fill { background: #60a5fa; }
html.high-contrast .upload-slot { background: #1a1a1a; border-color: #444; }
html.high-contrast .upload-info { background: #0c1a2e; border-color: #1e3a5f; }
html.high-contrast .upload-slot-file { background: #0c1f12; border-color: #1e5f3a; }
html.high-contrast .upload-slot-name { color: #e5e7eb; }
html.high-contrast .upload-slot-remove { background: #1a1a1a; border-color: #555; color: #fca5a5; }
html.high-contrast .upload-slot-remove i { color: #fca5a5; }
html.high-contrast .thankyou-card h2 { color: #ffffff; }
html.high-contrast .thankyou-lead { color: #e5e7eb; }
html.high-contrast .thankyou-icon { background: #0c1f12; }
html.high-contrast .thankyou-org { background: #0c1a2e; border-color: #1e3a5f; }
html.high-contrast .thankyou-org strong { color: #ffffff; }
html.high-contrast .thankyou-org a { color: #93c5fd; }
html.high-contrast .link-box input { background: #1a1a1a; border-color: #444; color: #e0e0e0; }

/* ══════════════════════════════════════ */
/*  STEP 4: Upload slots                */
/* ══════════════════════════════════════ */

.upload-slot {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fafbfc;
}
.upload-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text);
}
.upload-slot-header i { width: 18px; height: 18px; color: var(--primary); }
.upload-slot input[type="file"] {
  display: block;
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}
.upload-slot input[type="file"]:hover,
.upload-slot input[type="file"]:focus {
  border-color: var(--primary);
}
.upload-slot-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--green-50);
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 0.875rem;
}
.upload-slot-file i { width: 16px; height: 16px; color: var(--green-600); flex-shrink: 0; }
.upload-slot-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.upload-slot-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--red-600);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.upload-slot-remove:hover,
.upload-slot-remove:focus { background: var(--red-50); border-color: var(--red-600); }
.upload-slot-remove i { width: 14px; height: 14px; color: var(--red-600); }
.scan-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scan-list .upload-slot-file { margin: 0; }
.scan-list .size { color: var(--muted); font-size: 0.8125rem; flex-shrink: 0; }

/* ── Thank-you (final screen) ─────────────────────────────────── */
.thankyou-screen {
  display: flex;
  justify-content: center;
  padding: 24px 0 48px;
}
.thankyou-card {
  max-width: 540px;
  width: 100%;
  text-align: center;
  padding: 40px 28px;
}
.thankyou-logo { height: 52px; width: auto; margin: 0 auto 20px; display: block; }
.thankyou-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-50);
}
.thankyou-icon i { width: 36px; height: 36px; color: var(--green-600); }
.thankyou-card h2 {
  font-family: var(--font-display);
  color: var(--blue-700);
  font-size: 1.75rem;
  margin-bottom: 12px;
}
.thankyou-lead { color: var(--text); font-size: 1.0625rem; line-height: 1.6; margin-bottom: 24px; }
.thankyou-org {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.thankyou-org strong { color: var(--blue-700); }
.thankyou-org a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue-600);
  font-weight: 600;
  text-decoration: none;
}
.thankyou-org a i { width: 16px; height: 16px; }
.thankyou-org a:hover { text-decoration: underline; }

.upload-info {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}
.upload-success-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 16px;
}
.upload-success-msg i { width: 20px; height: 20px; }

.link-box { margin-top: 8px; }
.link-box label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  background: #fff;
  color: var(--text);
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm i { width: 14px; height: 14px; }

/* ══════════════════════════════════════ */
/*  60/40 Split Layout                  */
/* ══════════════════════════════════════ */

.step-layout {
  display: none;
  gap: 32px;
  align-items: flex-start;
}
.step-layout.active {
  display: flex;
}
.step-layout .step-form {
  flex: 1 1 60%;
  min-width: 0;
}
.step-aside {
  flex: 0 0 320px;
  position: sticky;
  top: 80px;
  padding: 20px;
  background: linear-gradient(180deg, var(--blue-50) 0%, #eef4fc 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--blue-100);
}

/* Tip cards (used in desktop aside and mobile tip-bar) */
.tip-cards {
  display: flex; flex-direction: column; gap: 12px;
}
.tip-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff;
  border: 1px solid var(--blue-100);
  border-radius: 12px;
  padding: 14px 16px;
}
.tip-card-icon {
  flex-shrink: 0; color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
}
.tip-card-icon i, .tip-card-icon svg {
  width: 22px; height: 22px;
}
.tip-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate-700);
}
.tip-card.is-highlighted {
  background: var(--blue-700);
  border-color: var(--blue-700);
}
.tip-card.is-highlighted p,
.tip-card.is-highlighted .tip-card-icon { color: #fff; }

/* Mobile: no aside */
@media (max-width: 1023px) {
  .step-layout {
    display: none;
  }
  .step-layout.active {
    display: block;
  }
  .step-aside {
    display: none;
  }
}

.email-sent-info {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--blue-50); border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg); padding: 16px;
  margin-bottom: 20px; color: var(--slate-600);
  font-size: 14px; line-height: 1.6;
}
.email-sent-info i { flex-shrink: 0; width: 20px; height: 20px; color: var(--blue-600); margin-top: 2px; }

.field-desc {
  font-size: 13px; color: var(--slate-500);
  margin-top: -4px; margin-bottom: 8px;
}

.contact-help {
  text-align: center; color: var(--slate-500);
  font-size: 14px; margin-top: 24px;
}
.generate-hint {
  text-align: center; color: var(--slate-500);
  font-size: 13px; line-height: 1.5;
  margin-top: 12px;
}
/* Mobile tip-bar (collapsible, same content as desktop aside) */
.mobile-tip-bar { display: none; }
@media (max-width: 1023px) {
  .mobile-tip-bar {
    display: block;
    margin: 0 0 16px;
    background: var(--blue-700);
    border: 1px solid var(--blue-700);
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
  }
  .tip-toggle {
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: transparent; border: 0;
    font: inherit; font-size: 14px;
    color: #fff; text-align: left;
    cursor: pointer;
  }
  .tip-toggle .tip-summary { flex: 1; line-height: 1.4; }
  .tip-toggle .tip-icon-info,
  .tip-toggle .tip-icon-chev {
    flex-shrink: 0;
    color: #fff;
    width: 18px; height: 18px;
  }
  .tip-toggle .tip-icon-info svg,
  .tip-toggle .tip-icon-chev svg { width: 18px; height: 18px; }
  .tip-toggle .tip-icon-chev { transition: transform 0.3s; }
  .tip-toggle[aria-expanded="true"] .tip-icon-chev { transform: rotate(180deg); }
  .tip-expanded {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
  }
  .tip-expanded.is-expanded {
    max-height: 1200px;
  }
  .tip-expanded .tip-cards {
    padding: 0 12px 12px;
  }
  .mobile-tip-bar .tip-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .mobile-tip-bar .tip-card.is-highlighted {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.22);
  }
  .mobile-tip-bar .tip-card-icon,
  .mobile-tip-bar .tip-card p { color: #fff; }
}
.contact-phone {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--blue-600); text-decoration: none;
  font-weight: 500; margin-left: 4px;
}
.contact-phone:hover { text-decoration: underline; }
.contact-phone i { width: 14px; height: 14px; }

/* ── RODO consent (end of step 1) ── */
.consent-section {
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}
.consent-checkbox {
  align-items: flex-start; gap: 10px;
  font-size: 0.875rem; line-height: 1.5; color: var(--slate-700);
}
.consent-checkbox input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.consent-details { margin: 4px 0 0 28px; }
.consent-details summary {
  cursor: pointer; color: var(--blue-600);
  font-size: 0.8125rem; font-weight: 500;
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
}
.consent-details summary::-webkit-details-marker { display: none; }
.consent-details summary::before { content: '\25B8'; font-size: 0.7rem; }
.consent-details[open] summary::before { content: '\25BE'; }
.consent-full {
  margin-top: 10px; padding: 14px 16px;
  background: var(--blue-50); border: 1px solid var(--blue-100);
  border-radius: var(--radius); font-size: 0.8125rem; line-height: 1.6;
  color: var(--slate-600);
}
.consent-full p { margin-bottom: 8px; }
.consent-full ul { margin: 0 0 8px 18px; }
.consent-full li { margin-bottom: 4px; }
.consent-full a { color: var(--blue-600); }
.consent-section .field-error { margin-left: 28px; }
