/* Angebots-Konfigurator auf der Unternehmensgruppen-Landingpage.
 *
 * Steht bewusst auf dem weissen Seitengrund - kein eigenes Panel, kein
 * farbiger Kasten. Der Bereich soll wie ein Teil der Seite wirken und nicht
 * wie ein eingesetztes Kontaktformular, deshalb tragen hier Weissraum,
 * Typografie und sehr dezente Schatten die Hierarchie.
 *
 * Alle Farben kommen aus dem gemeinsamen Designsystem (style.css):
 * --brand ist das Meissner-Rot, --text/--headline-tone das Anthrazit.
 */

.angebot {
  /* Clears the sticky header when a button jumps here (#angebot). */
  scroll-margin-top: 40px;
  padding: 72px 0 84px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.angebot .section-header {
  max-width: 62ch;
}

.angebot .section-header h2 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.angebot .section-header p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
  font-size: clamp(15px, 1.2vw, 17px);
}

/* ------------------------------------------------------------ Schritt 1 */

.ak-services {
  border: 0;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}

/* Die eigentliche Checkbox bleibt im DOM und bedienbar - sie wird nur
   optisch hinter die Karte gelegt. Dadurch funktionieren Tab, Leertaste,
   Screenreader und das :checked/:focus-visible-Styling ohne eine Zeile
   JavaScript; die Karte ist ein <label>, kein nachgebauter Button. */
.ak-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px 24px;
  background: #fff;
  border: 1px solid rgba(24,25,27, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

.ak-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.ak-card__icon {
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  color: var(--brand);
}

.ak-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ak-card__title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.005em;
  padding-right: 34px;
}

.ak-card__desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* Haken sitzt oben rechts und wird beim Auswaehlen eingeblendet. */
.ak-card__check {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(24,25,27, 0.18);
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-smooth);
}

.ak-card__check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--transition-base), transform var(--transition-smooth);
}

@media (hover: hover) {
  .ak-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(24,25,27, 0.2);
  }
  .ak-card:hover .ak-card__check {
    border-color: rgba(207, 31, 40, 0.45);
  }
}

.ak-card:has(input:checked) {
  border-color: var(--brand);
  transform: translateY(-6px);
  box-shadow:
    0 18px 40px rgba(20, 26, 33, 0.12),
    0 0 0 3px rgba(207, 31, 40, 0.1);
}

.ak-card:has(input:checked) .ak-card__check {
  background: var(--brand);
  border-color: var(--brand);
}

.ak-card:has(input:checked) .ak-card__check svg {
  opacity: 1;
  transform: scale(1);
}

/* Sichtbarer Fokus liegt auf der KARTE, nicht auf der versteckten Checkbox -
   sonst waere die Tastaturbedienung unsichtbar. */
.ak-card:has(input:focus-visible) {
  outline: 3px solid rgba(207, 31, 40, 0.5);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ Schritt 2 */

/* Die Auswahlliste faehrt auf. Animiert wird grid-template-rows von 0fr auf
   1fr: das ist der einzige Weg, eine Hoehe von 0 auf "so hoch wie noetig" zu
   animieren, ohne die Hoehe vorher in Pixeln zu kennen. */
.ak-summary {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows var(--transition-smooth),
    opacity var(--transition-smooth),
    margin-top var(--transition-smooth);
}

.ak-summary > div {
  overflow: hidden;
  min-height: 0;
}

.ak-summary.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 30px;
}

.ak-summary h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.ak-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ak-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px 9px 15px;
  border: 1px solid rgba(207, 31, 40, 0.28);
  background: rgba(207, 31, 40, 0.05);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  animation: ak-chip-in var(--transition-smooth) both;
}

.ak-chip.is-leaving {
  animation: ak-chip-out 180ms both;
}

@keyframes ak-chip-in {
  from { opacity: 0; transform: translateY(6px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}

@keyframes ak-chip-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-4px) scale(0.94); }
}

.ak-chip__tick {
  color: var(--brand);
  display: grid;
  place-items: center;
}

.ak-chip__tick svg { width: 13px; height: 13px; display: block; }

/* Entfernen-Knopf im Chip: die Auswahl muss jederzeit aenderbar sein, auch
   ohne zurueck zu den Karten zu scrollen. */
.ak-chip__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.ak-chip__remove svg { width: 11px; height: 11px; display: block; }

.ak-chip__remove:hover {
  background: rgba(207, 31, 40, 0.12);
  color: var(--brand);
}

