:root {
  --navy: #1a3a5c;
  --red: #6d1a34;
  --red2: #460f22;
  --sand: #f5f0e6;
  --dark: #1a2a3a;
  --muted: #4a6a7a;
  --bdr: rgba(26, 58, 92, .12);

  --modal-sm-w: 560px;
  --modal-lg-w: 680px;
}

/* BACKDROP */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 45, .65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 900;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

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

/* MODAL */
.modal {
  background: #fff;
  border-radius: 20px;
  width: auto;
  min-width: 300px;
  max-width: min(90vw, var(--modal-sm-w));
  display: inline-block;
  position: relative;

  /*
   * Zoom-Effekt:
   * Modal startet etwas kleiner und wird beim Öffnen auf normale Größe skaliert.
   */
  transform: scale(0.88);
  transform-origin: center center;
  opacity: 0;

  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(0.18, 0.89, 0.32, 1.18);

  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
  overflow: hidden;
}

.modal-backdrop.open .modal {
  transform: scale(1);
  opacity: 1;
}

/* SIZE */
.modal--sm {
  max-width: min(90vw, var(--modal-sm-w));
}

.modal--lg {
  max-width: min(92vw, var(--modal-lg-w));
}

/* HEADER */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--bdr);
}

.modal-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-header-logo {
  height: 28px;
  width: auto;
  flex: 0 0 auto;
  display: block;
}

.modal-header-title {
  color: #fff;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* BRAND HEADER */
.modal-header--brand {
  background: var(--red);
  border-bottom: none;
}

/* CLOSE */
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: none;
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.modal-close:hover {
  background: rgba(255, 255, 255, .15);
}

/* BODY */
.modal-body {
  padding: 1.5rem;
  color: var(--dark);
  line-height: 1.6;
}

.modal-body p {
  margin: 0;
}

/* FASTY MESSAGE IM MODAL */
.modal-fasty-message {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 0.75rem;

  margin: 0;
  padding: 0 !important;
}

.modal-fasty-message img {
  width: 70px !important;
  max-width: 70px !important;
  height: auto !important;
  max-height: none !important;

  object-fit: contain;
  display: block;
  justify-self: center;
}

.modal-fasty-message > * {
  min-width: 0;
}

.modal-fasty-message span {
  display: block;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--dark);
}

/* FOCUS */
.btn-modal-ok:focus,
.modal-close:focus {
  outline: 2px solid rgba(109, 26, 52, .35);
  outline-offset: 2px;
}

/* FOOTER */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, .08);

  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.btn-modal-ok {
  padding: .65rem 1.4rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: opacity .15s ease, transform .15s ease;
}

.btn-modal-ok:hover {
  opacity: .92;
}

.btn-modal-ok:active {
  transform: translateY(1px);
}

/* OPTIONAL ALERT STYLE */
.modal--alert .modal-header {
  background: var(--red);
  color: #fff;
}

.modal--alert .modal-header-title {
  color: #fff;
}

.modal--alert .btn-modal-ok {
  background: var(--red);
  color: #fff;
}

/* FORM VALIDATION */
.is-error {
  border: 1px solid red !important;
  background: aliceblue !important;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal {
    transition: none;
  }

  .modal {
    transform: scale(1);
  }

  .modal-backdrop.open .modal {
    transform: scale(1);
  }
}

/* SMALL SCREENS */
@media (max-width: 480px) {
  .modal {
    min-width: 0;
    max-width: calc(100vw - 24px);
    border-radius: 16px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-header-title {
    font-size: .72rem;
  }

  .modal-fasty-message {
    grid-template-columns: 1fr;
    text-align: center;
    gap: .8rem;
  }

  .modal-fasty-message img {
    width: 112px !important;
    max-width: 112px !important;
    margin: 0 auto;
  }

  .modal-fasty-message span {
    font-size: .95rem;
  }

  .btn-modal-ok {
    width: 100%;
  }

  .modal-footer {
    justify-content: stretch;
  }
}