/* ============================================================
   Consulenze Booking — Frontend Styles
   ============================================================ */

/* ── Colori tema (modifica qui per aggiornare tutto il plugin) ── */
:root {
  --cb-color: #896e05; /* colore principale */
  --cb-color-rgb: 137, 110, 5; /* stesso colore in formato RGB (per le ombre) */
}

.cb-wrap {
  max-width: 900px;
  margin: 0 auto;
  font-family: inherit;
  color: #1a1a1a;
}

/* ── Griglia righe (analoga al CF7 originale) ── */
.cb-riga {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  /* align-items: flex-end; */
  align-items: anchor-center;
}

/* Unità base: griglia a 20 colonne per massima flessibilità */
.cb-col-2 {
  flex: 0 0 calc(2 / 20 * 100% - 10px);
}
.cb-col-3 {
  flex: 0 0 calc(3 / 20 * 100% - 10px);
}
.cb-col-5 {
  flex: 1 1 calc(5 / 20 * 100% - 10px);
}
.cb-col-7 {
  flex: 1 1 calc(7 / 20 * 100% - 10px);
}
.cb-col-10 {
  flex: 1 1 100%;
}

/* Hint sotto la label del campo */
.cb-field-hint {
  font-weight: 400;
  font-size: 0.82em;
  color: #6b7a8d;
  margin-left: 4px;
}

/* ── Upload file ── */
.cb-field input[type="file"] {
  margin-top: 5px;
  padding: 6px 0;
  border: none;
  font-size: 0.92em;
  color: #3d4a5a;
  cursor: pointer;
  width: 100%;
}

.cb-file-chosen {
  display: block;
  font-size: 0.82em;
  color: var(--cb-color);
  margin-top: 3px;
  min-height: 1em;
}

/* ── Accettazioni legali ── */
.cb-accettazioni {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cb-accettazione {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.93em;
  line-height: 1.5;
  color: #3d4a5a;
}

.cb-accettazione input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--cb-color);
  cursor: pointer;
}

.cb-accettazione a {
  color: var(--cb-color);
  text-decoration: underline;
}

.cb-accettazione a:hover {
  color: #005580;
}

/* ── Step header ── */
.cb-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e8edf2;
  padding-bottom: 14px;
}

.cb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cb-color);
  color: #fff;
  font-weight: 700;
  font-size: 0.95em;
  flex-shrink: 0;
}

.cb-step-header h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  color: #1a1a1a;
}