.ak-chip__remove:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ Schritt 3 */

.ak-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.ak-open {
  font-size: 13px;
  padding: 15px 34px;
  min-height: 50px;
  border-radius: var(--radius-btn);
}

.ak-open[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.ak-open[disabled]:hover { background: var(--brand); }

.ak-hint {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
}

.ak-hint a { color: var(--brand); font-weight: 700; }

/* ------------------------------------------------------------ Schritt 4 */

.ak-form-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 420ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease,
    margin-top 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ak-form-wrap > div { overflow: hidden; min-height: 0; }

/* Im zugeklappten Zustand ist die Zeile 0px hoch und der Inhalt per
   overflow:hidden abgeschnitten - trotzdem zaehlte das Formular weiter in die
   SCROLLHOEHE des Dokuments hinein. Ergebnis: rund 500px leerer Raum unter dem
   Footer, in den man scrollen konnte. overflow:hidden auf dem Wrapper behebt
   das nicht; erst `contain` nimmt den Teilbaum aus der Groessenberechnung
   heraus.
   Gesetzt wird es nur, wenn wirklich zu ist - waehrend der Auf-/Zuklapp-
   Animation muss der Inhalt messbar bleiben, sonst gibt es nichts zu
   animieren. Das Umschalten macht konfigurator.js. */
.ak-form-wrap.is-collapsed > div { contain: size layout; }

.ak-form-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 40px;
}

.ak-form {
  border: 1px solid rgba(24,25,27, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.4vw, 42px);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.ak-form__head {
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.ak-form__head h3 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
}

.ak-scope-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.ak-multi-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  background: rgba(207, 31, 40, 0.045);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}

.ak-grid {
  display: grid;
  gap: 18px 20px;
  grid-template-columns: repeat(2, 1fr);
}

.ak-field { display: flex; flex-direction: column; gap: 7px; }
.ak-field--full { grid-column: 1 / -1; }

.ak-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ak-field label .ak-opt {
  font-weight: 500;
  color: var(--muted);
}

.ak-field input,
.ak-field select,
.ak-field textarea {
  font: inherit;
  font-size: 15.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(24,25,27, 0.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.ak-field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

.ak-field input:focus,
.ak-field select:focus,
.ak-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(207, 31, 40, 0.12);
}

.ak-field input[aria-invalid="true"],
.ak-field select[aria-invalid="true"],
.ak-field textarea[aria-invalid="true"] {
  border-color: var(--brand);
  background: rgba(207, 31, 40, 0.03);
}

.ak-error {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-2);
  min-height: 0;
}

.ak-error:empty { display: none; }

/* Datei-Feld: das native input ist unbrauchbar zu gestalten, also wird es
   versteckt und ueber sein Label bedient - das Label bleibt ein echtes
   <label for>, damit Tastatur und Screenreader es weiter erreichen. */
.ak-file input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.ak-file__drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1.5px dashed rgba(24,25,27, 0.22);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14.5px;
  cursor: pointer;
  transition: border-color var(--transition-base), background-color var(--transition-base);
}

.ak-file__drop svg { width: 20px; height: 20px; flex: none; color: var(--brand); }

.ak-file__drop:hover { border-color: var(--brand); background: rgba(207, 31, 40, 0.03); }

.ak-file input:focus-visible + .ak-file__drop {
  outline: 3px solid rgba(207, 31, 40, 0.5);
  outline-offset: 2px;
}

.ak-file__list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.ak-file__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  background: #f6f7f9;
  border-radius: var(--radius-sm);
}

.ak-file__list li > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ak-file__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.ak-file__remove svg { width: 11px; height: 11px; display: block; }

.ak-file__remove:hover { background: rgba(207, 31, 40, 0.12); color: var(--brand); }

.ak-file__remove:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ak-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.ak-consent input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--brand);
}

.ak-consent a { color: var(--brand); font-weight: 700; }

.ak-submit-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.ak-submit { font-size: 13px; padding: 15px 36px; min-height: 50px; }
.ak-submit[disabled] { opacity: 0.6; cursor: progress; }

.ak-required-note { color: var(--muted); font-size: 13.5px; margin: 0; }

/* Sammelmeldung ueber dem Absenden-Knopf, z.B. wenn der Versand scheitert. */
.ak-formstatus {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
}

.ak-formstatus:empty { display: none; }

.ak-formstatus[data-state="error"] {
  background: rgba(207, 31, 40, 0.07);
  border-left: 3px solid var(--brand);
  color: var(--brand-2);
}

