/* =======================================================
   terminanfrage.CSS – Seite „terminanfrage“ (optimiert)
   Schlank, professionell, ohne Sidebar.
======================================================= */

/* ---------- Seite ---------- */
.page-terminanfrage h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  text-align: center;
}

.page-terminanfrage h2 {
  margin: 2.25rem 0 .4rem;
  font-size: 1.35rem;
  letter-spacing: -.01em;
}

.page-terminanfrage h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--color-secondary);
  text-align: center;
}

.page-terminanfrage p.section-subtitle {
  color: var(--color-text-muted, #6b7a86);
  margin-bottom: 1.25rem;
}

/* ---------- Container ---------- */
.page-terminanfrage .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ---------- Card ---------- */
.page-terminanfrage .card {
  background: #fff;
  border: 1px solid var(--color-border, #e2e6ea);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.04);
  padding: 2rem 1.75rem;
  margin: 1.25rem 0 2rem;
  transition: box-shadow .18s ease, transform .08s ease;
}
.page-terminanfrage .card:hover {
  box-shadow: 0 6px 26px rgba(0,0,0,.06);
}

/* ---------- Formular-Grundlayout ---------- */
#terminFormular {
  display: grid;
  gap: 2.25rem;
  margin-top: 1.5rem;
  position: relative;
  isolation: isolate;
}

#terminFormular section {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border, #e2e6ea);
}
#terminFormular section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

#terminFormular section > h2 {
  position: relative;
  padding-left: .9rem;
  margin-top: 0;
}
#terminFormular section > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .15rem;
  bottom: .15rem;
  width: 3px;
  border-radius: 2px;
  background: var(--color-primary, #2e6f9f);
  opacity: .25;
}
#terminFormular section + section {
  margin-top: .5rem;
}
#terminFormular section > p {
  color: var(--color-text-muted, #6b7a86);
  margin: .35rem 0 1rem;
}

/* ---------- Inputs / Textareas / Selects ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--color-border, #dfe3e8);
  border-radius: 8px;
  padding: .7rem .85rem;
  background: #fff;
  font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.02);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary, #2e6f9f);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 16%, transparent);
}
textarea { min-height: 160px; }

/* Fehlerzustände */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"],
.input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220,38,38,.06);
}
.field-error {
  color: #b00020;
  font-size: .85rem;
  margin-top: .25rem;
}

#anfrageTypLabel {
  font-weight: 500;
}

.anfrageart-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 9999px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  margin-top: 2rem;
}

.anfrageart-toggle input {
  display: none;
}

.anfrageart-toggle label {
  padding: .5rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: .95rem;
  color: #334155;
  background: #f8fafc;
  transition: background .2s, color .2s;
}

.anfrageart-toggle input:checked + label {
  background: var(--color-primary, #2e6f9f);
  color: #fff;
}

/* ---------- Problem-Bereich ---------- */
#problemContainer table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
}
.problem-container td {
  padding: .5rem 0;
}
.problem-container td:first-child {
  width: 60%;
  padding-right: 1rem;
}
.problem-select {
  min-width: 90px;
}

/* ---------- Termine ---------- */
#terminAbschnitt {
  transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
  overflow: hidden;
  max-height: 1000px;
  opacity: 1;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#terminAbschnitt.ausgeblendet {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

#auswahlMeldung {
  color: #b00020;
  font-size: .9rem;
  margin-top: .5rem;
}

/* ---------- Neue Wochen-/Slot-Ansicht ---------- */
#wochenContainer {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

