/* ==========================================================================
   transformis® · Brochure Download Modal
   --------------------------------------------------------------------------
   Modaler Download-Workflow fuer ausgewaehlte CF7-Formulare.
   Form-Styling lehnt sich an .tm-whitepaper__form an (gleiche Underline-Optik).
   ========================================================================== */

/* ── Container + Backdrop ── */
.tm-brochure-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.tm-brochure-modal[aria-hidden="false"],
.tm-brochure-modal.is-open {
  display: flex;
}

.tm-brochure-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 19, 44, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ── Dialog ── */
.tm-brochure-modal__dialog {
  position: relative;
  width: min(1136px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: #F3F3F3;
  padding: 32px 32px 64px;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: tmBrochureFadeIn 220ms ease-out both;
}

@keyframes tmBrochureFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Close-Button ── */
.tm-brochure-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #000;
  line-height: 0;
  z-index: 1;
}

.tm-brochure-modal__close:hover,
.tm-brochure-modal__close:focus-visible {
  color: var(--tm-blue, #05132C);
  outline: none;
}

/* ── Inner-Layout: zwei Spalten ── */
.tm-brochure-modal__inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 64px;
  margin: 0 auto;
  width: 100%;
  max-width: 1000px;
  padding-top: 16px;
}

/* ── Bild (links) ── */
.tm-brochure-modal__image {
  flex: 0 0 355px;
  max-width: 355px;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.25));
}

.tm-brochure-modal__image img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Content (rechts) ── */
.tm-brochure-modal__content {
  flex: 1 1 472px;
  max-width: 472px;
  min-width: 0;
}

