/* booking-widget.css — Immopreneur Académie */
/* Couleurs calées sur index.html : navy #000E21, cta #0540AD, corps #1E3063 */
/* Typo : Lato (body) + Merriweather (headings), identiques au site principal */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f5f7fc;
  font-family: 'Lato', system-ui, sans-serif;
  color: #1E3063;
  -webkit-font-smoothing: antialiased;
}

/* ─── Conteneur principal ─── */
.bw {
  max-width: 1140px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Stepper ─── */
.bw-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.bw-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: #94a3b8;
  transition: color 0.2s;
}

.bw-step.is-active {
  color: #0540AD;
  font-weight: 700;
}

.bw-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.bw-step-separator {
  width: 48px;
  height: 2px;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* ─── Colonnes 2-up ─── */
.bw-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
}

.bw-form-col {
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  border-right: 1px solid #e2e8f0;
}

.bw-calendar-col {
  padding: 2.5rem 2.5rem 2.5rem 2rem;
  background: #f8faff;
}

/* ─── Titres ─── */
.bw-title {
  font-family: 'Merriweather', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000E21;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.bw-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0 0 1.75rem 0;
}

/* ─── Champs de formulaire ─── */
.bw-field {
  margin-bottom: 1rem;
}

.bw-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E3063;
  margin-bottom: 0.35rem;
}

.bw-required {
  color: #ef4444;
}

.bw-field input,
.bw-field select {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #1E3063;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bw-field input:focus,
.bw-field select:focus {
  border-color: #0540AD;
  box-shadow: 0 0 0 3px rgba(5, 64, 173, 0.12);
}

.bw-field input::placeholder {
  color: #94a3b8;
}

.bw-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.bw-field select.bw-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ─── Prénom + Nom sur la même ligne ─── */
.bw-name-row {
  display: flex;
  gap: 12px;
}

.bw-name-row .bw-field {
  flex: 1;
  min-width: 0;
}

/* ─── Champ téléphone avec combobox pays ─── */
.bw-phone-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

/* ─── Combobox pays ─── */
.bw-country {
  position: relative;
  flex: 0 0 auto;
}

.bw-country-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #1E3063;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.bw-country-toggle:focus,
.bw-country-toggle:focus-visible {
  border-color: #0540AD;
  box-shadow: 0 0 0 3px rgba(5, 64, 173, 0.12);
}

.bw-country-toggle:hover {
  border-color: #94a3b8;
}

.bw-country-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.bw-country-dial {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1E3063;
}

.bw-country-caret {
  font-size: 0.75rem;
  color: #64748b;
  margin-left: 0.1rem;
}

/* Panel déroulant */
.bw-country-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  width: 280px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 14, 33, 0.12);
  overflow: hidden;
}

/* Champ de recherche dans le panel */
.bw-country-search {
  display: block;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  border-bottom: 1.5px solid #e2e8f0;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.9rem;
  color: #1E3063;
  background: #f8faff;
  outline: none;
}

.bw-country-search::placeholder {
  color: #94a3b8;
}

.bw-country-search:focus {
  background: #fff;
  border-bottom-color: #0540AD;
}

/* Liste des pays */
.bw-country-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 220px;
  overflow-y: auto;
}

.bw-country-list li {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  color: #1E3063;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bw-country-list li:hover,
.bw-country-list li.is-highlighted {
  background: #eef2ff;
  color: #0540AD;
}

.bw-country-list li.is-active {
  font-weight: 700;
  color: #0540AD;
}

.bw-country-list li.bw-country-empty {
  color: #94a3b8;
  cursor: default;
  font-style: italic;
}

.bw-country-list li.bw-country-empty:hover {
  background: none;
  color: #94a3b8;
}

/* Le champ numéro : occupe l'espace restant */
.bw-phone-row input#bw-phone {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #1E3063;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bw-phone-row input#bw-phone:focus {
  border-color: #0540AD;
  box-shadow: 0 0 0 3px rgba(5, 64, 173, 0.12);
}

.bw-phone-row input#bw-phone::placeholder {
  color: #94a3b8;
}

/* Mobile : le panel peut déborder à droite, c'est acceptable */
@media (max-width: 480px) {
  .bw-country-toggle {
    font-size: 0.88rem;
    padding: 0.6rem 0.6rem;
  }

  .bw-country-panel {
    width: 260px;
  }
}

/* ─── RGPD ─── */
.bw-rgpd {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 1.25rem 0 1rem 0;
  line-height: 1.5;
}

.bw-rgpd a {
  color: #0540AD;
  text-decoration: none;
}

.bw-rgpd a:hover {
  text-decoration: underline;
}

/* ─── Bouton principal ─── */
.bw-btn-primary {
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #0540AD;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-align: center;
}

.bw-btn-primary:hover:not(:disabled) {
  background: #033a99;
}

.bw-btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.bw-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Bannière fuseau horaire ─── */
.bw-tz-banner {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #000E21;
  line-height: 1.5;
  min-height: 0;
}

.bw-tz-banner:empty {
  display: none;
}

.bw-tz-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #000E21;
  margin-bottom: 0.5rem;
}

/* Toggle deux pills */
.bw-tz-toggle {
  display: inline-flex;
  gap: 0;
  border: 1.5px solid #0540AD;
  border-radius: 6px;
  overflow: hidden;
}

