/* ==========================================================================
   Barrimédica - Appointment Booking Wizard Styles
   ========================================================================== */

.booking-app-container {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Booking Header Bar */
.booking-header {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 30px;
  text-align: center;
}

.booking-header h2 {
  font-size: 1.85rem;
  color: #ffffff;
  margin-bottom: 6px;
}

.booking-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.booking-location-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  margin-top: 14px;
  backdrop-filter: blur(4px);
}

/* Progress Stepper */
.step-progressbar {
  display: flex;
  justify-content: space-between;
  background: #f1f5f9;
  padding: 16px 30px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.step-item.active {
  color: var(--primary);
}

.step-item.completed {
  color: #10b981;
}

.step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.step-item.active .step-bubble {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-item.completed .step-bubble {
  background: #10b981;
  color: #ffffff;
}

/* Wizard Steps Body */
.booking-body {
  padding: 35px 30px;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.step-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
}

.step-title-row h3 {
  font-size: 1.35rem;
  color: var(--primary);
}

.step-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Filter controls (Step 1) */
.filter-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-select, .form-input, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Date Grid Selector */
.date-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.date-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.date-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.date-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.date-option input[type="radio"]:checked + .date-card {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(5, 87, 188, 0.25);
}

.date-card-dow {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.date-card-day {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.date-card-month {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.date-option input[type="radio"]:checked + .date-card .date-card-dow,
.date-option input[type="radio"]:checked + .date-card .date-card-month {
  color: rgba(255, 255, 255, 0.9);
}

/* Time Slots Grid */
.time-slots-container {
  margin-top: 16px;
}

.slots-period-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slots-period-title:first-child {
  margin-top: 0;
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.slot-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot-chip {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  background: #ffffff;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.slot-chip:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.slot-option input[type="radio"]:checked + .slot-chip {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 87, 188, 0.25);
}

.slot-time {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.slot-doctor {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-option input[type="radio"]:checked + .slot-chip .slot-doctor {
  color: rgba(255, 255, 255, 0.9);
}

/* Form inputs & Checkboxes (Step 4) */
.selected-summary-box {
  background: var(--primary-light);
  border: 1px solid rgba(5, 87, 188, 0.2);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-item-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.summary-item-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.checkbox-group {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.custom-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Navigation buttons */
.step-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-wizard {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-wizard-prev {
  background: #f1f5f9;
  color: var(--text-main);
}

.btn-wizard-prev:hover {
  background: #e2e8f0;
}

.btn-wizard-next {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 87, 188, 0.25);
}

.btn-wizard-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 87, 188, 0.35);
}

/* Spinner and Feedback */
.spinner-loader {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3.5px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

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

.empty-state-card {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 35px 30px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-success-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #d1fae5;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 1.65rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.modal-details-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: left;
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.modal-details-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-details-row:last-child {
  margin-bottom: 0;
}

.modal-details-label {
  color: var(--text-muted);
}

.modal-details-value {
  font-weight: 700;
  color: var(--text-main);
}

.btn-modal-close {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 30px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

.btn-modal-close:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .step-progressbar {
    padding: 12px;
  }
  .step-item span {
    display: none;
  }
  .booking-body {
    padding: 24px 16px;
  }
  .date-selector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Switch Banner between Consultas and Exames */
.booking-switch-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.booking-switch-banner p {
  margin: 0;
  color: #1e40af;
  font-size: 0.95rem;
  font-weight: 500;
}

.booking-switch-banner a {
  background: #2563eb;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: var(--transition);
}

.booking-switch-banner a:hover {
  background: #1d4ed8;
}

/* Prescription Notice */
.prescription-alert {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.prescription-alert-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.prescription-alert-content h4 {
  color: #92400e;
  font-size: 0.98rem;
  margin-bottom: 4px;
  font-weight: 700;
}

.prescription-alert-content p {
  color: #b45309;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.4;
}

/* Exam Badges */
.exam-badge-rx {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

.exam-badge-free {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