/* ── Tipologie grid ── */
.cb-tipologie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.cb-tipologia-card {
  border: 2px solid #dde3ea;
  border-radius: 10px;
  padding: 18px;
  cursor: pointer;
  background: #fff;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}

.cb-tipologia-card:hover {
  border-color: var(--cb-color);
  box-shadow: 0 4px 14px rgba(var(--cb-color-rgb), 0.12);
  transform: translateY(-2px);
}

.cb-tipologia-card.cb-selected {
  border-color: var(--cb-color);
  background: #f0f7fb;
  box-shadow: 0 4px 14px rgba(0, 115, 170, 0.18);
}

.cb-tip-nome {
  font-weight: 700;
  font-size: 1.05em;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.cb-tip-desc {
  color: #5a6472;
  font-size: 0.88em;
  margin-bottom: 10px;
  line-height: 1.45;
}

.cb-tip-prezzo {
  color: var(--cb-color);
  font-weight: 700;
  font-size: 1em;
}

.cb-tip-durata {
  font-weight: 400;
  color: #6b7a8d;
  font-size: 0.88em;
  margin-left: 6px;
}

/* ── Consulenti grid ── */
.cb-consulenti-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.cb-consulente-card {
  border: 2px solid #dde3ea;
  border-radius: 10px;
  padding: 20px 24px;
  cursor: pointer;
  text-align: center;
  background: #fff;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
  min-width: 130px;
}

.cb-consulente-card:hover {
  border-color: var(--cb-color);
  box-shadow: 0 4px 14px rgba(var(--cb-color-rgb), 0.12);
  transform: translateY(-2px);
}

.cb-consulente-card.cb-selected {
  border-color: var(--cb-color);
  background: #f0f7fb;
}

.cb-consulente-card img {
  border-radius: 50%;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.cb-con-nome {
  font-weight: 600;
  font-size: 0.98em;
}

/* ── Calendario slot ── */
.cb-calendar-wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cb-calendar-inner {
  flex: 0 0 calc(50% - 12px);
  max-width: calc(50% - 12px);
}

.cb-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cb-cal-title {
  font-weight: 700;
  font-size: 1.1em;
  color: #1a1a1a;
}

.cb-cal-nav {
  background: #fff;
  border: 1.5px solid #c8d0db;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 1em;
  color: #3d4a5a;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.cb-cal-nav:hover {
  border-color: var(--cb-color);
  color: var(--cb-color);
}

.cb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cb-cal-dow {
  text-align: center;
  font-size: 0.75em;
  font-weight: 700;
  color: #6b7a8d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 0 8px;
}

.cb-cal-day,
.cb-cal-empty {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
}

.cb-cal-grey {
  background: #f0f2f5;
  color: #777;
}

.cb-cal-green {
  background: #2ecc71;
  color: #fff;
  cursor: pointer;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.cb-cal-green:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
}

.cb-cal-green.cb-cal-active {
  background: #27ae60;
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(46, 204, 113, 0.45);
}

.cb-cal-red {
  background: #e74c3c;
  color: #fff;
  opacity: 0.65;
}

/* Legenda */
.cb-cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cb-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82em;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

/*.cb-cal-legend-item::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}*/

.cb-cal-legend-item.cb-cal-green::before {
  background: #2ecc71;
}
.cb-cal-legend-item.cb-cal-red::before {
  background: #e74c3c;
  opacity: 0.65;
}
.cb-cal-legend-item.cb-cal-grey::before {
  background: #f0f2f5;
  border: 1px solid #d0d5db;
}

/* Popover orari (a destra del calendario) */
.cb-cal-popover {
  flex: 1;
  background: #fff;
  border: 1.5px solid #dde3ea;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  animation: cb-popover-in 0.15s ease;
  align-self: flex-start;
}

@keyframes cb-popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cb-cal-popover-date {
  font-weight: 700;
  font-size: 0.95em;
  color: #3d4a5a;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #eef0f3;
}

.cb-cal-popover-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cb-cal-posti {
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.75;
}

.cb-slot-btn {
  padding: 8px 16px;
  border: 2px solid #dde3ea;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95em;
  transition:
    border-color 0.15s,
    background 0.15s;
  color: #1a1a1a;
}

.cb-slot-btn:hover {
  border-color: var(--cb-color);
  background: #f5fafd;
}

.cb-slot-btn.cb-selected {
  border-color: var(--cb-color);
  background: #e8f4fb;
  color: var(--cb-color);
  font-weight: 700;
}

/* ── Riepilogo box ── */
.cb-riepilogo {
  background: #f5f7fa;
  border-left: 4px solid var(--cb-color);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 0.95em;
  line-height: 1.7;
}

.cb-riepilogo strong {
  color: var(--cb-color);
}

/* ── Form campi ── */
.cb-form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.cb-field-row {
  display: flex;
  gap: 16px;
}

.cb-field-row--2 > .cb-field {
  flex: 1;
}

.cb-field {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  font-size: 0.95em;
  color: #3d4a5a;
}

.cb-field input,
.cb-field textarea {
  margin-top: 5px;
  padding: 10px 13px;
  border: 1.5px solid #c8d0db;
  border-radius: 6px;
  font-size: 0.97em;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
  width: 100%;
}

.cb-field input:focus,
.cb-field textarea:focus {
  outline: none;
  border-color: var(--cb-color);
  box-shadow: 0 0 0 3px rgba(var(--cb-color-rgb), 0.1);
}

.cb-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Stripe card element ── */
.cb-card-container {
  margin-bottom: 18px;
}

#cb-card-element {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1.5px solid #c8d0db;
  border-radius: 6px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

#cb-card-element.StripeElement--focus {
  border-color: var(--cb-color);
  box-shadow: 0 0 0 3px rgba(var(--cb-color-rgb), 0.1);
}

#cb-card-element.StripeElement--invalid {
  border-color: #e74c3c;
}

/* ── Badge sicurezza ── */
.cb-secure-badge {
  font-size: 0.83em;
  color: #6b7a8d;
  margin-bottom: 18px;
  padding: 8px 12px;
  background: #f5f7fa;
  border-radius: 5px;
}

/* ── Azioni step (pulsanti) ── */
.cb-step-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cb-btn-back {
  background: none;
  border: 1.5px solid #b0b8c4;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  color: #5a6472;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.cb-btn-back,
.cb-btn-primary,
.cb-cal-nav,
.cb-slot-btn {
  display: flex;
  align-items: center;
}

.cb-btn-back:hover {
  border-color: var(--cb-color);
  color: var(--cb-color);
}

.cb-btn-primary {
  background: var(--cb-color);
  color: #fff;
  border: none;
  padding: 12px 26px;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.cb-btn-primary:hover {
  /* background: #005580; */
  background: #fff;
  color: #896e05;
  box-shadow: inset 0px 0px 0px 1px #896e05;
}

.cb-btn-primary:active {
  transform: scale(0.98);
}

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

.cb-btn-pay {
  min-width: 150px;
}

/* ── Errori ── */
.cb-error {
  color: #c0392b;
  background: #fdecea;
  border: 1px solid #e74c3c;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.93em;
}

/* ── Loading ── */
.cb-loading {
  text-align: center;
  padding: 50px 20px;
  color: #6b7a8d;
}

.cb-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e5ea;
  border-top-color: var(--cb-color);
  border-radius: 50%;
  animation: cb-spin 0.7s linear infinite;
  margin: 0 auto 18px;
}

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

/* ── Success ── */
.cb-success {
  text-align: center;
  padding: 40px 20px;
}

.cb-success-icon {
  width: 64px;
  height: 64px;
  background: #2ecc71;
  color: #fff;
  border-radius: 50%;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.cb-success h3 {
  color: #2ecc71;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.cb-success .cb-riepilogo {
  max-width: 420px;
  margin: 20px auto 0;
  text-align: left;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cb-field-row--2 {
    flex-direction: column;
  }

  .cb-tipologie-grid {
    grid-template-columns: 1fr;
  }

  .cb-consulente-card {
    flex: 1 1 100%;
  }

  /* Su mobile tutte le colonne vanno a piena larghezza */
  .cb-col-2,
  .cb-col-3,
  .cb-col-5,
  .cb-col-7,
  .cb-col-10 {
    flex: 1 1 100%;
  }

  /* Calendario: colonna su mobile */
  .cb-calendar-wrap {
    flex-direction: column;
  }

  .cb-calendar-inner {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
