/* ═══════════════════════════════════════════════════════════════
   Public Booking Page — Dr Laurent MAMY
   Couleurs : bleu médical (#1a73e8) + blanc
   Mobile-first, professionnel, clair
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --blue: #1a73e8;
  --blue-dark: #1557b0;
  --blue-darker: #0d47a1;
  --blue-light: #e8f0fe;
  --blue-lighter: #f0f6ff;
  --green: #1e8e3e;
  --green-light: #e6f4ea;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border: #dadce0;
  --border-light: #e8eaed;
  --bg: #f8f9fa;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(60,64,67,.1);
  --shadow: 0 1px 3px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.1);
  --shadow-lg: 0 4px 12px rgba(60,64,67,.15);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero Header ── */
.hero-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-darker) 100%);
  color: white;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}
.hero-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.doctor-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.doctor-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.doctor-badge h1 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.doctor-specialty {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
  margin: 0;
}
.hero-subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
}
.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.82rem;
  opacity: 0.9;
}
.hero-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.hero-detail-item a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}
.hero-detail-item a:hover { text-decoration: underline; }
.hero-icon { flex-shrink: 0; }

/* ── Container ── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  flex: 1;
}

/* ── Stepper ── */
.stepper {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.step:not(:last-child)::after {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
}
.step.active { color: var(--blue); font-weight: 600; }
.step.completed { color: var(--green); }
.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border-light);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.step.active .step-number {
  background: var(--blue);
  color: white;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}
.step.completed .step-number {
  background: var(--green);
  color: white;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--blue-light);
}

/* ── Type Selection ── */
.type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
.type-option {
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--white);
  user-select: none;
}
.type-option:hover {
  border-color: var(--blue);
  background: var(--blue-lighter);
}
.type-option.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.type-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.type-option.selected .type-icon {
  background: var(--blue);
  color: white;
}
.type-name { font-weight: 500; font-size: 0.9rem; }
.type-duration { font-size: 0.78rem; color: var(--text-secondary); }

/* ── Calendar ── */
.calendar { user-select: none; }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.calendar-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
}
.calendar-nav-btn,
.calendar-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}
.calendar-nav-btn:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-day-header {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: var(--radius);
  cursor: default;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.calendar-day.available {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  background: var(--blue-lighter);
}
.calendar-day.available:hover {
  background: var(--blue);
  color: white;
}
.calendar-day.selected {
  background: var(--blue) !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}
.calendar-day.today {
  border: 2px solid var(--blue);
}
.calendar-day.other-month { opacity: 0.3; }

/* ── Time Slots ── */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.4rem;
}
.slot {
  padding: 0.55rem 0.4rem;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  background: var(--white);
}
.slot:hover {
  border-color: var(--blue);
  background: var(--blue-lighter);
  color: var(--blue);
}
.slot.selected {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.slot-period-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin: 0.65rem 0 0.4rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border-light);
}

/* ── Forms ── */
.form-group { margin-bottom: 0.85rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.required { color: #d93025; }
.form-input, .form-select, textarea.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, textarea.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-dark);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--border-light);
  color: var(--text-secondary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  color: var(--text-primary);
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

/* ── Step Actions ── */
.step-actions { display: flex; margin-top: 0.75rem; gap: 0.75rem; }
.step-actions-end { justify-content: flex-end; }
.step-actions-between { justify-content: space-between; }
.step-actions-center { justify-content: center; }

/* ── Summary ── */
.summary-card { background: var(--blue-lighter); border-color: var(--blue-light); }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-secondary); font-weight: 500; }
.summary-value { font-weight: 600; text-align: right; }

/* ── Confirmation ── */
.confirmation-card { text-align: center; }
.confirmation-icon { margin-bottom: 0.75rem; }
.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}
.confirmation-message h2 {
  color: var(--green);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.confirmation-message p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.confirmation-details {
  text-align: left;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin: 1rem 0;
}
.confirmation-notice {
  display: flex;
  gap: 0.65rem;
  text-align: left;
  background: var(--blue-light);
  border-radius: var(--radius);
  padding: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.5;
}
.confirmation-notice strong { display: block; margin-bottom: 0.2rem; }
.notice-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.alert-error {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c6cb;
}
.alert-success {
  background: var(--green-light);
  color: #137333;
  border: 1px solid #a8dab5;
}
.alert-info {
  background: var(--blue-light);
  color: var(--blue-dark);
  border: 1px solid #aecbfa;
}

/* ── Loading / Empty ── */
.loading {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto 0.6rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
}
.empty-state .icon { font-size: 2rem; margin-bottom: 0.4rem; }

/* ── Visibility ── */
.hidden { display: none !important; }

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  background: var(--white);
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
}
.footer-content {
  max-width: 900px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.footer-block strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}
.footer-block p { margin: 0.15rem 0; }
.footer-block a {
  color: var(--blue);
  text-decoration: none;
}
.footer-block a:hover { text-decoration: underline; }
.footer-bottom {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero-header { padding: 1.25rem 1rem; }
  .doctor-badge h1 { font-size: 1.1rem; }
  .hero-details { flex-direction: column; gap: 0.35rem; }
  .container { padding: 1rem 0.75rem; }
  .card { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .stepper { padding: 0; }
  .step span:not(.step-number) { display: none; }
  .step:not(:last-child)::after { width: 20px; margin: 0 0.3rem; }
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .btn-lg { width: 100%; }
  .step-actions { flex-wrap: wrap; }
  .step-actions-between { flex-direction: column-reverse; gap: 0.5rem; }
  .step-actions-between .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 0.85rem; }
}

@media (min-width: 641px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
  .hero-content { flex-direction: row; justify-content: space-between; align-items: center; }
  .hero-details { flex-direction: column; text-align: right; gap: 0.3rem; }
}
