.aat-modal[hidden] {
  display: none !important;
}

body.aat-modal-open {
  overflow: hidden;
}

.aat-modal {
  --aat-primary: var(--color-primary, #2228c9);
  --aat-accent: var(--color-accent, #cf0101);
  --aat-bg: var(--color-bg, #ffffff);
  --aat-text: var(--color-text, #141414);
  --aat-surface: var(--color-surface, #f5f7fb);
  --aat-muted: var(--color-muted, #5f6473);
  --aat-radius-lg: var(--radius-lg, 1.5rem);
  --aat-shadow: var(--shadow-soft, 0 18px 48px rgba(20, 20, 20, 0.12));
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 18px;
  font-family: "Sora", "Trebuchet MS", sans-serif;
}

.aat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.66);
  backdrop-filter: blur(3px);
}

.aat-modal__dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border-radius: 1.15rem;
  border: 1px solid rgba(20, 20, 20, 0.1);
  box-shadow: var(--aat-shadow);
  padding: 24px;
  color: var(--aat-text);
}

.aat-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(20, 20, 20, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: var(--aat-text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.aat-modal__close:hover {
  border-color: rgba(34, 40, 201, 0.35);
  color: var(--aat-primary);
}

.aat-modal__head {
  padding-right: 44px;
}

.aat-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--aat-accent);
  font-weight: 600;
}

.aat-modal__head h2 {
  margin: 0 0 8px;
  color: var(--aat-text);
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.aat-subline {
  margin: 0 0 18px;
  color: #343b49;
  font-size: 0.98rem;
}

.aat-stepper {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.aat-step {
  flex: 1 1 130px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 0.9rem;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4d5568;
  background: #ffffff;
}

.aat-step.is-active {
  border-color: rgba(34, 40, 201, 0.32);
  background: #edf2ff;
  color: #1f283c;
}

.aat-step.is-complete {
  border-color: rgba(20, 20, 20, 0.1);
  background: var(--aat-surface);
  color: #2f3646;
}

.aat-step__dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.aat-step.is-active .aat-step__dot,
.aat-step.is-complete .aat-step__dot {
  background: var(--aat-primary);
  border-color: var(--aat-primary);
  color: #ffffff;
}

.aat-step__label {
  font-size: 13px;
  font-weight: 600;
}

.aat-form {
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 1rem;
  padding: 18px;
  background: #ffffff;
}

.aat-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--aat-accent);
  background: #ffeef0;
  color: #8a0b17;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
}

.aat-panel {
  display: none;
}

.aat-panel.is-active {
  display: block;
}

.aat-panel h3 {
  margin: 0 0 6px;
  color: var(--aat-text);
  font-size: 1.42rem;
  line-height: 1.2;
}

.aat-panel p {
  margin: 0 0 16px;
  color: #3f4658;
}

.aat-field {
  margin: 0 0 16px;
}

.aat-field label {
  display: block;
  margin: 0 0 8px;
  color: var(--aat-text);
  font-weight: 600;
  font-size: 14px;
}

.aat-field input,
.aat-field select,
.aat-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(20, 20, 20, 0.16);
  border-radius: 0.7rem;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--aat-text);
  font-size: 0.95rem;
  font-family: inherit;
}

.aat-field input:focus,
.aat-field select:focus,
.aat-field textarea:focus {
  outline: none;
  border-color: rgba(34, 40, 201, 0.58);
  box-shadow: 0 0 0 3px rgba(34, 40, 201, 0.14);
}

.aat-field textarea {
  min-height: 94px;
  resize: vertical;
}

.aat-choice-grid {
  display: grid;
  gap: 10px;
}

.aat-choice-grid--service {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aat-choice-grid--extra {
  margin-top: 8px;
}

.aat-choice-grid--object {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aat-choice-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aat-choice {
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 0.9rem;
  background: #ffffff;
  color: var(--aat-text);
  text-align: left;
  cursor: pointer;
  padding: 12px;
  min-height: 74px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.aat-choice:hover {
  border-color: rgba(34, 40, 201, 0.4);
  transform: translateY(-1px);
}

.aat-choice.is-selected {
  border-color: var(--aat-primary);
  background: #edf2ff;
  box-shadow: inset 0 0 0 1px rgba(34, 40, 201, 0.24);
}

.aat-choice.is-locked {
  position: relative;
}

.aat-choice.is-locked::after {
  content: "Vorausgewählt";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--aat-primary);
  color: #ffffff;
  border-radius: 999px;
  padding: 3px 8px;
}

.aat-choice__title {
  display: block;
  font-weight: 700;
  font-size: 15px;
}

.aat-choice__desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #4e5872;
}

.aat-choice--compact-service {
  min-height: 58px;
  display: flex;
  align-items: center;
}

.aat-choice--compact-service .aat-choice__title {
  font-size: 14px;
}

.aat-choice--icon {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas:
    "icon title"
    "icon desc";
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-height: 92px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.aat-choice--icon .aat-choice__icon-wrap {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f283c;
  border: 1px solid rgba(20, 20, 20, 0.08);
}

.aat-choice--icon .aat-choice__title {
  grid-area: title;
}

.aat-choice--icon .aat-choice__desc {
  grid-area: desc;
  margin-top: 0;
}

.aat-choice__icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aat-choice--private .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #e8eeff, #f0f4ff);
}

.aat-choice--business .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #e9f4ff, #f1f8ff);
}

.aat-choice--weg .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #efeaff, #f6f3ff);
}

