* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.booking-form-wrapper {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
}

h1 {
  color: #333;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 2rem;
}

.section-header {
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.section-header h3 {
  color: #667eea;
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Top Grid: Clinic/Doctor/Schedule */
.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Fee & Type Row */
.fee-type-row {
  display: flex;
  justify-content: flex-start;
  gap: 7.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1rem 0;
  
}

.consultation-fee-section {
  flex: 0 0 auto;
}

/* .consultation-fee-section label {
  display: block;
  margin-bottom: 0.25rem;
  color: #6c757d;
  font-weight: 400;
  font-size: 0.875rem;
} */

.fee-value {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #333;
}

.appointment-type-section {
  flex: 0 0 auto;
}

/* .appointment-type-section label {
  display: block;
  margin-bottom: 0.5rem;
  color: #6c757d;
  font-weight: 400;
  font-size: 0.875rem;
} */

.appointment-type-section .radio-group {
  display: flex;
  gap: 1.5rem;
}

/* Patient Details Grids */
.patient-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gender-dob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
}

.required {
  color: #e74c3c;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  color: #6b7280;
}

select.form-control,
input[type="date"].form-control {
  color: #6b7280;
  font-size: 0.88rem;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

select.form-control:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='currentColor' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

select.form-control option {
  font-size: 0.8125rem;
  padding: 0.5rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color, #667eea);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 102, 126, 234), 0.1);
}

select.form-control:focus {
  border-color: var(--primary-color, #667eea);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.error-message {
  display: block;
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.2rem;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: normal;
}

.radio-label input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--primary-color, #4285f4);
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: var(--primary-color, #4285f4);
}

.tab-btn.active {
  color: var(--primary-color, #4285f4);
  border-bottom-color: var(--primary-color, #4285f4);
}

/* Not Available Message */
.not-available-message {
  color: #dc3545;
  font-size: 0.9rem;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
}

/* Time Slots */
.slots-container {
  margin-top: 1rem;
  min-height: 200px;
}

.slot-period {
  display: none;
}

.slot-period.active {
  display: block;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.slot-button {
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  color: #6b7280;
}

.slot-button:hover {
  background: #f8f9fa;
  border-color: var(--primary-color, #4285f4);
}

.slot-button.selected {
  background: var(--primary-color, #4285f4);
  color: white;
  border-color: var(--primary-color, #4285f4);
}

.slot-button.blocked {
  background: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  cursor: not-allowed;
  opacity: 0.5;
}

.slot-button.blocked:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.no-slots-message {
  color: #6c757d;
  font-style: italic;
  padding: 1rem;
  text-align: center;
  background: #f8f9fa;
  border-radius: 6px;
}

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* CAPTCHA */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.captcha-container #captchaInput {
  flex: 1;
  max-width: 300px;
}

#captchaCanvas {
  border: 1px solid #ddd;
  border-radius: 6px;
}

.btn-refresh {
  padding: 0.5rem 1rem;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background 0.3s;
}

.btn-refresh:hover {
  background: #5a6268;
}

/* Buttons */
.form-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
}

.btn-primary {
  background: #4285f4;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #3367d6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-link {
  background: none;
  color: #667eea;
  text-decoration: underline;
  padding: 0.5rem 1rem;
}

.btn-link:hover {
  color: #5568d3;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-dialog {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content {
  padding: 0;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f8f9fa;
}

.modal-body {
  padding: 1.5rem;
}

.patient-selection-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.patient-selection-table th,
.patient-selection-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.patient-selection-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #555;
}

.patient-selection-table tbody tr {
  transition: background 0.2s;
}

.patient-selection-table tbody tr:hover {
  background-color: #f8f9fa;
}

.patient-selection-table input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.mt{
  transform: translateY(3px);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .booking-form-wrapper {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

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

  .fee-type-row {
    flex-direction: column;
    gap: 1rem;
  }

  .patient-details-grid {
    grid-template-columns: 1fr;
  }

  .gender-dob-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 0.6rem 0.5rem;
  }

  .modal-dialog {
    width: 95%;
  }

  .patient-selection-table {
    font-size: 0.875rem;
  }

  .patient-selection-table th,
  .patient-selection-table td {
    padding: 0.5rem;
  }

  .captcha-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .captcha-container #captchaInput {
    max-width: 100%;
  }

}
