/* ====== Booking Widget (UI refresh) ====== */
.cbw-card{
  max-width: 920px;
  margin: 46px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(17,24,39,.08);
  padding: 2rem 2rem 2.2rem;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
}
.cbw-title-xl{ font-size: 1.85rem; font-weight: 800; letter-spacing:.2px; margin: 0 0 1.2rem; text-align:center }

/* Campo Livello */
.cbw-field{ margin-bottom: 1rem; }
.cbw-label{ display:block; font-weight:700; font-size:.95rem; margin-bottom:6px;}
.cbw-select{
  width:100%; padding:.8rem 1rem; border-radius:12px;
  border:1px solid #e5e7eb; background:#f9fafb; font-size:1rem; color:#111827;
}
.cbw-select:focus{ outline:none; box-shadow:0 0 0 4px rgba(59,130,246,.15); border-color:#93c5fd; }

/* Nav calendario */
.cbw-calendar-container{ margin-top:.6rem; }
.cbw-cal-nav{ display:flex; align-items:center; justify-content:space-between; margin-bottom:.6rem; }
.cbw-month-title{ font-weight:900; font-size:1.15rem; text-transform:capitalize; }
.cbw-nav-btn{
  border:1px solid #3b82f6; background:#fff; color:#1d4ed8;
  border-radius:999px; width:38px; height:38px; font-size:1.2rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:.18s ease;
}
.cbw-nav-btn:hover{ background:#1d4ed8; color:#fff; transform:translateY(-1px) scale(1.06); }

/* Calendario */
.cbw-calendar{ display:grid; grid-template-columns:repeat(7,1fr); gap:10px; }
.cbw-calendar .day-label{ font-weight:700; font-size:.82rem; color:#6b7280; text-transform:uppercase; text-align:center; letter-spacing:.4px; }
.cbw-calendar .day{
  border-radius:12px; padding:.8rem 0; font-weight:900;
  border:1px solid #e5e7eb; cursor:pointer; user-select:none;
  transition: transform .06s ease, background-color .2s ease, color .2s ease, box-shadow .18s ease;
  box-shadow: inset 0 0 0 0 transparent;
}
.cbw-calendar .day.selected{ box-shadow: inset 0 0 0 3px rgba(17,24,39,.7); }
.cbw-calendar .green{ background:#16a34a; color:#fff; border-color:#16a34a; }
.cbw-calendar .green:hover{ background:#15803d; transform: translateY(-1px); }
.cbw-calendar .red{ background:#f3f4f6; color:#94a3b8; border-color:#e5e7eb; cursor:not-allowed; }
.cbw-calendar .disabled{ opacity:.5; pointer-events:none; }

/* Conferma */
.cbw-confirm-wrap{ margin-top:14px; display:flex; align-items:center; gap:12px; justify-content:space-between; }
.cbw-selected-label{ font-weight:700; color:#111827; min-height:24px; }
.cbw-confirm-btn{
  padding:.8rem 1.1rem; border-radius:12px; border:0; font-weight:900; letter-spacing:.2px;
  background:#111827; color:#fff; cursor:pointer; transition:.15s ease;
}
.cbw-confirm-btn:hover:not([disabled]){ filter:brightness(1.1); transform:translateY(-1px); }
.cbw-confirm-btn[disabled]{ opacity:.45; cursor:not-allowed; }

/* STEP 2 */
.cbw-step2{ margin-top:10px; }
.cbw-step2-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.cbw-step2-title{ font-size:1.05rem; font-weight:900; display:flex; align-items:center; gap:8px; }
.cbw-picked-info{ font-size:.95rem; font-weight:700; color:#334155; }
.cbw-back-btn{ background:#fff; border:1px solid #e5e7eb; color:#111827; border-radius:12px; padding:.55rem .9rem; cursor:pointer; transition:.15s; }
.cbw-back-btn:hover{ background:#f8fafc; transform:translateY(-1px); }

/* Griglia maestri */
.cbw-teachers{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; }
@media (max-width: 860px){ .cbw-teachers{ grid-template-columns:repeat(2,1fr); } }
@media (max-width: 520px){ .cbw-teachers{ grid-template-columns:repeat(1,1fr); } }

.cbw-teacher{
  position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:#ffffff; border:1px solid #e5e7eb; border-radius:16px;
  padding:18px 14px; text-align:center; cursor:pointer;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.cbw-teacher:hover{ transform: translateY(-2px); box-shadow:0 8px 22px rgba(2,6,23,.08); border-color:#dbeafe; }

.cbw-teacher-photo{
  width:128px; height:128px; border-radius:50%;
  background:#e5e7eb center/cover no-repeat;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), 0 2px 0 rgba(2,6,23,.03);
  margin-bottom:12px;
}
.cbw-teacher-name{ font-weight:900; font-size:1.05rem; color:#0f172a; }

/* —— DETTAGLIO (focus) —— */
.cbw-step2.cbw-detail-open .cbw-teachers{ display:none; } /* nasconde la griglia */
.cbw-teacher-detail{
  margin-top:14px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  box-shadow: 0 14px 34px rgba(2,6,23,.1);
  padding: 22px 18px;
  max-width: 720px;
  margin-left:auto; margin-right:auto;
  animation: cbwPop .18s ease-out;
}
@keyframes cbwPop{ from{ transform:scale(.98); opacity:.0 } to{ transform:scale(1); opacity:1 } }

.cbw-teacher-hero{ display:flex; align-items:center; gap:18px; justify-content:center; }
.cbw-td-photo{
  width:180px; height:180px; border-radius:50%;
  background:#e5e7eb center/cover no-repeat;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.95), 0 8px 24px rgba(2,6,23,.08);
}
.cbw-td-meta{ text-align:center; }
.cbw-td-name{ font-weight:1000; font-size:1.45rem; letter-spacing:.2px; }
.cbw-td-date-level{ margin-top:4px; font-weight:700; color:#475569; }

.cbw-td-slots-wrap{ margin-top:18px; }
.cbw-td-title{ font-weight:900; margin-bottom:10px; text-align:center; font-size:1.05rem; }
.cbw-slots{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }

/* Pill orari */
.cbw-slot{
  border-radius:999px; border:2px solid transparent; padding:.6rem 1rem;
  font-weight:900; letter-spacing:.2px; cursor:pointer; transition:.15s ease;
}
.cbw-slot.green{ background:#16a34a; color:#fff; border-color:#16a34a; }
.cbw-slot.green:hover{ background:#15803d; transform: translateY(-1px); }
.cbw-slot.red{ background:#f3f4f6; color:#94a3b8; border-color:#e5e7eb; cursor:not-allowed; }
.cbw-slot.picked{
  position:relative;
  box-shadow: 0 8px 22px rgba(22,163,74,.25);
  outline: 3px solid rgba(15,23,42,.9);
}

/* Azioni dettaglio */
.cbw-td-actions{ margin-top:14px; display:flex; justify-content:center; }
.cbw-slots-confirm{
  padding:.8rem 1.15rem; border-radius:14px; border:0; font-weight:1000; letter-spacing:.2px;
  background:#0f172a; color:#fff; cursor:pointer; transition:.15s ease;
}
.cbw-slots-confirm:hover{ filter:brightness(1.1); transform:translateY(-1px); }

/* Helpers */
.cbw-empty{ text-align:center; color:#6b7280; padding:12px 4px; }
.cbw-loading{ text-align:center; color:#111827; padding:12px 4px; }

/* Responsive */
@media (max-width: 620px){
  .cbw-td-photo{ width:150px; height:150px; }
}