.aat-choice--newbuild .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #e7f1ff, #f0f6ff);
}

.aat-choice--existing .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #ecf2f9, #f4f7fb);
}

.aat-choice--renovation .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #eaf1ff, #f3f7ff);
}

.aat-choice--unsure .aat-choice__icon-wrap {
  background: linear-gradient(160deg, #edf1f8, #f4f7fc);
}

.aat-choice--icon.is-selected .aat-choice__icon-wrap {
  background: var(--aat-primary);
  border-color: var(--aat-primary);
  color: #ffffff;
}

.aat-nav {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.aat-btn {
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.aat-btn:hover {
  transform: translateY(-2px);
}

.aat-btn--primary {
  background: var(--aat-primary);
  color: #ffffff;
  border-color: var(--aat-primary);
  margin-left: auto;
}

.aat-btn--ghost {
  background: transparent;
  color: var(--aat-text);
  border-color: rgba(20, 20, 20, 0.22);
}

.aat-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.aat-btn:disabled:hover {
  transform: none;
}

.aat-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.aat-extra-services {
  margin-top: 8px;
}

.aat-extra-services__hint {
  margin: 0 0 10px;
  color: #4d5568;
  font-size: 13px;
}

.aat-selected-services {
  margin-bottom: 10px;
}

.aat-selected-services__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 26px;
}

.aat-selected-services__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  background: #f3f6fd;
  color: #25314a;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.aat-selected-services__badge.is-locked {
  background: var(--aat-primary);
  border-color: var(--aat-primary);
  color: #ffffff;
}

.aat-selected-services__empty {
  color: #4d5568;
  font-size: 13px;
}

.aat-service-details__list {
  display: grid;
  gap: 10px;
}

.aat-service-details__empty {
  margin: 0;
  color: #4d5568;
  font-size: 13px;
}

.aat-service-detail-card {
  border: 1px solid rgba(20, 20, 20, 0.1);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  padding: 12px;
}

.aat-service-detail-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  color: #1f283c;
}

.aat-service-detail-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.aat-service-detail-field {
  display: block;
  margin: 0;
}

.aat-service-detail-field__label {
  display: block;
  margin: 0 0 6px;
  color: var(--aat-text);
  font-weight: 600;
  font-size: 13px;
}

.aat-service-detail-field textarea {
  min-height: 74px;
  resize: vertical;
}

.aat-service-detail-field--full {
  margin-top: 10px;
}

.aat-field--full {
  grid-column: 1 / -1;
}

.aat-consent {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
  color: #2f3646;
}

.aat-consent input {
  margin-top: 3px;
}

.aat-success {
  border: 1px solid rgba(20, 20, 20, 0.1);
  border-radius: 1rem;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%);
}

.aat-success h3 {
  margin: 0 0 8px;
  color: var(--aat-text);
  font-size: 1.5rem;
}

.aat-success p {
  margin: 0 0 12px;
  color: #3d4454;
}

.aat-success__meta {
  margin-bottom: 16px;
}

@media (max-width: 920px) {
  .aat-choice-grid--service {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aat-choice-grid--object {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aat-choice-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aat-service-detail-card__grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .aat-modal {
    padding: 10px;
  }

  .aat-modal__dialog {
    padding: 16px;
    border-radius: 0.95rem;
    max-height: 95vh;
  }

  .aat-form {
    padding: 14px;
  }

  .aat-choice-grid--service,
  .aat-choice-grid--object,
  .aat-choice-grid--compact,
  .aat-form-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .aat-nav {
    flex-direction: column;
  }

  .aat-btn--primary,
  .aat-btn--ghost {
    width: 100%;
    margin-left: 0;
  }
}
