/* IGPG Anfrage: untere Kontaktleiste + Formular-Popup */

/* ---------------- Untere Kontaktleiste (Handy/Tablet) ---------------- */
.igpg-bar { display: none; }
@media (max-width: 1023px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .igpg-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98); border-top: 1px solid rgba(47, 63, 59, 0.16);
    box-shadow: 0 -10px 28px -20px rgba(47, 63, 59, 0.5);
    transition: transform .25s ease, visibility 0s linear 0s;
  }
  .igpg-bar.is-hidden { transform: translateY(110%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .igpg-bar__btn {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
    min-height: 54px; padding: 0 10px; border-radius: 12px;
    font: 700 18px/1.2 "Hanken Grotesk", system-ui, sans-serif; text-decoration: none; white-space: nowrap;
  }
  .igpg-bar__btn svg { width: 22px; height: 22px; flex-shrink: 0; }
  .igpg-bar__btn--call, .igpg-bar__btn--call:hover, .igpg-bar__btn--call:focus { background: #d75f30; color: #fff; }
  .igpg-bar__btn--msg, .igpg-bar__btn--msg:hover, .igpg-bar__btn--msg:focus { background: #536b63; color: #fff; }
}
@media (max-width: 767px) {
  /* Footer hatte Platz für die Leiste reserviert; der body-Abstand übernimmt das jetzt */
  .igpg-footer.e-con { padding-bottom: 32px !important; }
}
@media (prefers-reduced-motion: reduce) { .igpg-bar, .igpg-bar.is-hidden { transition: none; } }

/* ---------------- Popup ---------------- */
html.igpg-lock, html.igpg-lock body { overflow: hidden; }

.igpg-dialog {
  width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px);
  margin: auto; padding: 0; border: 0; border-radius: 20px; background: #fff; color: #2f3f3b;
  box-shadow: 0 40px 80px -30px rgba(20, 30, 28, 0.55);
  font-family: "Hanken Grotesk", system-ui, sans-serif; overflow: hidden;
}
.igpg-dialog::backdrop { background: rgba(31, 42, 39, 0.62); }
.igpg-dialog[open] { display: flex; flex-direction: column; animation: igpg-pop .22s ease-out; }
@keyframes igpg-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.igpg-dialog__panel { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 36px 40px 32px; }
.igpg-dialog .igpg-dialog__close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: #edf2ee; color: #2f3f3b; cursor: pointer;
}
.igpg-dialog .igpg-dialog__close:hover, .igpg-dialog .igpg-dialog__close:focus { background: #dfe7e2; color: #2f3f3b; }
.igpg-dialog .igpg-dialog__close svg { width: 22px; height: 22px; }
.igpg-dialog__kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding-right: 52px; font: 600 13px/1.3 "Montserrat", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #536b63; }
.igpg-dialog__kicker::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: #d75f30; }
.igpg-dialog__title { margin: 0 0 20px; padding-right: 48px; font: 600 26px/1.2 "Montserrat", sans-serif; letter-spacing: -.01em; color: #2f3f3b; }

/* Fortschritt */
.igpg-progress { margin-bottom: 22px; }
.igpg-progress__label { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: #5a6662; }
.igpg-progress__bars { display: flex; gap: 6px; }
.igpg-progress__bars span { flex: 1; height: 5px; border-radius: 3px; background: #e3e8e6; transition: background-color .2s ease; }
.igpg-progress__bars span.is-done { background: #536b63; }

/* Schritte */
.igpg-form { margin: 0; }
.igpg-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.igpg-step[hidden] { display: none; }
.igpg-step__title { display: block; width: 100%; margin: 0 0 18px; padding: 0; font: 600 20px/1.3 "Montserrat", sans-serif; color: #2f3f3b; }
.igpg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.igpg-field { margin-bottom: 16px; }
.igpg-field label, .igpg-field__label { display: block; margin: 0 0 6px; font-size: 15px; font-weight: 700; color: #2f3f3b; }
.igpg-opt { font-weight: 400; color: #5a6662; }
.igpg-field input, .igpg-field select, .igpg-field textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; margin: 0;
  border: 1.5px solid #d5ddd9; border-radius: 12px; background: #f5f8f6; color: #2f3f3b;
  font: 400 17px/1.4 "Hanken Grotesk", system-ui, sans-serif; box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.igpg-field textarea { min-height: 110px; resize: vertical; }
.igpg-field select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 46px;
  background: #f5f8f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23536b63' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 18px;
}
.igpg-field input::placeholder, .igpg-field textarea::placeholder { color: #8a9692; }
.igpg-field input:focus, .igpg-field select:focus, .igpg-field textarea:focus { outline: none; background-color: #fff; border-color: #536b63; box-shadow: 0 0 0 3px rgba(83, 107, 99, 0.18); }
.igpg-field__hint { margin: 6px 0 0; font-size: 14px; color: #5a6662; }

/* Auswahl-Kacheln */
.igpg-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; border-radius: 16px; }
.igpg-tile { position: relative; display: block; cursor: pointer; margin: 0; }
.igpg-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.igpg-tile__box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%;
  padding: 20px; border: 1.5px solid #d5ddd9; border-radius: 14px; background: #f5f8f6;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.igpg-tile__box svg { width: 28px; height: 28px; color: #536b63; margin-bottom: 6px; }
.igpg-tile__box strong { font: 600 17px/1.3 "Montserrat", sans-serif; color: #2f3f3b; }
.igpg-tile__box small { font-size: 15px; line-height: 1.4; color: #5a6662; }
.igpg-tiles--small .igpg-tile__box { padding: 14px 16px; justify-content: center; }
.igpg-tiles--small .igpg-tile__box strong { font-size: 15px; }
.igpg-tile:hover .igpg-tile__box { border-color: #9fb1aa; background: #fff; }
.igpg-tile input:checked + .igpg-tile__box { border-color: #536b63; background: #edf2ee; box-shadow: inset 0 0 0 1px #536b63; }
.igpg-tile input:focus-visible + .igpg-tile__box { outline: 3px solid #d75f30; outline-offset: 2px; }

/* Einwilligung */
.igpg-check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 6px; font-size: 15px; line-height: 1.5; color: #2f3f3b; cursor: pointer; padding: 4px; border-radius: 10px; }
.igpg-check input { flex-shrink: 0; width: 22px; height: 22px; margin: 1px 0 0; accent-color: #536b63; }
.igpg-check a, .igpg-form__note a, .igpg-form__notice a { color: #536b63; text-decoration: underline; }

/* Fehler */
.igpg-field.has-error input, .igpg-field.has-error select, .igpg-field.has-error textarea { border-color: #b3261e; background-color: #fff; }
.igpg-tiles.has-error .igpg-tile__box { border-color: #b3261e; }
.igpg-check.has-error { box-shadow: 0 0 0 1.5px #b3261e; }
.igpg-form__error { margin: 4px 0 0; color: #b3261e; font-weight: 700; font-size: 15px; }
.igpg-form__error:empty { display: none; }
.igpg-form__notice { padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.igpg-form__notice--error { background: #fbe9e7; color: #8c1d18; }

/* Buttons */
.igpg-actions { display: flex; gap: 12px; margin-top: 18px; }
.igpg-dialog .igpg-btn {
  min-height: 50px; padding: 0 22px; border-radius: 12px; border: 1.5px solid transparent; cursor: pointer;
  font: 700 17px/1.2 "Hanken Grotesk", system-ui, sans-serif; transition: background-color .15s ease, border-color .15s ease;
}
.igpg-dialog .igpg-btn[hidden] { display: none; }
.igpg-dialog .igpg-btn--back { flex: 0 0 auto; background: #fff; color: #2f3f3b; border-color: #d5ddd9; }
.igpg-dialog .igpg-btn--back:hover, .igpg-dialog .igpg-btn--back:focus { background: #edf2ee; color: #2f3f3b; border-color: #9fb1aa; }
.igpg-dialog .igpg-btn--next { flex: 1 1 auto; background: #536b63; color: #fff; }
.igpg-dialog .igpg-btn--next:hover, .igpg-dialog .igpg-btn--next:focus { background: #2f3f3b; color: #fff; }
.igpg-dialog .igpg-btn--submit { flex: 1 1 auto; background: #d75f30; color: #fff; }
.igpg-dialog .igpg-btn--submit:hover, .igpg-dialog .igpg-btn--submit:focus { background: #c2542a; color: #fff; }
.igpg-dialog .igpg-btn:disabled { opacity: .7; cursor: progress; }
.igpg-form__note { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: #5a6662; }

.igpg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Danke-Ansicht */
.igpg-thanks { text-align: center; padding: 20px 0 4px; outline: none; }
.igpg-thanks[hidden] { display: none; }
.igpg-thanks__icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 50%; background: #edf2ee; color: #536b63; }
.igpg-thanks__icon svg { width: 34px; height: 34px; }
.igpg-thanks .igpg-dialog__title { padding: 0; margin-bottom: 12px; }
.igpg-thanks p { margin: 0 auto 24px; max-width: 440px; color: #5a6662; font-size: 17px; line-height: 1.6; }
.igpg-dialog .igpg-thanks .igpg-btn { min-width: 200px; }
.igpg-form-wrap[hidden] { display: none; }

/* Handy: Blatt von unten */
@media (max-width: 767px) {
  .igpg-dialog {
    width: 100%; max-width: 100%; max-height: calc(100dvh - 24px);
    margin: auto 0 0; border-radius: 20px 20px 0 0;
  }
  .igpg-dialog[open] { animation: igpg-sheet .28s ease-out; }
  .igpg-dialog__panel { padding: 28px 16px calc(20px + env(safe-area-inset-bottom)); }
  .igpg-dialog__title { font-size: 22px; }
  .igpg-row { grid-template-columns: 1fr; }
  .igpg-tile__box { padding: 16px 14px; }
  .igpg-tile__box small { font-size: 14px; }
}
@media (max-width: 360px) { .igpg-tiles:not(.igpg-tiles--small) { grid-template-columns: 1fr; } }
@keyframes igpg-sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .igpg-dialog[open] { animation: none; } }

/* Ohne JavaScript: Formular als normaler Abschnitt am Seitenende */
html:not(.igpg-js) .igpg-dialog {
  display: block; position: static; width: auto; max-height: none; margin: 0; border-radius: 0; box-shadow: none;
  background: #edf2ee;
}
html:not(.igpg-js) .igpg-dialog__panel { max-width: 720px; margin: 0 auto; padding: 56px 16px; overflow: visible; }
html:not(.igpg-js) .igpg-dialog__close,
html:not(.igpg-js) .igpg-progress,
html:not(.igpg-js) [data-igpg-back],
html:not(.igpg-js) [data-igpg-next] { display: none; }
html:not(.igpg-js) .igpg-step { display: block !important; margin-bottom: 18px; }
