/* === S&S Terminbuchungen – Booking Form Styles === */
/* Alle Selektoren strikt unter #tb-booking-widget oder spezifischen IDs gescopet,
   um Konflikte mit Theme und anderen Plugins zu vermeiden.            */

#tb-booking-widget {
  max-width: 420px;
  margin: 40px auto;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: #2b2b2b;
}

#tb-booking-widget .booking-card {
  background: #fff;
  padding: 28px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

/* ── Stepper ── */
#tb-booking-widget .stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
#tb-booking-widget .stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
#tb-booking-widget .stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #e5e5e5;
  z-index: 0;
}
#tb-booking-widget .stepper-step.done:not(:last-child)::after { background: #bbcbb6; }
#tb-booking-widget .stepper-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #bbb;
  background: #fff;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}
#tb-booking-widget .stepper-step.active .stepper-circle { border-color: #bbcbb6; background: #bbcbb6; color: #fff; }
#tb-booking-widget .stepper-step.done .stepper-circle  { border-color: #bbcbb6; background: #bbcbb6; color: #fff; }
#tb-booking-widget .stepper-label { font-size: 11px; color: #bbb; margin-top: 6px; font-weight: 500; text-align: center; }
#tb-booking-widget .stepper-step.active .stepper-label { color: #2b2b2b; font-weight: 600; }
#tb-booking-widget .stepper-step.done .stepper-label  { color: #555; }

/* ── Steps ── */
#tb-booking-widget .tb-step         { display: none; }
#tb-booking-widget .tb-step.active  { display: block; }

/* ── Form elements ── */
#tb-booking-widget label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  font-weight: 500;
}
#tb-booking-widget input:not([type="hidden"]),
#tb-booking-widget textarea {
  width: 100%;
  margin-bottom: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}
#tb-booking-widget select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  margin-bottom: 6px;
  appearance: none;
  background: #fff;
  box-sizing: border-box;
}
#tb-booking-widget .tb-error {
  font-size: 12px;
  color: #c00;
  margin-bottom: 10px;
  min-height: 16px;
}
#tb-booking-widget button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #bbcbb6;
  color: #fff;
  margin-top: 12px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
#tb-booking-widget button:hover { background: #a5b3a0; }
#tb-booking-widget .btn-secondary { background: #eee; color: #2b2b2b; }
#tb-booking-widget .btn-secondary:hover { background: #ddd; }
#tb-booking-widget .button-row { display: flex; gap: 10px; }
#tb-booking-widget .button-row button { flex: 1; }

/* ── Advisor cards ── */
#tb-booking-widget .advisor-select {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
#tb-booking-widget .advisor-option {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
#tb-booking-widget .advisor-option img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
#tb-booking-widget .advisor-option.active { border: 2.5px solid #bbcbb6; }

/* ── Time slots ── */
#tb-slots-container { margin-bottom: 6px; }
#tb-booking-widget .tb-slot {
  border: 1px solid #ddd;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, background 0.15s;
}
#tb-booking-widget .tb-slot:hover { background: #f8f8f8; }
#tb-booking-widget .tb-slot.active { border: 2px solid #bbcbb6; background: #eef3ed; }
#tb-booking-widget .tb-slot.active::after {
  content: '✓ Ausgewählt';
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #7A7A7A;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Consultation type radios ── */
#tb-booking-widget .tb-radio-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
#tb-booking-widget .tb-radio {
  position: relative;
  border: 1px solid #dde4db;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  background: #f7f9f7;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, background 0.15s;
}
#tb-booking-widget .tb-radio:hover { background: #f0f4ef; border-color: #bbcbb6; }
#tb-booking-widget .tb-radio.active { border: 2px solid #bbcbb6; background: #eef3ed; }
#tb-booking-widget .tb-radio strong { font-size: 15px; color: #2b2b2b; display: block; margin-bottom: 6px; }
#tb-booking-widget .tb-price {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: #bbcbb6;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* Haken neben Kartentitel bei Auswahl */
#tb-booking-widget .tb-radio.active strong::after {
  content: ' ✓';
  color: #bbcbb6;
  font-size: 16px;
  font-weight: 900;
}

/* Abschnitts-Überschriften */
#tb-booking-widget .tb-section-heading {
  font-size: 15px;
  font-weight: 700;
  color: #7A7A7A;
  margin: 20px 0 8px 0;
}
#tb-booking-widget .tb-section-heading:first-child { margin-top: 0; }
/* Headings direkt in cal/slot Spalten: kein top-margin damit beide Spalten gleich starten */
.tb-cal-col .tb-section-heading,
.tb-slot-col .tb-section-heading:first-of-type { margin-top: 0; }
#tb-booking-widget .tb-section-sub {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 14px;
}

/* ── Hidden until type / date ── */
#tb-booking-widget .hidden-until-type { display: none; }
#tb-booking-widget .hidden-until-date { display: none; }

