/* ==========================================================
   DIET-MED • Style zgodne z szablonem diet-med.pl (Divi Theme)
   Paleta: #2e435d (Navy Blue), #ee5a36 (Coral/Orange Accent)
   ========================================================== */

:root {
  --color-primary: #2e435d;       /* Główny granat Diet-Med */
  --color-primary-dark: #1f2f42;  /* Ciemniejszy granat */
  --color-accent: #ee5a36;        /* Pomarańczowy akcent Diet-Med */
  --color-accent-hover: #d84824;
  --color-bg-light: #f7f7f7;      /* Jasnoszare tło strony */
  --color-surface: #ffffff;       /* Białe tło kart i formularza */
  --color-text-main: #333333;     /* Główny tekst */
  --color-text-muted: #666666;    /* Tekst pomocniczy */
  --color-border: #e2e8f0;        /* Obramowania */
  --color-input-bg: #f4f5f7;      /* Tło pól tekstowych */
  
  --font-family: 'Lato', Helvetica, Arial, Lucida, sans-serif;
  --container-width: 1140px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.diet-med-theme {
  font-family: var(--font-family);
  background-color: var(--color-bg-light);
  color: var(--color-text-main);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
}

.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* ==========================================================
   1. GÓRNY PASEK (#top-header)
   ========================================================== */
#top-header {
  background-color: var(--color-primary);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#top-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-contact-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.top-contact-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-contact-info a {
  color: #ffffff;
  font-weight: 400;
}

.top-contact-info a:hover {
  color: var(--color-accent);
}

.top-hours {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

/* ==========================================================
   2. GŁÓWNY HEADER I NAWIGACJA (#main-header)
   ========================================================== */
#main-header {
  background-color: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

#main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo_container {
  display: flex;
  align-items: center;
}

#logo {
  max-height: 52px;
  width: auto;
  display: block;
}

#top-menu-nav ul.nav {
  display: flex;
  list-style: none;
  gap: 24px;
}

#top-menu-nav ul.nav li a {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: none;
  padding: 10px 0;
  position: relative;
  transition: color 0.2s ease;
}

#top-menu-nav ul.nav li.current-menu-item a,
#top-menu-nav ul.nav li a:hover {
  color: var(--color-accent);
}

#top-menu-nav ul.nav li.current-menu-item a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-accent);
}

/* ==========================================================
   3. BANER HERO (ZDJĘCIE Z TŁEM DIET-MED)
   ========================================================== */
.hero-banner {
  position: relative;
  background: url('../assets/banner-bg.jpg') center center / cover no-repeat;
  padding: 70px 0 60px;
  text-align: center;
  color: #ffffff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(46, 67, 93, 0.88), rgba(31, 47, 66, 0.82));
  z-index: 1;
}

.hero-banner .container {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  color: #ffffff;
}

.title-divider {
  display: flex;
  justify-content: center;
  margin: 10px auto 16px;
}

.divider-line {
  display: inline-block;
  width: 70px;
  height: 3px;
  background-color: var(--color-accent);
}

.hero-subtitle {
  font-size: 17px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  max-width: 720px;
  margin: 0 auto;
}

/* ==========================================================
   4. GŁÓWNY UKŁAD STRONY
   ========================================================== */
.page-content {
  padding: 40px 0 70px;
}



.content-row {
  display: flex;
  gap: 36px;
}

/* ==========================================================
   KOLUMNA LEWA: SIDEBAR
   ========================================================== */
.sidebar-col {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: #ffffff;
  padding: 24px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-divider {
  width: 40px;
  height: 2px;
  background-color: var(--color-accent);
  margin-bottom: 14px;
}

.card-text {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.blurb-box {
  background: #ffffff;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease;
}

.blurb-box:hover {
  border-color: rgba(238, 90, 54, 0.5);
}

.blurb-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.blurb-content strong {
  display: block;
  font-size: 14px;
  color: var(--color-primary);
  margin-bottom: 3px;
}

.blurb-content p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.blurb-content small {
  font-size: 11.5px;
  color: #94a3b8;
}

.accent-link {
  color: var(--color-text-main);
  font-weight: 600;
}

.accent-link:hover {
  color: var(--color-accent);
}

/* ==========================================================
   KOLUMNA PRAWA: FORMULARZ TDP
   ========================================================== */
.form-col {
  flex: 1;
  min-width: 0;
}

.form-card {
  background: #ffffff;
  padding: 36px 36px 40px;
  border: 1px solid var(--color-border);
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.form-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 20px;
}

.form-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.form-lead {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Sekcje w formularzu */
.form-section {
  margin-bottom: 30px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.step-badge {
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 2px;
}

.sub-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
}

/* Lista dolegliwości */
.ailments-table-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ailment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background-color: #fbfbfb;
  border: 1px solid #eef0f3;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.ailment-row:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.ailment-row.selected-tak {
  background-color: #fff9f7;
  border-color: rgba(238, 90, 54, 0.4);
  border-left: 3px solid var(--color-accent);
}

.ailment-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: capitalize;
}

.ailment-name-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ailment-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 2px;
  user-select: none;
}

.ailment-ready-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 2px;
  user-select: none;
}

/* Styl dla wyszarzonej dolegliwości, gdy brakuje tabeli w bazie danych */
.ailment-row.disabled-ailment {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.6;
  cursor: not-allowed;
}

.ailment-row.disabled-ailment:hover {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

.ailment-row.disabled-ailment .ailment-name {
  color: #94a3b8;
}

.ailment-row.disabled-ailment .option-btn {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: not-allowed;
  pointer-events: none;
}

.ailment-row.disabled-ailment .option-btn:hover {
  background-color: #f8fafc;
  color: #cbd5e1;
}

/* Przyciski Tak / Nie / Nie wiem */
.options-group {
  display: flex;
  gap: 6px;
}

.option-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #64748b;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.option-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.option-btn.active[data-value="tak"] {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.option-btn.active[data-value="nie"] {
  background-color: #64748b;
  border-color: #64748b;
  color: #ffffff;
}

