/* ============================================================
 * Overlay „Suchprofil hinterlegen"
 * ------------------------------------------------------------
 * Auf dem Rechner eine zentrierte Karte, auf dem Telefon eine
 * Vollbild-Ansicht, die von unten hereinfährt.
 * ============================================================ */

.sp-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.sp-overlay[hidden] { display: none; }

.sp-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 16, 20, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: spFade .25s ease both;
}

.sp-dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper, #fff);
  border-radius: 18px;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .55);
  animation: spRein .3s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes spFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes spRein {
  from { opacity: 0; transform: translateY(18px) scale(.985) }
  to   { opacity: 1; transform: none }
}

.sp-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line, #E4E0D6);
  background: var(--paper, #fff); color: var(--ink, #1B1B1F);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s ease, color .2s ease;
}
.sp-close:hover { background: var(--ink, #1B1B1F); color: #fff; border-color: var(--ink, #1B1B1F); }
.sp-close svg { width: 17px; height: 17px; }

/* ---------- Kopf ---------- */
.sp-head { padding: 38px 40px 24px; }
.sp-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: 4px; text-transform: uppercase; color: #575759;
}
.sp-eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--red, #C8102E); }
.sp-head h2 {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(25px, 3vw, 36px); line-height: 1.12;
  letter-spacing: -.02em; margin: 16px 0 12px; color: var(--ink, #1B1B1F);
}
.sp-head h2 em {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  color: var(--red, #C8102E); font-size: 1.15em; line-height: .9;
}
.sp-head p {
  margin: 0; font-family: var(--sans-body);
  font-size: 15px; line-height: 1.65; color: var(--ink-soft, #3E3E45);
  max-width: 58ch;
}

/* ---------- Formular ---------- */
.sp-form { padding: 0 40px 38px; }

.sp-group { border: 0; margin: 0 0 20px; padding: 0; }
.sp-group legend {
  padding: 0; margin-bottom: 12px;
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink-mute, #8A8A92);
}

/* Auswahl als Chips — auf dem Telefon leichter zu treffen als Kästchen */
.sp-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-chips label { position: relative; cursor: pointer; }
.sp-chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.sp-chips span {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--line, #E4E0D6); background: var(--paper, #fff);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ink-soft, #3E3E45);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.sp-chips label:hover span { border-color: rgba(27, 27, 31, .35); }
.sp-chips input:checked + span {
  background: var(--ink, #1B1B1F); border-color: var(--ink, #1B1B1F); color: #fff;
}
.sp-chips input:focus-visible + span { outline: 2px solid var(--red, #C8102E); outline-offset: 2px; }

.sp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.sp-row.sp-drei { grid-template-columns: .8fr 1fr 1fr; }
.sp-row.sp-vier { grid-template-columns: repeat(4, 1fr); }
.sp-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sp-field.sp-wide { grid-column: 1 / -1; }

.sp-field label {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-mute, #8A8A92);
}
.sp-field input,
.sp-field select,
.sp-field textarea {
  width: 100%; padding: 13px 15px;
  border: 1px solid var(--line, #E4E0D6); border-radius: 10px;
  background: var(--cream, #FAF7F2); color: var(--ink, #1B1B1F);
  font-family: var(--sans-body); font-size: 15px; line-height: 1.4;
  transition: border-color .2s ease, background .2s ease;
}
.sp-field textarea { resize: vertical; min-height: 84px; }
.sp-field input:focus,
.sp-field select:focus,
.sp-field textarea:focus {
  outline: none; border-color: var(--ink, #1B1B1F); background: var(--paper, #fff);
}
.sp-field.fehlerhaft input,
.sp-field.fehlerhaft select,
.sp-field.fehlerhaft textarea {
  border-color: var(--red, #C8102E); background: rgba(200, 16, 46, .04);
}

.sp-trenner { border: 0; border-top: 1px solid var(--line, #E4E0D6); margin: 24px 0 22px; }

.sp-aktionen { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.sp-aktionen .btn { flex: 0 1 auto; justify-content: center; }

/* ---------- Telefon: Vollbild-Ansicht ---------- */
@media (max-width: 760px) {
  .sp-overlay { padding: 0; align-items: stretch; }
  .sp-dialog {
    max-width: none; max-height: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    animation: spHoch .32s cubic-bezier(.2, .7, .2, 1) both;
  }
  @keyframes spHoch { from { transform: translateY(100%) } to { transform: none } }

  .sp-head { padding: 30px 22px 18px; }
  .sp-close { top: 12px; right: 12px; width: 34px; height: 34px; }
  .sp-form { padding: 0 22px 30px; }

  /* Alles einspaltig — zweispaltige Zahlenfelder werden zu schmal */
  .sp-row,
  .sp-row.sp-drei,
  .sp-row.sp-vier { grid-template-columns: 1fr; gap: 12px; }

  .sp-aktionen { flex-direction: column; }
  .sp-aktionen .btn { width: 100%; }
}

/* Zwischengröße: Zahlenfelder zu zweit statt zu viert */
@media (min-width: 761px) and (max-width: 980px) {
  .sp-row.sp-vier { grid-template-columns: 1fr 1fr; }
  .sp-row.sp-drei { grid-template-columns: 1fr 1fr; }
  .sp-head { padding: 32px 28px 20px; }
  .sp-form { padding: 0 28px 32px; }
}

/* Sehr niedrige Fenster: Kopf kompakter, damit das Formular sichtbar bleibt */
@media (max-height: 620px) {
  .sp-head { padding-top: 26px; padding-bottom: 14px; }
  .sp-head p { display: none; }
}

/* Bewegung reduzieren, wenn das System es verlangt */
@media (prefers-reduced-motion: reduce) {
  .sp-backdrop, .sp-dialog { animation: none; }
}

/* Wenn das Overlay offen ist, soll die Seite dahinter nicht scrollen */
body.sp-offen { overflow: hidden; }