/* ── No slots message ── */
#tb-no-slots { color: #c00; font-size: 13px; margin-top: 4px; display: none; }

/* ── API error ── */
#tb-api-error { color: #c00; margin-bottom: 12px; font-size: 13px; display: none; }

/* ── Loading screen (fixed overlay, outside widget) ── */
#tb-loading-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 100000; /* above WP admin bar (99999) */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
#tb-loading-screen.show { display: flex; }
#tb-loading-screen .tb-loading-text-main {
  font-size: 16px;
  font-weight: 600;
  color: #2b2b2b;
  margin-bottom: 6px;
}
#tb-loading-screen .tb-loading-text-sub { font-size: 13px; color: #888; }
#tb-loading-screen .tb-loading-bar-wrap {
  width: 260px;
  height: 4px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
}
#tb-loading-screen .tb-loading-bar {
  height: 100%;
  width: 0%;
  background: #bbcbb6;
  border-radius: 99px;
  transition: width linear;
}

/* ── Custom Calendar ── */
#tb-custom-cal {
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
  user-select: none;
  width: 100%;
}
#tb-custom-cal .cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9f9f9;
  border-bottom: 1px solid #eee;
}
#tb-custom-cal .cal-header button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #2b2b2b;
  padding: 4px 8px;
  border-radius: 6px;
  width: auto;
  margin: 0;
  transition: background 0.15s;
}
#tb-custom-cal .cal-header button:hover { background: #eee; }
#tb-custom-cal .cal-month { font-size: 14px; font-weight: 600; }
#tb-custom-cal .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
#tb-custom-cal .cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  padding: 8px 0;
}
#tb-custom-cal .cal-dow.sun { color: #ddd; }
#tb-custom-cal .cal-day {
  text-align: center;
  padding: 9px 4px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  margin: 2px;
  transition: background 0.1s;
}
#tb-custom-cal .cal-day:hover:not(.disabled):not(.empty) { background: #f0f0f0; }
#tb-custom-cal .cal-day.selected { background: #bbcbb6; color: #fff; }
#tb-custom-cal .cal-day.disabled { color: #ccc; cursor: default; }
#tb-custom-cal .cal-day.holiday  { color: #ccc; cursor: default; font-style: italic; }
#tb-custom-cal .cal-day.empty    { cursor: default; }
#tb-custom-cal .cal-day.today    { font-weight: 700; text-decoration: underline; }

/* Features als SVG-Haken-Liste */
#tb-booking-widget .tb-features {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 4px 0;
  line-height: 1.6;
}
#tb-booking-widget .tb-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}
#tb-booking-widget .tb-features li::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23bbcbb6'/%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Cal+Slot Row (mobil: untereinander) */
.tb-cal-slot-row { display: flex; flex-direction: column; gap: 0; }
.tb-cal-col, .tb-slot-col { width: 100%; }

/* Desktop-Layout ab 720px */
@media (min-width: 720px) {
  #tb-booking-widget { max-width: 860px; }

  #tb-booking-widget .tb-radio-group {
    flex-direction: row;
    align-items: stretch;
  }
  #tb-booking-widget .tb-radio { flex: 1; }
  #tb-booking-widget .tb-price { margin-top: auto; align-self: flex-start; }

  .tb-cal-slot-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
    margin-top: 8px;
  }
  .tb-cal-col { flex: 0 0 310px; max-width: 310px; }
  .tb-slot-col { flex: 1; min-width: 0; }
}
/* Optional-Kennzeichnung bei Labels */
.tb-optional { font-size: 11px; color: #999; font-weight: 400; margin-left: 4px; }

/* ── Buchungsübersicht (Step 3) ── */
.tb-summary-box {
  margin-top: 24px;
  margin-bottom: 28px;
  border: 1px solid #dde4db;
  border-radius: 12px;
  background: #f7f9f7;
  overflow: hidden;
}
.tb-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: #7A7A7A;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  background: #eef3ed;
  border-bottom: 1px solid #dde4db;
}
.tb-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.tb-summary-row:last-child { border-bottom: none; }
.tb-summary-label { color: #888; }
.tb-summary-value { font-weight: 600; color: #2b2b2b; }

/* ── Datenschutz Opt-in ── */
.tb-datenschutz-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
  width: 100%;
}
.tb-datenschutz-row input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 3px;
  margin-bottom: 0;
  accent-color: #BBCBB6;
  cursor: pointer;
}
.tb-datenschutz-row label,
.tb-datenschutz-text {
  flex: 1;
  display: inline;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 0;
  float: none;
  width: auto;
}
.tb-datenschutz-row label a,
.tb-datenschutz-text a {
  color: #105b77;
  text-decoration: underline;
}
.tb-datenschutz-row label a:hover,
.tb-datenschutz-text a:hover {
  color: #0d4a62;
}

.tb-storno-hinweis {
  margin: 10px 0 0;
  font-size: 12px;
  color: #888;
  text-align: center;
}