.option-btn.active[data-value="nie_wiem"] {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

/* Pola tekstowe w stylu Divi */
.et_contact_field {
  margin-bottom: 20px;
}

.et_label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.req-star {
  color: var(--color-accent);
}

.et_input {
  width: 100%;
  padding: 13px 16px;
  background-color: #eee;
  border: 1px solid #ddd;
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: 14px;
  border-radius: 2px;
  outline: none;
  transition: all 0.2s ease;
}

.et_input:focus {
  background-color: #ffffff;
  border-color: var(--color-primary);
}

.error-msg {
  color: #dc2626;
  font-size: 12px;
  margin-top: 5px;
  min-height: 16px;
}

/* Klauzula RODO */
.rodo-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  margin-bottom: 25px;
  border-radius: 2px;
}

.rodo-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.rodo-checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-primary);
}

/* Komunikat walidacji nieuzupełnionych dolegliwości */
.validation-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  border-left: 4px solid var(--color-accent);
  color: #9f1239;
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 20px;
}

.validation-alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.validation-alert-text strong {
  color: var(--color-primary);
}

/* Wyróżnienie nieuzupełnionego wiersza */
.ailment-row.unanswered-error {
  border-color: #fda4af !important;
  background-color: #fff1f2 !important;
  box-shadow: 0 0 0 1px #f43f5e;
}

.ailment-row.unanswered-error:hover {
  background-color: #ffe4e6 !important;
}

/* Pasek dolny formularza */
.form-bottom-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-pill {
  font-size: 14px;
  color: var(--color-text-muted);
}

.summary-pill strong {
  color: var(--color-accent);
  font-size: 16px;
}

.summary-pill span {
  font-weight: 700;
  color: var(--color-primary);
}

/* Przycisk wysyłki (.et_pb_button) */
.et_pb_button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-primary);
  color: #ffffff !important;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 13px 30px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.et_pb_button:hover:not(:disabled) {
  background-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(238, 90, 54, 0.35);
}

.et_pb_button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.et_button_icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.et_pb_button:hover .et_button_icon {
  transform: translateX(4px);
}

/* Skeleton loader */
.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 46px;
  background: #f1f5f9;
  border-radius: 2px;
  animation: pulse-bg 1.2s infinite ease-in-out;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==========================================================
   5. STOPKA (#main-footer)
   ========================================================== */
#main-footer {
  background-color: var(--color-primary);
  color: #a7b5c6;
  font-size: 13px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#footer-info {
  text-align: center;
}

#footer-info a {
  color: #ffffff;
}

#footer-info a:hover {
  color: var(--color-accent);
}

/* ==========================================================
   6. MODAL SUKCESU
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 47, 66, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-top: 4px solid var(--color-accent);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  width: 100%;
  padding: 36px 30px;
  text-align: center;
  border-radius: 2px;
}

.modal-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #fff2ed;
  color: var(--color-accent);
  font-size: 26px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.modal-body-text {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-info-panel {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  padding: 14px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--color-primary);
  text-align: left;
}

/* Statystyki podziału produktów w modalu */
.modal-stats-container {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}

.modal-stats-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid transparent;
}

.stat-icon {
  font-weight: 700;
  font-size: 13px;
}

.stat-label {
  font-weight: 600;
  flex: 1;
}

.stat-value {
  font-weight: 800;
  font-size: 13px;
}

.stat-zalecane {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.stat-dozwolone {
  background-color: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.stat-ograniczone {
  background-color: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.stat-zakazane {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ==========================================================
   Karta legendy klasyfikacji produktów (Sidebar)
   ========================================================== */
.legend-card {
  margin-top: 25px;
}

.legend-items-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 3px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

.legend-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  width: fit-content;
}

.legend-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.legend-zalecane {
  border-left: 3px solid #059669;
}
.legend-zalecane .legend-badge {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.legend-dozwolone {
  border-left: 3px solid #0284c7;
}
.legend-dozwolone .legend-badge {
  background-color: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.legend-ograniczone {
  border-left: 3px solid #d97706;
}
.legend-ograniczone .legend-badge {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.legend-zakazane {
  border-left: 3px solid #dc2626;
}
.legend-zakazane .legend-badge {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.legend-priority-note {
  font-size: 11.5px;
  color: #475569;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 9px 11px;
  border-radius: 2px;
  line-height: 1.45;
}

.legend-priority-note em {
  color: var(--color-primary);
  font-weight: 600;
}


.modal-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-download-pdf {
  background-color: var(--color-accent) !important;
}

.btn-download-pdf:hover {
  background-color: var(--color-accent-hover) !important;
}

.btn-outline-modal {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: var(--color-primary);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-modal:hover {
  background-color: #f1f5f9;
}

/* ==========================================================
   RESPONSYWNOŚĆ
   ========================================================== */
@media (max-width: 992px) {
  .content-row {
    flex-direction: column-reverse;
  }
  .sidebar-col {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 768px) {
  #top-header {
    display: none;
  }
  #main-header .container {
    height: auto;
    padding: 12px 0;
    flex-direction: column;
    gap: 10px;
  }
  #top-menu-nav ul.nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .hero-title {
    font-size: 26px;
  }
  .form-card {
    padding: 24px 18px;
  }
  .ailment-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .options-group {
    width: 100%;
  }
  .option-btn {
    flex: 1;
    text-align: center;
  }
  .form-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .et_pb_button {
    width: 100%;
    justify-content: center;
  }
}
