/* ==========================================================================
   Popup komunikatu kryzysowego — "Ważna informacja"
   Zgodny z layoutem witryny: Montserrat (nagłówki), Raleway (treść),
   kolor marki #733647, promień 10px jak .button
   ========================================================================== */

/* === Warstwa tła === */
.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000; /* ponad .pop-up-modal (999999) i widgetem a11y (990) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: rgba(26, 27, 31, .72);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.alert-modal[hidden] {
  display: none;
}

/* === Karta === */
.alert-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 48px);
  margin: auto;
  background-color: #fff;
  border-top: 5px solid #733647;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  outline: none;
}

/* === Nagłówek === */
.alert-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 64px 16px 28px;
}

.alert-modal-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: #733647;
}

.alert-modal-title {
  margin: 0;
  padding-top: 2px;
  color: #733647;
  font-family: Montserrat, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

/* === Przycisk zamykający (ikona) === */
.alert-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #2a2a2d;
  background-color: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.alert-modal-close:hover {
  background-color: #efe7e1;
  color: #733647;
}

.alert-modal-close svg {
  width: 22px;
  height: 22px;
}

/* === Treść === */
.alert-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 28px 8px;
  color: #2a2a2d;
  font-family: Raleway, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

.alert-modal-body p {
  margin: 0 0 16px;
}

.alert-modal-lead {
  font-weight: 600;
}

.alert-modal-body strong {
  color: #733647;
}

/* === Lista zaleceń === */
.alert-modal-list {
  margin: 0 0 16px;
  padding: 18px 20px 18px 22px;
  list-style: none;
  background-color: #efe7e1;
  border-radius: 10px;
}

.alert-modal-list li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 22px;
}

.alert-modal-list li:last-child {
  margin-bottom: 0;
}

.alert-modal-list li::before {
  content: "";
  position: absolute;
  top: .62em;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: #733647;
  border-radius: 50%;
}

.alert-modal-body a {
  color: #733647;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert-modal-body a:hover {
  color: #4f2431;
}

/* === Stopka z przyciskiem === */
.alert-modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 16px 28px 28px;
}

.alert-modal-button {
  min-width: 140px;
  min-height: 44px;
  padding: 12px 32px;
  color: #fff;
  background-color: #733647;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: Raleway, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .2s ease;
}

.alert-modal-button:hover {
  background-color: #5b2937;
}

/* === Tekst tylko dla czytników ekranu === */
.alert-modal-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* === Fokus klawiatury === */
.alert-modal :focus-visible {
  outline: 3px solid #1a1b1f;
  outline-offset: 2px;
}

.alert-modal-card:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* === Blokada przewijania tła === */
html.alert-modal-open,
html.alert-modal-open body {
  overflow: hidden;
}

/* === Animacja wejścia === */
@media (prefers-reduced-motion: no-preference) {
  .alert-modal {
    animation: alert-modal-fade .2s ease-out;
  }

  .alert-modal-card {
    animation: alert-modal-rise .25s ease-out;
  }
}

@keyframes alert-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes alert-modal-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* === Mobile === */
@media screen and (max-width: 767px) {
  .alert-modal {
    padding: 12px;
  }

  .alert-modal-card {
    max-height: calc(100vh - 24px);
  }

  .alert-modal-header {
    padding: 24px 56px 12px 20px;
  }

  .alert-modal-title {
    font-size: 1.25rem;
  }

  .alert-modal-body {
    padding: 0 20px 8px;
  }

  .alert-modal-footer {
    padding: 16px 20px 20px;
  }

  .alert-modal-button {
    width: 100%;
  }
}

/* === Tryb wysokiego kontrastu === */
html.high-contrast .alert-modal {
  background-color: rgba(0, 0, 0, .9) !important;
}

html.high-contrast .alert-modal-card {
  background-color: #000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .alert-modal-title,
html.high-contrast .alert-modal-icon,
html.high-contrast .alert-modal-body strong,
html.high-contrast .alert-modal-body a {
  color: #ffff00 !important;
}

html.high-contrast .alert-modal-body,
html.high-contrast .alert-modal-close {
  color: #fff !important;
}

html.high-contrast .alert-modal-list {
  background-color: #000 !important;
  border: 1px solid #ffff00 !important;
}

html.high-contrast .alert-modal-list li::before {
  background-color: #ffff00 !important;
}

html.high-contrast .alert-modal-button,
html.high-contrast .alert-modal-close:hover {
  color: #000 !important;
  background-color: #ffff00 !important;
}

html.high-contrast .alert-modal-close:hover {
  color: #000 !important;
}

html.high-contrast .alert-modal :focus-visible {
  outline: 3px solid #ffff00 !important;
}
