/* Modals – overlay mimo .page (fixed k viewportu) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 19, 18, 0.72);
  border: none;
  padding: 0;
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  max-width: calc(100vw - 48px);
  max-height: min(90vh, 960px);
  background: var(--c-paper);
  border-radius: 16px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

/* Figma 37:484 – panel 794px, text 632px @ x=81 */
.modal__dialog--pricing {
  width: 794px;
}

/* Figma 112:328 – panel 956px, text 794px @ x=81 */
.modal__dialog--privacy {
  width: 956px;
}

.modal__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 24px;
  overflow: hidden;
  background: var(--c-paper);
}

.modal__body-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 36px 81px 32px;
  color: var(--c-ink);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-padding-top: 12px;
}

.modal__footer {
  flex-shrink: 0;
  padding: 24px 81px 40px;
  background: var(--c-paper);
  border-top: 1px solid rgba(16, 19, 18, 0.06);
}

.modal__close {
  margin: 0;
}

/* —— Typografie modalů (Figma 112:328, 37:484) —— */
.modal-prose {
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 23px;
  letter-spacing: 0.15px;
  color: var(--c-ink);
  width: 100%;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.modal-prose--pricing {
  color: #20211f;
  max-width: 632px;
}

.modal-prose--privacy {
  max-width: 794px;
}

.modal-prose p,
.modal-prose ul {
  margin: 0;
}

.modal-prose ul {
  padding-left: 1.35em;
  list-style-type: disc;
}

.modal-blank {
  height: 23px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.modal-h1 {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 33px;
  line-height: 41px;
  letter-spacing: 0.33px;
  margin: 0;
}

.modal-h2 {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0;
  margin: 0;
}

.modal-h2--after-break {
  padding-top: 23px;
}

.modal-h3 {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  margin: 0;
}

.modal-subhead,
.modal-prose p.modal-subhead {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 23px;
  letter-spacing: 0.15px;
  margin: 0;
}

.modal-medium,
.modal-prose p.modal-medium,
.modal-prose .modal-medium {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 23px;
  letter-spacing: 0.15px;
  margin: 0;
}

.modal-prose span.modal-medium {
  display: inline;
}

.modal-prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.is-modal-open {
  overflow: hidden;
}

body.is-modal-open .page {
  pointer-events: none;
}

/* —— Mobil / tablet: fullscreen modal (Figma 143:1187 GDPR, 143:1195 více info) —— */
@media (max-width: 1023px) {
  .modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .modal__dialog,
  .modal__dialog--privacy,
  .modal__dialog--pricing {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .modal__body {
    padding-top: 0;
  }

  .modal__body-scroll {
    padding: 40px 16px 24px;
    box-sizing: border-box;
  }

  .modal-prose,
  .modal-prose--privacy,
  .modal-prose--pricing {
    max-width: none;
    width: 100%;
  }

  /* GDPR mobil (143:1187) — číslované sekce 22 / 30 */
  .modal-prose--privacy .modal-h3 {
    font-size: 22px;
    line-height: 30px;
  }

  /* Více informací (143:1195) — nadpisy sekcí Manrope 24 / 32, text #101312 */
  .modal-prose--pricing {
    color: var(--c-ink);
  }

  .modal-prose--pricing .modal-h2 {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: 0;
  }

  .modal__footer {
    display: flex;
    justify-content: flex-start;
    flex-shrink: 0;
    padding: 16px 16px 24px;
    border-top: none;
    background: var(--c-paper);
  }

  .modal__close {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
  }
}
