/* ==========================================================================
   Kontakt-Dialog – zwei Wege: Termin oder Nachricht
   ========================================================================== */

.contact {
  width: min(62rem, 100vw - 2rem);
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--c-ivory);
  color: var(--c-ink);
  box-shadow: 0 40px 120px -40px rgb(0 0 0 / 0.7);
  overflow: auto;
  overscroll-behavior: contain;
}
.contact:focus,
.booking:focus { outline: none; }

.contact::backdrop {
  background: rgb(10 10 9 / 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.contact[open] { animation: contact-in 0.3s var(--ease-out); }
.contact[open]::backdrop { animation: backdrop-in 0.3s ease; }
@keyframes contact-in { from { opacity: 0; transform: scale(0.97) translateY(8px); } }
@keyframes backdrop-in { from { opacity: 0; } }

.contact__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.contact__close {
  position: absolute;
  right: 1rem; top: 1rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 0;
  background: transparent;
  color: rgb(24 24 23 / 0.55);
  transition: color 0.2s ease;
}
.contact__close svg { width: 1.1rem; height: 1.1rem; }
@media (hover: hover) and (pointer: fine) {
  .contact__close:hover { color: var(--c-ink); }
}

.contact__aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 3.5vw, 3rem);
  background: var(--c-dark);
  color: var(--c-ivory);
}
.contact__title {
  margin-top: 0.5rem;
  padding-right: 1rem;
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 450;
  font-stretch: 92%;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.contact__text {
  margin-top: 1.25rem;
  color: rgb(245 243 238 / 0.7);
  text-wrap: pretty;
}
/* gleicher Rhythmus wie rechts: Überschrift → Inhalt */
.contact__booking {
  margin-top: clamp(1.05rem, 1.5vw, 1.25rem);
}

.contact__option-label {
  font-size: clamp(1.25rem, 1.8vw, 1.625rem);
  font-weight: 450;
  font-stretch: 96%;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--c-ivory);
}
.contact__form .contact__option-label { color: var(--c-ink); }
.contact__hint {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: rgb(245 243 238 / 0.7);
}
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  padding: clamp(2rem, 3.5vw, 3rem);
  padding-top: clamp(3.5rem, 4.5vw, 4rem);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-ink);
}
.field__opt { font-weight: 400; color: var(--c-muted-on-ivory); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1px solid rgb(24 24 23 / 0.28);
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  caret-color: var(--c-bronze);
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; min-height: 3.5rem; }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--c-bronze);
  box-shadow: 0 1px 0 0 var(--c-bronze);
}
.field [aria-invalid="true"] { border-bottom-color: #a4442c; }

.check {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--c-muted-on-ivory);
}
.check input {
  width: 1.1rem; height: 1.1rem;
  margin: 0.1rem 0 0;
  accent-color: var(--c-ink);
}
.check a { color: var(--c-ink); }

.form-status {
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: var(--c-ink);
}
/* leere Statuszeile nimmt keinen Platz weg */
.form-status:empty { min-height: 0; }
.form-status.is-error { color: #a4442c; }

.contact__form .btn { align-self: flex-start; }
.contact__form .btn[disabled] { opacity: 0.6; cursor: progress; }

@media (max-width: 760px) {
  .contact {
    width: 100vw;
    max-width: 100vw;
    max-height: 100svh;
    height: 100svh;
    margin: 0;
    border-radius: 0;
  }
  .contact__inner { grid-template-columns: 1fr; }
  .contact__close { color: rgb(245 243 238 / 0.7); }
  .contact__aside { padding-top: 4.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .contact__form { padding-top: 2.25rem; }
}

/* ---------- Aktionen: Nachricht senden + WhatsApp ---------- */

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.contact__form .contact__actions .btn { align-self: auto; }

.btn--whatsapp {
  --btn-bg: #25d366;
  --btn-fg: #0a2e18;
  --btn-bg-hover: #31e074;
  --btn-bg-active: #1eb257;
  border-radius: 13px;
}
.btn--whatsapp::after { background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.4) 48%, transparent 64%); }
@media (hover: hover) and (pointer: fine) {
  .btn--whatsapp:hover { box-shadow: 0 10px 34px -14px rgb(37 211 102 / 0.65); }
}

/* ---------- E-Mail und Telefon, symmetrisch nebeneinander ---------- */

.contact__direct {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(24 24 23 / 0.12);
}
.contact__direct-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  text-align: center;
  text-decoration: none;
  transition: color 0.25s ease;
}
.contact__direct-item + .contact__direct-item { border-left: 1px solid rgb(24 24 23 / 0.12); }
.contact__direct-label {
  font-size: 0.625rem;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-muted-on-ivory);
}
.contact__direct-value {
  font-size: 0.9375rem;
  color: var(--c-ink);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) {
  .contact__direct-item:hover .contact__direct-value { color: var(--c-bronze); }
}

@media (max-width: 760px) {
  .contact__actions .btn { flex: 1 1 100%; justify-content: center; }
  .contact__direct-value { font-size: 0.875rem; }
}

/* ---------- Terminbuchung im Dialog ---------- */

.contact.is-booking { width: min(68rem, 100vw - 2rem); }

.booking {
  display: flex;
  flex-direction: column;
  min-height: min(44rem, 100svh - 2rem);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: var(--c-dark);
  color: var(--c-ivory);
}

.booking__head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1rem;
}
.booking__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.9rem 0 0.7rem;
  border: 1px solid rgb(245 243 238 / 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--c-ivory);
  font-size: 0.875rem;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.booking__back svg { width: 1rem; height: 1rem; transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .booking__back:hover { border-color: var(--c-champagne); background: rgb(197 154 118 / 0.12); }
}
.booking__title {
  font-size: 0.6875rem;
  font-weight: 500;
  font-stretch: 112%;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.booking__frame {
  flex: 1;
  min-height: 34rem;
  border-radius: 12px;
  overflow: hidden;
}
.booking__frame > * { width: 100%; }

.booking__fallback {
  padding-top: 0.9rem;
  font-size: 0.8125rem;
  color: var(--c-muted);
}
.booking__fallback a { color: var(--c-champagne); }

@media (max-width: 760px) {
  .contact.is-booking { width: 100vw; }
  .booking { min-height: 100svh; padding: 1rem; }
  .booking__frame { min-height: 30rem; }
  .booking__head { padding-top: 2.5rem; }
}

/* Pflichtfeld-Kennzeichnung */
.field__req {
  color: var(--c-bronze);
  font-weight: 500;
}
.form-legend {
  margin-top: -0.35rem;
  margin-bottom: -0.55rem;
  font-size: 0.75rem;
  color: var(--c-muted-on-ivory);
}
.form-legend .field__req { margin-right: 0.15rem; }

/* Einwilligung vor dem Laden des Kalenders */
.consent {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgb(245 243 238 / 0.72);
  cursor: pointer;
}
.consent input {
  width: 1.1rem; height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--c-champagne);
}
.consent a { color: var(--c-ivory); }
@media (hover: hover) and (pointer: fine) {
  .consent a:hover { color: var(--c-champagne); }
}

/* Button bleibt gesperrt, bis zugestimmt wurde */
.contact__booking .btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}
