/* E-Beleg dialog
 *
 * Keep these rules scoped to the E-Beleg dialog. The cookie settings dialog
 * intentionally shares the legacy .cn-modal class but has a different layout.
 */

#modalEbelegBlock {
  box-sizing: border-box;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 4vw, 40px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: var(--main-dark-text-color);
}

#modalEbelegBlock[open] {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#modalEbelegBlock::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

#modalEbelegBlock .ebeleg-m-content {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: min(600px, 100%);
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid #888;
  border-radius: var(--main-button-border-radius);
  background: var(--main-grey-background-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.19);
  animation: none;
}

@keyframes ebeleg-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

#modalEbelegBlock .ebeleg-modal-header {
  box-sizing: border-box;
  display: block;
  padding: 34px 42px 0;
  border-radius: var(--main-button-border-radius) var(--main-button-border-radius) 0 0;
  background: var(--main-grey-background-color);
}

#modalEbelegBlock .ebeleg-modal-header__inner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 24px;
}

#modalEbelegBlock .ebeleg-modal-logo-link {
  display: block;
  flex: 0 1 204px;
  min-width: 0;
  line-height: 0;
}

#modalEbelegBlock .ebeleg-modal-logo {
  display: block;
  width: 100%;
  max-width: 204px;
  height: auto;
}

#modalEbelegBlock #textEBELEG {
  flex: 0 0 auto;
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1.75px;
  white-space: nowrap;
}

#modalEbelegBlock .ebeleg-close {
  position: absolute;
  z-index: 30;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
  scale: none;
}

#modalEbelegBlock .ebeleg-close img {
  display: block;
  width: 32px;
  height: 32px;
}

#modalEbelegBlock .ebeleg-modal-body {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 30px 42px 34px;
  gap: 24px;
}

#modalEbelegBlock .field-info {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

#modalEbelegBlock .field-info input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 11px 48px 11px 12px;
  border: 1px solid var(--dark-main-any-color);
  border-radius: 4px;
  background: var(--main-light-background-color);
  color: var(--main-dark-text-color);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}

#modalEbelegBlock .field-info input:focus-visible,
#modalEbelegBlock button:focus-visible {
  outline: 2px solid #1677c8;
  outline-offset: 2px;
}

#modalEbelegBlock .field-info .info-btn {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  scale: none;
}

#modalEbelegBlock .field-info .info-btn img {
  display: block;
  width: 26px;
  height: 26px;
}

#modalEbelegBlock .required-text {
  margin: 7px 0 0;
  color: var(--accent-text-color);
  font-size: 13px;
  line-height: 18px;
}

#modalEbelegBlock .ebeleg-submit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: auto;
  min-height: 38px;
  margin: 8px 0 0;
  padding: 10px 18px;
  gap: 12px;
  border: 0;
  border-radius: var(--main-button-border-radius);
  color: var(--main-light-text-color);
  background: var(--accent-background-color);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-size-4);
  line-height: 18px;
  letter-spacing: 0.75px;
}

#modalEbelegBlock .ebeleg-submit:hover {
  background: var(--accent-hover-color);
}

#modalEbelegBlock .ebeleg-submit img {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  scale: none;
}

#modalEbelegBlock .info-block {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  box-sizing: border-box;
  display: none;
  grid-template-columns: 24px minmax(0, 1fr) 22px;
  width: min(320px, 100%);
  max-width: 100%;
  margin: 0;
  padding: 14px;
  gap: 10px;
  border-radius: var(--main-button-border-radius);
  background: var(--main-dark-background-color);
  color: var(--main-light-text-color);
  box-shadow: var(--tile-shadow-box);
  animation: ebeleg-fade-in 120ms ease-out both;
}

#modalEbelegBlock .info-block[aria-hidden="false"] {
  display: grid !important;
}

#modalEbelegBlock .info-block .column {
  min-width: 0;
}

#modalEbelegBlock .info-block .column > img {
  display: block;
  width: 24px;
  height: 24px;
}

#modalEbelegBlock .info-block .column span {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

#modalEbelegBlock .info-block .column p {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

#modalEbelegBlock .info-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
}

#modalEbelegBlock .info-close img {
  display: block;
  width: 18px;
  height: 18px;
}

#modalEbelegBlock .bottom-arrow {
  position: absolute;
  inset: 0;
  border: 0;
  pointer-events: none;
}