/* ── Typo: Titel ── */
.tm-brochure-modal__title {
  font-family: "Open Sans", sans-serif;
  font-weight: 300;
  font-size: 40px;
  line-height: 1.3;
  color: var(--tm-blue, #05132C);
  margin: 0 0 32px;
}

/* ── Typo: Subline ── */
.tm-brochure-modal__subline {
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.6;
  color: var(--tm-blue, #05132C);
  margin: 0 0 32px;
}

/* ── Hochstellung für ® / ™ in Titel + Subline ── */
.tm-brochure-modal__sup {
  font-size: 0.55em;
  vertical-align: super;
  line-height: 0;
  font-weight: inherit;
  margin-left: 0.05em;
  top: 0; /* override globaler <sup>-Defaults, falls gesetzt */
}

/* ── Hint direkt ueber dem Form ── */
.tm-brochure-modal__hint {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tm-blue, #05132C);
  margin: 0 0 24px;
  opacity: 0.85;
}

/* ── Fallback-Link im Success-State ── */
.tm-brochure-modal__fallback {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tm-blue, #05132C);
  margin: 24px 0 0;
}

.tm-brochure-modal__fallback-link {
  color: var(--tm-blue, #05132C);
  text-decoration: underline;
}

.tm-brochure-modal__fallback-link:hover {
  text-decoration: none;
}

/* ==========================================================================
   CF7-Form innerhalb des Modals
   --------------------------------------------------------------------------
   Selektoren spiegeln .tm-whitepaper__form, damit die gleiche Underline-Optik
   greift, ohne das Whitepaper-CSS zu kapern.
   ========================================================================== */

.tm-brochure-modal__form input[type="text"],
.tm-brochure-modal__form input[type="email"],
.tm-brochure-modal__form input[type="tel"],
.tm-brochure-modal__form input[type="url"],
.tm-brochure-modal__form input[type="number"],
.tm-brochure-modal__form textarea,
.tm-brochure-modal__form select {
  width: 100% !important;
  height: 44px !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-bottom: 1px solid #95A4BD !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  line-height: 44px !important;
  color: var(--tm-blue, #05132C) !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease;
  margin: 0 0 24px !important;
}

.tm-brochure-modal__form textarea {
  height: auto !important;
  min-height: 88px !important;
  line-height: 1.5 !important;
  padding-top: 10px !important;
}

.tm-brochure-modal__form input[type="text"]:focus,
.tm-brochure-modal__form input[type="email"]:focus,
.tm-brochure-modal__form input[type="tel"]:focus,
.tm-brochure-modal__form input[type="url"]:focus,
.tm-brochure-modal__form input[type="number"]:focus,
.tm-brochure-modal__form textarea:focus,
.tm-brochure-modal__form select:focus {
  border-bottom-color: var(--tm-blue, #05132C) !important;
}

.tm-brochure-modal__form input::placeholder,
.tm-brochure-modal__form textarea::placeholder {
  color: var(--tm-blue, #05132C);
  font-weight: 400;
  opacity: 1;
}

/* ── Label-Style: "schwebende" Labels (im Design ueber Inputs) ── */
.tm-brochure-modal__form label {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tm-blue, #05132C);
  display: block;
  margin-bottom: 4px;
}

/* ── Links innerhalb des Formulars (z. B. Datenschutz) im Corporate-Blau ── */
.tm-brochure-modal__form a,
.tm-brochure-modal__form a:link,
.tm-brochure-modal__form a:visited {
  color: var(--tm-blue, #05132C) !important;
  text-decoration: underline;
}

.tm-brochure-modal__form a:hover {
  text-decoration: none;
}

/* ── Checkbox (Newsletter-Optin / Acceptance) ──
   Markup CF7:
     <span class="wpcf7-list-item">
       <label>
         <input type="checkbox">
         <span class="wpcf7-list-item-label">…langer Text…</span>
       </label>
     </span>
   Wir machen <label> zum Flex-Container, damit Folgezeilen NICHT unter die
   Checkbox rutschen, sondern neben ihr weiterlaufen. */
.tm-brochure-modal__form .wpcf7-acceptance,
.tm-brochure-modal__form .wpcf7-checkbox {
  display: block !important;
  margin: 0 0 24px !important;
}

.tm-brochure-modal__form .wpcf7-form-control-wrap {
  display: block !important;
  margin: 0 !important;
}

.tm-brochure-modal__form .wpcf7-list-item {
  margin: 0 !important;
  display: block !important;
}

.tm-brochure-modal__form .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 0;
}

.tm-brochure-modal__form .wpcf7-list-item-label {
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tm-blue, #05132C);
  font-weight: 400;
  flex: 1 1 auto;
  min-width: 0;
}

.tm-brochure-modal__form input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  margin: 4px 0 0 0 !important;
  padding: 0 !important;
  border: 1px solid var(--tm-blue, #05132C) !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-radius: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  cursor: pointer;
  position: relative;
  box-shadow: none !important;
  outline: none !important;
}

.tm-brochure-modal__form input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--tm-blue, #05132C);
  border-bottom: 2px solid var(--tm-blue, #05132C);
  transform: rotate(45deg);
}

.tm-brochure-modal__form input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--tm-blue, #05132C) !important;
  outline-offset: 2px;
}

/* ── Submit-Button (Brand-Gruen) ── */
.tm-brochure-modal__form input[type="submit"],
.tm-brochure-modal__form button[type="submit"],
.tm-brochure-modal__form .wpcf7-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: 44px !important;
  padding: 12px 20px !important;
  background: #ABFF00 !important;
  background-color: #ABFF00 !important;
  background-image: none !important;
  color: var(--tm-blue, #05132C) !important;
  border: 1px solid #ABFF00 !important;
  border-radius: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  line-height: 1.6 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-shadow: none !important;
  cursor: pointer !important;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-top: 8px !important;
  box-shadow: none !important;
  outline: none !important;
}

.tm-brochure-modal__form input[type="submit"]:hover,
.tm-brochure-modal__form button[type="submit"]:hover,
.tm-brochure-modal__form .wpcf7-submit:hover {
  background: color-mix(in srgb, #ABFF00, black 10%) !important;
  background-color: color-mix(in srgb, #ABFF00, black 10%) !important;
  border-color: color-mix(in srgb, #ABFF00, black 10%) !important;
}

.tm-brochure-modal__form p  { margin: 0 !important; padding: 0 !important; line-height: 1 !important; }
.tm-brochure-modal__form br { display: none !important; }

.tm-brochure-modal__form .wpcf7-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

/* ==========================================================================
   CF7-Meldungen (Validation + globale Response)
   --------------------------------------------------------------------------
   Schriftart, Farben, Padding angeglichen an das Modal-Design.
   ========================================================================== */

/* Feld mit Validation-Fehler: roter Underline, sonst keine Aenderung. */
.tm-brochure-modal__form .wpcf7-not-valid {
  border-bottom-color: #dc3232 !important;
}

/* Wenn Input ungueltig: Margin-Bottom reduzieren, damit der Tip direkt
   unter der Underline sitzt (nicht 24px weiter unten). */
.tm-brochure-modal__form input.wpcf7-not-valid,
.tm-brochure-modal__form textarea.wpcf7-not-valid,
.tm-brochure-modal__form select.wpcf7-not-valid {
  margin-bottom: 4px !important;
}

/* Inline-Hinweis direkt unter dem fehlerhaften Feld
   --------------------------------------------------------------------------
   Tip erscheint im natuerlichen Fluss UNTER dem Input. Kein negatives
   Margin mehr (das hatte den Tip auf die Underline gezogen). */
.tm-brochure-modal__form .wpcf7-not-valid-tip {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #dc3232 !important;
  margin: 0 0 24px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* Globale Response unter dem Submit
   --------------------------------------------------------------------------
   Default = ERROR-Look (rot), weil das die haeufigste sichtbare Variante ist.
   Success ueberschreibt das explizit (siehe unten). */
.tm-brochure-modal__form .wpcf7-response-output {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #dc3232 !important;
  margin: 16px 0 0 !important;
  padding: 12px 16px !important;
  border: 1px solid #dc3232 !important;
  border-radius: 0 !important;
  background: rgba(220, 50, 50, 0.06) !important;
}

/* Verstecker-Klasse von CF7 (init/sent state ohne Message): wirklich aus */
.tm-brochure-modal__form .wpcf7-response-output.wpcf7-display-none {
  display: none !important;
  visibility: hidden !important;
}

/* Erfolg (mailsent / wpcf7-mail-sent-ok): blau + gruen (Brand-Farben).
   Mehrere Selektor-Varianten fuer max. Robustheit ueber CF7-Versionen. */
.tm-brochure-modal__form form.sent .wpcf7-response-output,
.tm-brochure-modal__form .wpcf7-response-output.wpcf7-mail-sent-ok {
  border-color: var(--tm-blue, #05132C) !important;
  background: var(--tm-blue, #05132C) !important;
  color: #ABFF00 !important;
}

/* Acceptance-Field invalid: roter Underline beim Checkbox-Wrapper sichtbar machen */
.tm-brochure-modal__form .wpcf7-acceptance.wpcf7-not-valid .wpcf7-list-item label,
.tm-brochure-modal__form .wpcf7-form-control-wrap.wpcf7-not-valid .wpcf7-list-item label {
  color: #dc3232 !important;
}

/* Ladeanzeige (Spinner) – passt zur Farbe */
.tm-brochure-modal__form .wpcf7-spinner {
  background-color: var(--tm-blue, #05132C);
}

/* ── Body-Lock, wenn Modal offen ist ── */
body.tm-brochure-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .tm-brochure-modal__dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    padding: 104px 24px 80px;
    gap: 24px;
  }

  .tm-brochure-modal__close {
    top: 56px;
    right: 16px;
  }

  .tm-brochure-modal__inner {
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
  }

  .tm-brochure-modal__image {
    flex: 0 0 auto;
    max-width: 240px;
    margin: 0;
  }

  .tm-brochure-modal__content {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .tm-brochure-modal__title {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .tm-brochure-modal__subline {
    font-size: 16px;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .tm-brochure-modal__dialog {
    padding: 96px 16px 64px;
  }

  .tm-brochure-modal__close {
    top: 48px;
    right: 12px;
  }

  .tm-brochure-modal__title {
    font-size: 24px;
  }
}