.bw-tz-pill {
  padding: 0.35rem 0.75rem;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0540AD;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.bw-tz-pill + .bw-tz-pill {
  border-left: 1.5px solid #0540AD;
}

.bw-tz-pill:hover:not(.is-active) {
  background: #eef2ff;
}

.bw-tz-pill.is-active {
  background: #0540AD;
  color: #fff;
  cursor: default;
}

/* ─── Calendrier mois ─── */
.bw-month-cal {
  position: relative;
  user-select: none;
}

/* État grisé : tout le calendrier est atténué */
.bw-month-cal--locked .bw-month-header,
.bw-month-cal--locked .bw-month-weekdays,
.bw-month-cal--locked .bw-month-grid {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}

/* Header mois */
.bw-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.bw-month-label {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #000E21;
  text-transform: capitalize;
}

.bw-month-nav {
  background: none;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}

.bw-month-nav:hover:not(:disabled) {
  border-color: #0540AD;
  color: #0540AD;
}

.bw-month-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Rangée des jours de la semaine */
.bw-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.35rem;
}

.bw-month-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.03em;
  padding: 0.25rem 0;
}

/* Grille des jours */
.bw-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.bw-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 400;
  color: #1E3063;
  cursor: default;
  transition: background 0.12s, color 0.12s;
}

.bw-cal-day--empty {
  /* Cellule vide (leading blank) */
}

.bw-cal-day--past,
.bw-cal-day--unavailable {
  color: #cbd5e1;
}

.bw-cal-day--available {
  background: #eef2ff;
  color: #0540AD;
  font-weight: 700;
  cursor: pointer;
}

.bw-cal-day--available:hover {
  background: #0540AD;
  color: #fff;
}

.bw-cal-day--selected {
  background: #0540AD;
  color: #fff;
  font-weight: 700;
}

.bw-cal-day--today {
  box-shadow: inset 0 0 0 1.5px #0540AD;
}

/* ─── Overlay cadenas ─── */
.bw-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.bw-lock-box {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  max-width: 220px;
  box-shadow: 0 2px 12px rgba(0, 14, 33, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.bw-lock-icon {
  font-size: 2rem;
  line-height: 1;
}

.bw-lock-box p {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
}

/* Panel créneaux sous le calendrier */
#bw-cal-content {
  margin-top: 1.5rem;
}

/* ─── Bloc partenaire (au-dessus du calendrier, révélé si "Oui" à la question partenaire) ─── */
.bw-partner {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.2rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.bw-partner-title {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #091C53;
}

.bw-partner-nudge {
  margin: 0 0 0.9rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1E3063;
}

.bw-partner-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E3063;
  margin-bottom: 0.35rem;
}

.bw-partner-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #1E3063;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bw-partner-input:focus {
  border-color: #0540AD;
  box-shadow: 0 0 0 3px rgba(5, 64, 173, 0.12);
}

.bw-partner-input::placeholder {
  color: #94a3b8;
}

/* ─── Chargement ─── */
.bw-loading {
  text-align: center;
  color: #64748b;
  padding: 2rem 0;
  font-size: 0.9rem;
}

/* ─── Jours et créneaux ─── */
.bw-day {
  margin-bottom: 1.75rem;
}

.bw-day-title {
  font-family: 'Merriweather', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #091C53;
  margin: 0 0 0.65rem 0;
  text-transform: capitalize;
}

.bw-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bw-slot {
  padding: 0.45rem 0.9rem;
  border: 1.5px solid #0540AD;
  background: #fff;
  color: #0540AD;
  border-radius: 6px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bw-slot:hover {
  background: #0540AD;
  color: #fff;
}

.bw-slot:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.bw-no-slots {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

/* ─── Messages d'erreur ─── */
.bw-error {
  color: #dc2626;
  font-size: 0.85rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
}

/* ─── Confirmation ─── */
.bw-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1rem;
}

/* ─── Double booking : message remplaçant le calendrier ─── */
.bw-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  gap: 0.75rem;
}

.bw-blocked-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.bw-blocked-title {
  font-family: 'Merriweather', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #000E21;
  margin: 0;
}

.bw-blocked-date {
  margin: 0;
  font-size: 1rem;
  color: #091C53;
  text-transform: capitalize;
}

.bw-blocked-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1E3063;
  max-width: 380px;
}

.bw-blocked-wa {
  margin-top: 0.75rem;
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s;
}

.bw-blocked-wa:hover {
  background: #1ebe5b;
}

.bw-done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0540AD;
  color: #fff;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.bw-done-title {
  font-family: 'Merriweather', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #000E21;
  margin: 0;
}

.bw-done-text {
  color: #1E3063;
  font-size: 1rem;
  max-width: 440px;
  margin: 0;
  line-height: 1.6;
}

.bw-done-meet {
  margin: 0.25rem 0;
}

.bw-done-meet a {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: #0540AD;
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.bw-done-meet a:hover {
  background: #033a99;
}

.bw-done-subtext {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.6;
}

/* ─── Footer ─── */
.bw-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 1.25rem;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

.bw-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bw-footer-tick {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #c4a35a;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .bw-cols {
    grid-template-columns: 1fr;
  }

  .bw-form-col {
    padding: 1.5rem;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .bw-calendar-col {
    padding: 1.5rem;
    background: #fff;
  }

  .bw-steps {
    gap: 0.5rem;
    font-size: 0.82rem;
  }

  .bw-step-separator {
    width: 28px;
  }

  .bw-title {
    font-size: 1.25rem;
  }
}
