/*
 * Medinazure — Cookie consent banner + preferences modal
 * Uses the same design tokens (forest-black, alert-red, etc.) as the rest of the site.
 */

#mdz-cookie-root,
#mdz-cookie-root *,
#mdz-cookie-root *::before,
#mdz-cookie-root *::after {
  box-sizing: border-box;
}

.mdz-cookie-banner {
  position: fixed;
  inset: auto 24px 24px 24px;
  z-index: 9990;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(18px, 2vw, 32px);
  align-items: center;
  padding: clamp(20px, 2vw, 28px) clamp(22px, 2.4vw, 32px);
  border-radius: 18px;
  background: rgba(26, 33, 30, 0.98);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(6, 23, 47, 0.45);
  font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mdz-cookie-banner[hidden] {
  display: none !important;
}

.mdz-cookie-banner__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  max-width: 78ch;
}

.mdz-cookie-banner__title {
  display: block;
  margin-bottom: 6px;
  font-family: 'Montserrat', 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.mdz-cookie-banner__text a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(204, 46, 57, 0.55);
  text-underline-offset: 3px;
}

.mdz-cookie-banner__text a:hover {
  text-decoration-color: rgba(204, 46, 57, 1);
}

.mdz-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.mdz-cookie-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  font-family: 'Montserrat', 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.mdz-cookie-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.mdz-cookie-btn--accept {
  background: #cc2e39;
  border-color: #cc2e39;
}

.mdz-cookie-btn--accept:hover {
  background: #b8242e;
  border-color: #b8242e;
}

.mdz-cookie-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
}

.mdz-cookie-btn:focus-visible {
  outline: 2px solid #cccc25;
  outline-offset: 3px;
}

.mdz-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
}

.mdz-cookie-overlay[hidden] {
  display: none !important;
}

.mdz-cookie-modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #ffffff;
  color: #1a211e;
  border-radius: 18px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 32px 96px rgba(6, 23, 47, 0.45);
  border: 1px solid rgba(26, 33, 30, 0.08);
}

.mdz-cookie-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.mdz-cookie-modal__title {
  margin: 0;
  font-family: 'Playfair Display', ui-serif, Georgia, serif;
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #000000;
}

.mdz-cookie-modal__close {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(26, 33, 30, 0.14);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: #1a211e;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mdz-cookie-modal__close:hover {
  background: rgba(26, 33, 30, 0.06);
}

.mdz-cookie-modal__close:focus-visible {
  outline: 2px solid #cc2e39;
  outline-offset: 2px;
}

.mdz-cookie-modal__lead {
  margin: 0 0 18px;
  color: #606562;
  font-size: 15px;
  line-height: 1.7;
}

.mdz-cookie-modal__lead a {
  color: #184987;
  text-decoration: underline;
}

.mdz-cookie-categories {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.mdz-cookie-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(26, 33, 30, 0.10);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.mdz-cookie-cat__title {
  margin: 0 0 4px;
  font-family: 'Montserrat', 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a211e;
}

.mdz-cookie-cat__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #606562;
}

.mdz-cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  align-self: center;
}

.mdz-cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.mdz-cookie-switch__slider {
  position: absolute;
  inset: 0;
  background: rgba(26, 33, 30, 0.22);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.mdz-cookie-switch__slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.mdz-cookie-switch input:checked + .mdz-cookie-switch__slider {
  background: #cc2e39;
}

.mdz-cookie-switch input:checked + .mdz-cookie-switch__slider::before {
  transform: translateX(18px);
}

.mdz-cookie-switch input:disabled + .mdz-cookie-switch__slider {
  background: rgba(26, 33, 30, 0.4);
  cursor: not-allowed;
}

.mdz-cookie-switch input:focus-visible + .mdz-cookie-switch__slider {
  outline: 2px solid #cc2e39;
  outline-offset: 2px;
}

.mdz-cookie-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(26, 33, 30, 0.08);
}

.mdz-cookie-modal__actions .mdz-cookie-btn {
  color: #1a211e;
  border-color: rgba(26, 33, 30, 0.18);
}

.mdz-cookie-modal__actions .mdz-cookie-btn:hover {
  border-color: rgba(26, 33, 30, 0.5);
  background: rgba(26, 33, 30, 0.04);
}

.mdz-cookie-modal__actions .mdz-cookie-btn--accept,
.mdz-cookie-modal__actions .mdz-cookie-btn--primary {
  background: #1a211e;
  border-color: #1a211e;
  color: #ffffff;
}

.mdz-cookie-modal__actions .mdz-cookie-btn--accept:hover,
.mdz-cookie-modal__actions .mdz-cookie-btn--primary:hover {
  background: #111815;
  border-color: #111815;
}

@media (max-width: 720px) {
  .mdz-cookie-banner {
    inset: auto 14px 14px 14px;
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .mdz-cookie-banner__actions {
    justify-content: stretch;
  }
  .mdz-cookie-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .mdz-cookie-modal {
    border-radius: 14px;
    padding: 22px;
  }
  .mdz-cookie-cat {
    grid-template-columns: 1fr;
  }
  .mdz-cookie-switch {
    justify-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mdz-cookie-btn,
  .mdz-cookie-switch__slider,
  .mdz-cookie-switch__slider::before {
    transition: none;
  }
}

/* Inline link inside footer to (re)open the preferences. */
.footer a.cookie-settings-link {
  cursor: pointer;
}