#modalEbelegBlock .bottom-arrow::after,
#modalEbelegBlock .bottom-arrow.second::after {
  position: absolute;
  top: -9px;
  right: 12px;
  left: auto;
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-bottom: 9px solid var(--main-dark-background-color);
  border-left: 9px solid transparent;
  border-top: 0;
  transform: none;
}

#modalEbelegBlock .noti-block {
  position: absolute;
  z-index: 25;
  inset: 0;
  box-sizing: border-box;
  width: auto;
  height: auto;
  margin: 0;
  padding: 24px;
  border-radius: 0 0 var(--main-button-border-radius) var(--main-button-border-radius);
  background: var(--main-dark-background-color);
}

#modalEbelegBlock #errorBlock {
  /* Overlay the existing form without changing its layout or modal size. */
  inset: 12px 20px 18px;
  border: 1px solid #333;
  border-radius: 10px;
  background: rgba(51, 51, 51, 0.9);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#modalEbelegBlock #errorBlock .row p {
  max-width: 430px;
  margin: 0 auto;
  color: var(--main-light-text-color);
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

#modalEbelegBlock #errorBlock .button {
  margin: 0;
}

#modalEbelegBlock #datepickerBlock > .pika-single {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
}

#modalEbelegBlock #datepickerBlock > .pika-single .pika-lendar {
  max-width: calc(100vw - 34px);
}

#modalEbelegBlock .is-selected .pika-button,
#modalEbelegBlock .has-event .pika-button,
#modalEbelegBlock .pika-button:hover,
#modalEbelegBlock .pika-row.pick-whole-week:hover .pika-button {
  color: var(--main-light-text-color) !important;
}

@media (max-width: 700px) {
  #modalEbelegBlock {
    padding: 12px;
  }

  #modalEbelegBlock .ebeleg-modal-header {
    padding: 36px 16px 0;
  }

  #modalEbelegBlock .ebeleg-modal-header__inner {
    gap: 10px;
  }

  #modalEbelegBlock .ebeleg-modal-logo-link {
    flex-basis: clamp(126px, 42vw, 146px);
  }

  #modalEbelegBlock .ebeleg-modal-logo {
    max-width: 146px;
  }

  #modalEbelegBlock #textEBELEG {
    font-size: clamp(20px, 6.4vw, 24px);
    letter-spacing: 1px;
  }

  #modalEbelegBlock .ebeleg-close,
  #modalEbelegBlock .ebeleg-close img {
    width: 28px;
    height: 28px;
  }

  #modalEbelegBlock .ebeleg-close {
    top: 7px;
    right: 7px;
  }

  #modalEbelegBlock .ebeleg-modal-body {
    padding: 24px 16px 26px;
    gap: 18px;
  }

  #modalEbelegBlock .ebeleg-submit {
    min-height: 36px;
    margin-top: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 16px;
  }

  #modalEbelegBlock .noti-block {
    padding: 16px;
  }

  #modalEbelegBlock #errorBlock {
    inset: 12px 6px 12px;
  }
}

@media (min-width: 1280px) {
  #modalEbelegBlock .info-block {
    top: 50%;
    right: auto;
    left: calc(100% + 12px);
    transform: translateY(-50%);
  }

  #modalEbelegBlock .bottom-arrow::after,
  #modalEbelegBlock .bottom-arrow.second::after {
    top: calc(50% - 9px);
    right: auto;
    left: -9px;
    border-top: 9px solid transparent;
    border-right: 9px solid var(--main-dark-background-color);
    border-bottom: 9px solid transparent;
    border-left: 0;
  }
}

@media (max-width: 340px) {
  #modalEbelegBlock .ebeleg-modal-logo-link {
    flex-basis: 124px;
  }

  #modalEbelegBlock #textEBELEG {
    font-size: 19px;
  }
}

@media (max-height: 420px) {
  #modalEbelegBlock {
    padding: 8px;
  }

  #modalEbelegBlock .ebeleg-modal-header {
    padding-top: 30px;
  }

  #modalEbelegBlock .ebeleg-modal-body {
    padding-top: 14px;
    padding-bottom: 16px;
    gap: 12px;
  }

  #modalEbelegBlock .ebeleg-submit {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #modalEbelegBlock .info-block {
    animation: none;
  }
}
