/* Kontakt als Kartenfolge — kontakt.html (Karlos 21.10.2026).
   Ohne JavaScript bleibt das Formular ein normales Formular mit allen Feldern;
   erst die Klasse .kk-on (gesetzt von kontakt-karten.js) macht daraus die
   Schritt-fuer-Schritt-Karte. */

.kk-form {
  --kk-radius: 16px;
  --kk-ease: cubic-bezier(.2, .8, .2, 1);
  position: relative;
  border: 0;
  border-radius: var(--kk-radius);
  box-shadow: 0 1px 2px rgba(18, 39, 42, .06), var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
}

.kk-head {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: .45rem;
  text-align: center;
}

.kk-kicker {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.kk-kicker strong { color: var(--ink); }

.kk-progress {
  display: none;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kk-dots { display: inline-flex; gap: .3rem; }

.kk-dots i {
  width: .45rem;
  height: .45rem;
  border-radius: 999px;
  background: var(--line);
  transition: width .35s var(--kk-ease), background .35s var(--kk-ease);
}

.kk-dots i.is-done { background: var(--brand-strong); }
.kk-dots i.is-current { width: 1.2rem; background: var(--brand); }

.kk-step {
  grid-column: 1 / -1;
  display: grid;
  gap: .9rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.kk-q {
  margin: 0 0 .2rem;
  padding: 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.kk-hint {
  margin: -.5rem 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .92rem;
}

/* Antwortkacheln */
.kk-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.kk-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .4rem;
  min-height: 5.6rem;
  padding: .9rem .6rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform .18s var(--kk-ease), border-color .18s, box-shadow .18s, background .18s;
}

.kk-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kk-tile svg {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brand-link);
}

.kk-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(18, 39, 42, .1);
}

.kk-tile:has(input:checked) {
  border-color: var(--brand-strong);
  background: #f5fbe9;
}

.kk-tile:has(input:focus-visible) {
  outline: 3px solid rgba(116, 181, 20, .45);
  outline-offset: 2px;
}

.kk-tile.is-checked {
  border-color: var(--brand-strong);
  background: #f5fbe9;
}

.kk-tile:focus-within {
  outline: 3px solid rgba(116, 181, 20, .45);
  outline-offset: 2px;
}

/* Eingabefelder in der Karte etwas grosszuegiger */
.kk-form .field input,
.kk-form .field textarea {
  min-height: 3.1rem;
  border-radius: 12px;
  font-size: 1rem;
}

.kk-form .field textarea { min-height: 8.5rem; }

.kk-optional {
  color: var(--muted);
  font-weight: 600;
}

.kk-fields { display: grid; gap: .8rem; }

.kk-privacy {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
}

.kk-privacy input { margin-top: .25rem; accent-color: var(--brand-strong); }

.kk-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kk-summary li {
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--soft);
  color: #405055;
  font-size: .85rem;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kk-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .2rem;
}

.kk-nav .button { min-width: 9rem; border-radius: 12px; }