/* ------------------------------------------------- WhatsApp-Direktkontakt */

/* Faehrt nach demselben 0fr/1fr-Muster auf wie die Auswahl und das Formular. */
.ak-wa {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows var(--transition-smooth),
    opacity var(--transition-smooth),
    margin-top var(--transition-smooth);
}

.ak-wa > div { overflow: hidden; min-height: 0; }

.ak-wa.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 42px; }

.ak-wa h3 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.9vw, 21px);
  font-weight: 800;
}

.ak-wa > div > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 56ch;
}

.ak-wa__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ak-wa__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(24,25,27, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

/* Das WhatsApp-Gruen bleibt auf das Glyph beschraenkt: es macht den Dienst auf
   einen Blick erkennbar, ohne die Palette der Seite aufzubrechen. */
.ak-wa__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(37, 211, 102, 0.12);
  color: #1faa54;
}

.ak-wa__icon svg { width: 23px; height: 23px; display: block; }

.ak-wa__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.ak-wa__label {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
}

.ak-wa__num {
  color: var(--muted);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ak-wa__cta {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
}

.ak-wa__cta::after { content: " →"; }

@media (hover: hover) {
  .ak-wa__link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(207, 31, 40, 0.35);
  }
}

.ak-wa__link:focus-visible {
  outline: 3px solid rgba(207, 31, 40, 0.5);
  outline-offset: 3px;
}

/* ---------------------------------------------------------- Direktkontakt */

/* Ersetzt die fruehere eigene Kontaktseite: Anschrift, Telefon und E-Mail
   stehen direkt unter dem Konfigurator, ohne dass jemand die Seite wechseln
   muss. Immer sichtbar - anders als die WhatsApp-Liste haengt das nicht an
   einer Auswahl. */
.ak-direct {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 18px 34px;
  grid-template-columns: minmax(200px, 0.8fr) 2fr;
  align-items: start;
  scroll-margin-top: 110px;
}

.ak-direct h3 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.9vw, 21px);
  font-weight: 800;
}

.ak-direct > div > p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.ak-direct__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ak-direct__list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid rgba(24,25,27, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.ak-direct__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ak-direct__list a,
.ak-direct__list address {
  font-style: normal;
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--headline-tone, #23272e);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ak-direct__list a:hover { color: var(--brand); }

.ak-direct__list a:focus-visible {
  outline: 3px solid rgba(207, 31, 40, 0.5);
  outline-offset: 3px;
  border-radius: 4px;
}

.ak-direct__list .ak-direct__more {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
}

.ak-direct__more::after { content: " →"; }

@media (max-width: 900px) {
  .ak-direct { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------- Danke-Zustand */

.ak-done {
  text-align: center;
  padding: clamp(34px, 5vw, 58px) 24px;
  animation: ak-done-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ak-done-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.ak-done__mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
}

.ak-done__mark svg { width: 28px; height: 28px; }

.ak-done h3 {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 800;
}

.ak-done p { margin: 0 auto; color: var(--muted); max-width: 48ch; line-height: 1.7; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 900px) {
  /* Tablet: zwei Karten oben, die dritte darunter ueber die volle Breite. */
  .ak-services { grid-template-columns: repeat(2, 1fr); }
  .ak-services > .ak-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .angebot { padding: 52px 0 62px; }
  .ak-services { grid-template-columns: 1fr; gap: 14px; }
  .ak-services > .ak-card:last-child { grid-column: auto; }
  .ak-grid { grid-template-columns: 1fr; }
  .ak-actions { gap: 14px; }
  .ak-open, .ak-submit { width: 100%; }
  .ak-wa__link { flex-wrap: wrap; }
  .ak-wa__cta { margin-left: 54px; }
}

/* ------------------------------------------------- prefers-reduced-motion */

@media (prefers-reduced-motion: reduce) {
  .ak-card,
  .ak-card__check,
  .ak-card__check svg,
  .ak-summary,
  .ak-form-wrap,
  .ak-wa,
  .ak-wa__link,
  .ak-field input,
  .ak-field select,
  .ak-field textarea,
  .ak-file__drop,
  .ak-file__remove,
  .ak-chip__remove {
    transition: none;
  }
  .ak-chip, .ak-done { animation: none; }
  .ak-chip.is-leaving { animation: none; }
  .ak-card:has(input:checked),
  .ak-card:hover,
  .ak-wa__link:hover { transform: none; }
}