.week-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.week-navigation .nav-btn {
  background: var(--color-primary, #2e6f9f);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, opacity 0.2s;
}

.week-navigation .nav-btn:disabled {
  background: #cbd5e1;   /* hellgrau */
  color: #64748b;        /* gedämpft */
  cursor: not-allowed;
  opacity: 0.7;
}


.week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.day-column {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.day-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-align: center;
}

.slot {
  background: #f9fafb;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.4rem;
  margin: 0.3rem 0;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Hover-Effekt nur bei freien Slots */
.slot.frei:hover {
  background: var(--color-primary, #2e6f9f);
  color: #fff;
}

/* Frei & auswählbar */
.slot.frei {
  cursor: pointer;
  background: #f9fafb;
}

/* Belegt (laut Backend) */
.slot.belegt {
  background: #f3f4f6;   /* hellgrau */
  color: #9ca3af;
  border: 1px solid #e5e7eb;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Gesperrt (außerhalb Buchungsfenster) */
.slot.gesperrt {
  background: #e5e7eb;   /* dunkleres Grau */
  color: #6b7280;
  border: 1px dashed #9ca3af;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Ausgewählt */
.slot.selected {
  background: #22c55e;   /* kräftiges Grün */
  border-color: #16a34a;
  color: #fff;
}


/* ---------- Kontakt-Daten ---------- */
.kontakt-tabelle {
  width: 100%;
  max-width: 820px;
  border-collapse: collapse;
}
.kontakt-tabelle tr {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: start;
  gap: 1rem;
  margin-bottom: .75rem;
}
.kontakt-tabelle td {
  padding: 0;
}
.kontakt-tabelle td:first-child {
  color: var(--color-text, #1f2933);
  font-weight: 500;
  align-self: center;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 1.25rem;
  font-size: .95rem;
}
.alert--success {
  border-color: #22c55e33;
  background: #22c55e0f;
  color: #15803d;
}
.alert--error {
  border-color: #ef444433;
  background: #ef44440f;
  color: #b91c1c;
}
.alert--info {
  border-color: #0ea5e933;
  background: #0ea5e90f;
  color: #0369a1;
}

/* ---------- Submit-Button ---------- */
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--color-primary, #2e6f9f);
  color: #fff;
  font-weight: 600;
  padding: .8rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
button[type="submit"]:hover:not(:disabled) {
  background: var(--color-primary-600, #235879);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
button[type="submit"]:active {
  transform: translateY(1px);
}
button[type="submit"]:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  opacity: .7;
}

/* ---------- Helper ---------- */
.form-hint {
  color: var(--color-text-muted, #6b7a86);
  font-size: .9rem;
}
.form-error {
  color: #b00020;
  font-size: .9rem;
}
.hidden { display: none !important; }

/* ==========================================
   Responsive Anpassungen – Terminseite
   ========================================== */

/* --------- Tablets und kleinere Laptops --------- */
@media (max-width: 1024px) {
  .page-terminanfrage .container {
    padding: 1.5rem 1rem 3rem;
  }

  /* Wochenübersicht kompakter */
  .week-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }

  .day-column {
    padding: 0.7rem;
  }
}

/* --------- Smartphones Hochformat (max 768px) --------- */
@media (max-width: 768px) {
  /* Allgemeine Abstände */
  .page-terminanfrage .container {
    padding: 1rem;
  }

  /* Überschriften kleiner */
  .page-terminanfrage h1 {
    font-size: 1.6rem;
  }

  .page-terminanfrage h2 {
    font-size: 1.15rem;
  }

  .page-terminanfrage h3 {
    font-size: 1rem;
  }

  /* Karten padding kleiner */
  .page-terminanfrage .card {
    padding: 1.25rem 1rem;
  }

  /* Wochenübersicht – auf 2 Spalten runter */
  .week-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .day-column {
    padding: 0.5rem;
  }

  /* Problem-Tabelle als Block-Layout */
  #problemContainer table,
  #problemContainer tr,
  #problemContainer td {
    display: block;
    width: 100%;
  }

  #problemContainer td:first-child {
    margin-bottom: 0.3rem;
  }

  .problem-select {
    width: 100%;
  }

  /* Kontakt-Tabelle auf 1 Spalte */
  .kontakt-tabelle tr {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* --------- Sehr kleine Smartphones (max 480px) --------- */
@media (max-width: 480px) {
  .page-terminanfrage h1 {
    font-size: 1.4rem;
  }

  .page-terminanfrage h2 {
    font-size: 1rem;
  }

  .week-grid {
    grid-template-columns: 1fr;
  }

  .slot {
    font-size: 0.9rem;
    padding: 0.3rem;
  }

  button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
}

