/* ========================================================================
   TERMINPLANER - Public Booking Widget
   ======================================================================== */

/* --- Widget Container --- */
.booking-widget {
  max-width: 720px;
  margin: 0 auto;
}

/* --- Progress Bar --- */
.booking-progress {
  margin-bottom: 48px;
}

.booking-progress-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}

.booking-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #54a8c7 0%, #7ec8e3 100%);
  border-radius: 4px;
  width: 25%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.booking-progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.progress-step span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

.progress-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step.active .progress-step-dot {
  background: #54a8c7;
  color: #fff;
  box-shadow: 0 4px 14px rgba(84, 168, 199, 0.35);
}

.progress-step.active span {
  color: #54a8c7;
}

.progress-step.done .progress-step-dot {
  background: #10b981;
  color: #fff;
}

.progress-step.done span {
  color: #10b981;
}

/* --- Steps --- */
.booking-step {
  display: none;
}

.booking-step.active {
  display: block;
  animation: fadeInUp 0.35s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.booking-step-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a2332;
  margin-bottom: 6px;
}

.booking-step-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 28px;
}

.booking-step-actions {
  margin-top: 28px;
}

/* --- Type Cards (Step 1) --- */
.type-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.type-card:hover {
  border-color: #54a8c7;
  box-shadow: 0 4px 16px rgba(84, 168, 199, 0.12);
  transform: translateY(-1px);
}

.type-card.selected {
  border-color: #54a8c7;
  background: #f0f9ff;
  box-shadow: 0 4px 20px rgba(84, 168, 199, 0.18);
}

.type-card.selected::after {
  content: '\e9c3';
  font-family: 'unicons';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: #54a8c7;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.type-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.type-card-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.type-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1a2332;
  margin: 0;
}

.type-card-desc {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 8px 24px;
  line-height: 1.5;
}

.type-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 24px;
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 500;
}

.type-card-meta i {
  font-size: 0.85rem;
  color: #54a8c7;
}

/* --- Calendar (Step 2) --- */
.calendar-wrapper {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid #f0f0f0;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.calendar-nav-btn:hover {
  background: #f0f9ff;
  border-color: #54a8c7;
  color: #54a8c7;
}

.calendar-month-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2332;
}

.calendar-grid,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  background: transparent;
  min-height: 42px;
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: #f0f9ff;
  border-color: #54a8c7;
  color: #54a8c7;
}

.calendar-day.selected {
  background: #54a8c7;
  color: #fff;
  font-weight: 700;
  border-color: #54a8c7;
  box-shadow: 0 4px 12px rgba(84, 168, 199, 0.3);
}

.calendar-day.today:not(.selected) {
  border-color: #54a8c7;
  color: #54a8c7;
  font-weight: 700;
}

.calendar-day.disabled {
  color: #d1d5db;
  cursor: not-allowed;
  background: transparent;
}

.calendar-day.empty {
  cursor: default;
}

/* --- Time Slots (Step 3) --- */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.slot-btn {
  padding: 12px 8px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.slot-btn:hover {
  border-color: #54a8c7;
  color: #54a8c7;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.slot-btn.selected {
  background: #54a8c7;
  color: #fff;
  border-color: #54a8c7;
  box-shadow: 0 4px 12px rgba(84, 168, 199, 0.3);
}

.slots-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.slots-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #54a8c7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.slots-empty {
  text-align: center;
  padding: 40px 0;
  color: #9ca3af;
}

.slots-empty i {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
  color: #d1d5db;
}

.slots-empty p {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* --- Contact Form (Step 4) --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group-full {
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.required {
  color: #ef4444;
}

.form-group input,
.form-group textarea {
  padding: 11px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1a2332;
  background: #fff;
  transition: all 0.15s;
  outline: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #54a8c7;
  box-shadow: 0 0 0 3px rgba(84, 168, 199, 0.12);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #c4c9d0;
}

.form-error {
  font-size: 0.76rem;
  color: #ef4444;
  margin-top: 4px;
  min-height: 18px;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-top: 1px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: #54a8c7;
  border-color: #54a8c7;
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-text {
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  color: #6b7280;
  line-height: 1.5;
}

.checkbox-text a {
  color: #54a8c7;
  text-decoration: underline;
}

/* Form actions */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 50rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-back:hover {
  background: #f8fafc;
  border-color: #d1d5db;
  color: #374151;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 50rem;
  border: none;
  background: linear-gradient(135deg, #54a8c7 0%, #478fa8 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(84, 168, 199, 0.3);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 168, 199, 0.4);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form-server-error {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.85rem;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .booking-widget {
    padding: 0 4px;
  }

  .booking-step-title {
    font-size: 1.15rem;
  }

  .calendar-wrapper {
    padding: 18px 14px;
  }

  .calendar-day {
    min-height: 36px;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  .slots-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .slot-btn {
    padding: 10px 4px;
    font-size: 0.82rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn-submit,
  .form-actions .btn-back {
    width: 100%;
    justify-content: center;
  }

  .progress-step span {
    font-size: 0.65rem;
  }

  .progress-step-dot {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }

  .type-card {
    padding: 16px 18px;
  }
}
