/* Appointment booking form — Jotform-inspired layout on dark theme */

.cs-booking-section {
  padding: 48px 0 96px;
}

.cs-booking-form {
  max-width: 920px;
  margin: 0 auto;
  background: #fff;
  color: #1a1a2e;
  border-radius: 8px;
  padding: 32px 40px 48px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.site-modern .cs-booking-form label,
.site-modern .cs-booking-form legend,
.site-modern .cs-booking-form h3 {
  color: #1a1a2e !important;
}

.cs-booking-fieldset {
  border: none;
  margin: 0 0 28px;
  padding: 0;
}

.cs-booking-legend {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 0;
  width: 100%;
}

.cs-booking-legend .required,
.cs-booking-field label .required {
  color: #e53935;
}

.cs-booking-legend .optional {
  font-weight: 400;
  color: #666;
  font-size: 0.9rem;
}

.cs-booking-row {
  display: grid;
  gap: 16px;
  margin-bottom: 12px;
}

.cs-booking-row--2 {
  grid-template-columns: 1fr 1fr;
}

.cs-booking-name-group {
  margin-bottom: 12px;
}

.cs-booking-group-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1a1a2e !important;
}

.cs-booking-row--alt {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.cs-booking-field {
  margin-bottom: 8px;
}

.cs-booking-field label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.cs-booking-field input[type="text"],
.cs-booking-field input[type="email"],
.cs-booking-field input[type="tel"],
.cs-booking-field input[type="date"],
.cs-booking-field input[type="time"],
.cs-booking-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 1rem;
  background: #f9fafb;
  color: #1a1a2e;
  box-sizing: border-box;
}

.cs-booking-field input:focus,
.cs-booking-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.cs-booking-field--narrow {
  max-width: 280px;
}

.cs-booking-field--autocomplete {
  position: relative;
}

.cs-booking-address-wrap {
  position: relative;
}

.cs-booking-address-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.cs-booking-address-results__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  color: #1a1a2e;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
}

.cs-booking-address-results__item:last-child {
  border-bottom: 0;
}

.cs-booking-address-results__item:hover {
  background: #eff6ff;
}

.cs-booking-address-results__message {
  padding: 10px 12px;
  font-size: 0.875rem;
  color: #6b7280;
}

.cs-booking-address-results__message--error {
  color: #b91c1c;
}

.cs-booking-sublabel,
.cs-booking-hint {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.cs-booking-errors,
.errorlist {
  color: #b91c1c;
  font-size: 0.875rem;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.cs-booking-messages {
  max-width: 920px;
  margin: 0 auto 24px;
}

.cs-booking-message {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 0;
}

.cs-booking-message--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.cs-booking-message--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Scheduler */
.cs-booking-scheduler {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  background: #fafbfc;
}

.cs-booking-calendar-header {
  margin-bottom: 12px;
}

.cs-booking-date-display {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  background: #fff;
}

.cs-booking-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cs-booking-month-label {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
}

.cs-booking-month-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: #374151;
}

.cs-booking-month-nav-btn:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
}

.cs-booking-month-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cs-booking-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 0.8rem;
}

.cs-booking-cal-grid .cal-dow {
  text-align: center;
  font-weight: 600;
  color: #6b7280;
  padding: 6px 0;
}

.cs-booking-cal-grid button {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  color: #374151;
  padding: 0;
}

.cs-booking-cal-grid button:hover:not(:disabled) {
  background: #e0e7ff;
}

.cs-booking-cal-grid button.is-selected {
  background: #2563eb;
  color: #fff;
}

.cs-booking-cal-grid button.is-today {
  font-weight: 700;
}

.cs-booking-cal-grid button:disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

.cs-booking-cal-grid .cal-empty {
  visibility: hidden;
}

.cs-booking-slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cs-booking-slots-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.cs-booking-day-nav {
  width: 36px;
  height: 36px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: #374151;
}

.cs-booking-day-nav:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.cs-booking-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 120px;
}

.cs-booking-slot {
  padding: 10px 12px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cs-booking-slot:hover:not(:disabled) {
  background: #eff6ff;
}

.cs-booking-slot.is-selected {
  background: #2563eb;
  color: #fff;
}

.cs-booking-slot:disabled {
  border-color: #e5e7eb;
  color: #9ca3af;
  background: #f3f4f6;
  cursor: not-allowed;
  text-decoration: line-through;
}

.cs-booking-slots-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  padding: 24px 0;
}

.cs-booking-timezone {
  margin-top: 16px;
  font-size: 0.8rem;
  color: #6b7280;
}

.cs-booking-slot-error {
  color: #b91c1c;
  font-size: 0.875rem;
  margin-top: 8px;
}

/* Service toggles */
.cs-booking-services {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-booking-services li {
  border-bottom: 1px solid #e5e7eb;
}

.cs-booking-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  margin: 0;
}

.cs-booking-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cs-booking-toggle__track {
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.cs-booking-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cs-booking-toggle input:checked + .cs-booking-toggle__track {
  background: #2563eb;
}

.cs-booking-toggle input:checked + .cs-booking-toggle__track::after {
  transform: translateX(20px);
}

.cs-booking-toggle__label {
  font-size: 0.95rem;
  color: #1a1a2e;
}

.cs-booking-submit-wrap {
  text-align: center;
  margin-top: 32px;
}

.cs-booking-submit {
  min-width: 200px;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff !important;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.cs-booking-submit:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .cs-booking-form {
    padding: 24px 20px 36px;
  }

  .cs-booking-row--2,
  .cs-booking-row--alt,
  .cs-booking-scheduler {
    grid-template-columns: 1fr;
  }

  .cs-booking-field--narrow {
    max-width: none;
  }
}