.kk-back {
  padding: .6rem .2rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.kk-back:hover { color: var(--ink); }

.kk-submit-plain { grid-column: 1 / -1; }

.kk-done { display: none; }

/* ── Ab hier nur mit JavaScript: Kartenfolge ─────────────────────────── */

.kk-on .kk-progress { display: inline-flex; }
.kk-on .kk-nav { display: flex; }
.kk-on .kk-submit-plain { display: none; }
.kk-on .kk-step[hidden] { display: none; }

.kk-on .kk-step > * { animation: kk-rise .5s var(--kk-ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.kk-on .kk-step.is-back > * { animation-name: kk-rise-back; }
.kk-on .kk-step.is-leaving { animation: kk-leave .22s ease-in both; }
.kk-on .kk-step.is-leaving.is-back { animation-name: kk-leave-back; }
.kk-on .kk-tiles .kk-tile { animation: kk-pop .45s var(--kk-ease) both; animation-delay: calc(120ms + var(--t, 0) * 70ms); }

/* Beim Laden unsichtbar, bis die Karte per Skript hereinfliegt */
.kk-on.kk-form.kk-loading { opacity: 0; }


/* Platzhalterbalken, bevor der Inhalt erscheint */
.kk-skeleton {
  grid-column: 1 / -1;
  display: none;
  gap: .7rem;
}

.kk-skeleton span {
  display: block;
  height: 1rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2ef 0%, #f7f9f7 50%, #eef2ef 100%);
  background-size: 200% 100%;
  animation: kk-shimmer 1s linear infinite;
}

.kk-skeleton span:first-child { width: 55%; height: 1.5rem; justify-self: center; }
.kk-skeleton .kk-skel-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.kk-skeleton .kk-skel-row span { height: 5.6rem; }

.kk-loading .kk-skeleton { display: grid; }
.kk-loading .kk-step,
.kk-loading .kk-progress { visibility: hidden; position: absolute; }

.kk-form.is-shaking { animation: kk-shake .38s ease both; }

/* Erfolgsbild */
.kk-on .kk-done:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: .55rem;
  padding: 1.2rem 0 .4rem;
  text-align: center;
}

.kk-check {
  width: 4rem;
  height: 4rem;
  animation: kk-grow .5s var(--kk-ease) both;
}

.kk-check circle { fill: #34c759; }
.kk-check path {
  fill: none;
  stroke: white;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: kk-draw .45s .35s var(--kk-ease) forwards;
}

.kk-done-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  animation: kk-rise .5s .45s var(--kk-ease) both;
}

.kk-done-text {
  margin: 0;
  color: var(--muted);
  animation: kk-rise .5s .55s var(--kk-ease) both;
}

.kk-toast {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: min(100%, 24rem);
  margin-top: .9rem;
  padding: .65rem .8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 30px rgba(18, 39, 42, .16);
  text-align: left;
  animation: kk-toast 1s 1s var(--kk-ease) both;
}

.kk-toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: var(--ink);
  color: white;
}

.kk-toast-icon svg { width: 1.1rem; height: 1.1rem; }

.kk-toast small {
  display: block;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.kk-toast strong {
  display: block;
  font-size: .9rem;
}

.kk-again { margin-top: .6rem; }

@keyframes kk-card-in {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes kk-rise {
  from { opacity: 0; transform: translate(28px, 6px); }
  to { opacity: 1; transform: none; }
}

@keyframes kk-rise-back {
  from { opacity: 0; transform: translate(-28px, 6px); }
  to { opacity: 1; transform: none; }
}

@keyframes kk-leave {
  to { opacity: 0; transform: translateX(-36px); }
}

@keyframes kk-leave-back {
  to { opacity: 0; transform: translateX(36px); }
}

@keyframes kk-pop {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}

@keyframes kk-shimmer {
  to { background-position: -200% 0; }
}

@keyframes kk-shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

@keyframes kk-grow {
  from { opacity: 0; transform: scale(.3); }
  70% { transform: scale(1.08); }
  to { opacity: 1; transform: none; }
}

@keyframes kk-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes kk-toast {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 620px) {
  /* flacher (Karlos 21.10.2026): weniger Abstand; Symbol mittig ueber dem Text, damit der Text die ganze Kachelbreite nutzt und nur einmal umbricht */
  .kk-form { padding: .9rem .85rem .8rem; row-gap: .55rem; }
  .kk-head { gap: .25rem; }
  .kk-step { gap: .6rem; }
  .kk-q { margin: 0; font-size: 1.2rem; }
  .kk-tile { gap: .3rem; min-height: 0; padding: .6rem .4rem; font-size: .98rem; line-height: 1.2; }
  .kk-tile svg { width: 1.8rem; height: 1.8rem; }
  .kk-skeleton .kk-skel-row span { height: 4.9rem; }
  .kk-form .form-note { margin: 0; font-size: .8rem; }
  .kk-form .form-status:empty { margin: 0; }
  .kk-form .field textarea { min-height: 6.5rem; }
  .kk-nav .button { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .kk-form *,
  .kk-form,
  .kk-form *::before,
  .kk-form *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* Nur fuer Screenreader */
.kk-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Link im Hero (FAQs) auf dem Foto lesbar halten */
.contact-page-hero .section-lead a {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .18em;
}

/* Sehr schmale Handys: "Allgemeine" lief bei 320 px ueber die Kachel */
.kk-tile span { min-width: 0; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 380px) {
  .kk-tile { gap: .4rem; padding: .5rem .45rem; font-size: .9rem; }
  .kk-tile svg { width: 1.5rem; height: 1.5rem; }
}

/* ── Buehne und Kartenstapel (Karlos 21.10.2026) ──────────────────────
   Die Kaesten Adresse/Kontakt/Anbindung sind weg; die Karte steht allein.
   Bei jedem Schritt fliegt sie mit Salto hinaus und die naechste herein
   (Flugbahn in kontakt-karten.js, fly()). */
.kk-stage {
  /* waagerecht abschneiden (kein Querscrollen), senkrecht frei fliegen;
     ohne clip-Unterstuetzung bleibt der Flug auf die Buehne begrenzt */
  overflow: hidden;
  overflow: clip visible;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.kk-deck {
  position: relative;
  isolation: isolate;
  width: min(100%, 34rem);
  margin: 0 auto;
}

.kk-deck .kk-form { will-change: transform; }

/* Kontakt im Fuss jeder Karte */
.kk-foot {
  grid-column: 1 / -1;
  display: grid;
  gap: .35rem;
  margin: .3rem calc(-1 * clamp(1.25rem, 3vw, 2rem)) calc(-1 * clamp(1.25rem, 3vw, 2rem));
  padding: .9rem clamp(1.25rem, 3vw, 2rem) 1rem;
  border-top: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.4;
  text-align: center;
}

.kk-foot p { margin: 0; }
.kk-foot strong { color: var(--ink); }

.kk-foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1rem;
}

.kk-foot-links a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--brand-link);
  font-weight: 800;
  text-decoration: none;
}

.kk-foot-links svg { width: 1rem; height: 1rem; }
.kk-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

@media (max-width: 620px) {
  .kk-foot { margin: .2rem -.85rem -.8rem; padding: .75rem .85rem .8rem; font-size: .8rem; }
}
