/* Prenotic v2 — Flusso booking */

.booking-page { background: var(--color-cream); min-height: 100vh; padding-bottom: 40px; }

.booking-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--color-bg); border-bottom: 0.5px solid var(--color-line);
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
}
.booking-header-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.salon-name-mini { font-size: 12px; color: var(--color-text-mute); font-weight: 500; letter-spacing: 0.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-spacer { width: 32px; flex-shrink: 0; }
.back-btn { display: flex; align-items: center; justify-content: center; min-width: var(--tap-min); min-height: var(--tap-min); margin-left: -12px; color: var(--color-text); flex-shrink: 0; }
.back-btn:active { opacity: 0.6; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 4px; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--color-warm-2); color: var(--color-text-mute); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; transition: background-color 200ms, color 200ms; flex-shrink: 0; }
.step-dot.active { background: var(--color-text); color: var(--color-bg); }
.step-dot.done { background: var(--color-accent); color: var(--color-bg); }
.step-line { height: 2px; width: 32px; background: var(--color-warm-2); border-radius: 2px; transition: background-color 300ms; }
.step-line.done { background: var(--color-accent); }

.booking-main { padding: 20px; max-width: 640px; margin: 0 auto; }
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-heading { margin-bottom: 24px; text-align: left; }
.step-eyebrow { margin: 0 0 4px; font-size: 12px; color: var(--color-text-mute); letter-spacing: 0.06em; text-transform: uppercase; }
.step-title { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--color-text); line-height: 1.2; }

/* STEP 1 */
.service-category + .service-category { margin-top: 24px; }
.service-cat-title { margin: 0 0 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-mute); padding: 0 4px; }
.service-card { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--color-bg); border: 0.5px solid var(--color-line); border-radius: var(--radius-md); padding: 16px; margin: 0 0 8px; text-align: left; font-family: inherit; cursor: pointer; transition: transform 120ms; }
.service-card:active { transform: scale(0.99); background: var(--color-warm-1); }
.service-card-main { flex: 1; min-width: 0; }
.service-card-name { font-size: 15px; font-weight: 500; color: var(--color-text); margin-bottom: 3px; }
.service-card-desc { font-size: 13px; color: var(--color-text-mute); margin-bottom: 6px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.service-card-meta { font-size: 13px; color: var(--color-text-mute); display: flex; gap: 6px; align-items: center; }
.service-card-sep { color: var(--color-text-soft); }
.service-card-price { font-weight: 500; color: var(--color-text); }
.service-card-chevron { color: var(--color-text-soft); flex-shrink: 0; }

/* STEP 2 */
.chosen-service { display: flex; align-items: center; gap: 10px; background: var(--color-warm-1); border: 0.5px solid var(--color-line); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 20px; }
.chosen-service-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--color-warm-2); display: flex; align-items: center; justify-content: center; color: var(--color-text); flex-shrink: 0; }
.chosen-service-text { flex: 1; min-width: 0; }
.chosen-service-name { font-size: 14px; font-weight: 500; color: var(--color-text); }
.chosen-service-meta { font-size: 12px; color: var(--color-text-mute); margin-top: 1px; }
.chosen-service-edit { background: transparent; border: none; color: var(--color-text-mute); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 8px; min-height: 32px; }

.staff-picker { margin-bottom: 20px; }
.staff-picker-label { display: block; font-size: 13px; color: var(--color-text-mute); margin-bottom: 8px; }
.staff-picker-options { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: var(--radius-pill); background: var(--color-bg); border: 0.5px solid var(--color-line); font-size: 14px; color: var(--color-text); font-family: inherit; cursor: pointer; min-height: 40px; }
.staff-chip.selected { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.staff-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }

.calendar-wrap { background: var(--color-bg); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav { min-width: var(--tap-min); min-height: var(--tap-min); display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--color-text); cursor: pointer; }
.cal-nav:active { opacity: 0.5; }
.cal-title { font-size: 15px; font-weight: 500; color: var(--color-text); text-transform: capitalize; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-weekdays > div { text-align: center; font-size: 11px; color: var(--color-text-mute); padding: 4px 0; font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--color-text); border-radius: 50%; background: transparent; border: none; font-family: inherit; cursor: pointer; padding: 0; position: relative; }
.cal-day:empty { pointer-events: none; }
.cal-day:disabled { color: var(--color-text-soft); cursor: not-allowed; background: transparent !important; }
.cal-day.day-free { background: #EAF3DE; color: #27500A; }
.cal-day.day-medium { background: #FAEEDA; color: #633806; }
.cal-day.day-full { background: #FCEBEB; color: #791F1F; }
.cal-day.day-closed { background: transparent; color: var(--color-text-soft); }
.cal-day.day-past { background: transparent; color: var(--color-text-soft); }
.cal-day.today { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.cal-day.selected { background: var(--color-text) !important; color: var(--color-bg) !important; font-weight: 500; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; padding-top: 10px; border-top: 0.5px solid var(--color-line-soft); }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--color-text-mute); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot-free { background: #EAF3DE; border: 1px solid #C0DD97; }
.legend-dot-medium { background: #FAEEDA; border: 1px solid #FAC775; }
.legend-dot-full { background: #FCEBEB; border: 1px solid #F7C1C1; }
.legend-dot-closed { background: var(--color-warm-2); }

.slots-wrap { background: var(--color-bg); border-radius: var(--radius-lg); padding: 20px 16px; }
.slots-label { font-size: 13px; color: var(--color-text-mute); margin-bottom: 12px; }
#slotsForDate { color: var(--color-text); font-weight: 500; }
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-btn { padding: 14px 4px; border: 0.5px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-bg); font-size: 14px; color: var(--color-text); font-family: inherit; cursor: pointer; position: relative; min-height: var(--tap-min); }
.slot-btn.recommended { border-color: var(--color-text); background: var(--color-warm-1); }
.slot-btn.recommended::before { content: "Consigliato"; position: absolute; top: -8px; right: 4px; background: var(--color-text); color: var(--color-bg); font-size: 9px; font-weight: 500; padding: 3px 7px; border-radius: 20px; letter-spacing: 0.02em; }
.slots-empty { padding: 24px; text-align: center; color: var(--color-text-mute); font-size: 14px; }

/* STEP 3 — RIEPILOGO SISTEMATO */
.booking-summary {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 0.5px solid var(--color-line);
  overflow: hidden;
}
.summary-rows { padding: 16px 20px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; align-items: flex-start; }
.summary-label { font-size: 12px; color: var(--color-text-mute); min-width: 90px; flex-shrink: 0; padding-top: 2px; }
.summary-value { font-size: 14px; color: var(--color-text); text-align: right; font-weight: 500; line-height: 1.35; }
.summary-footer { border-top: 0.5px solid var(--color-line-soft); padding: 0; background: var(--color-warm-1); }
.summary-edit { display: block; width: 100%; background: transparent; border: none; color: var(--color-text-mute); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; padding: 12px; text-align: center; min-height: var(--tap-min); }
.summary-edit:active { background: var(--color-warm-2); }

.client-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; }
.field-label { font-size: 13px; color: var(--color-text); margin-bottom: 6px; font-weight: 500; }
.field-optional { color: var(--color-text-mute); font-weight: 400; }
.field input, .field textarea { padding: 14px 16px; border: 0.5px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-bg); font-size: 16px; font-family: inherit; color: var(--color-text); min-height: var(--tap-min); -webkit-appearance: none; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--color-text); }
.field-hint { font-size: 12px; color: var(--color-text-mute); margin: 6px 4px 0; min-height: 16px; }
.field-hint.welcome { color: #2E7D32; font-weight: 500; }
.field-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--color-text-mute); cursor: pointer; padding: 6px 4px; }
.field-checkbox input[type="checkbox"] { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--color-text); flex-shrink: 0; }
.field-checkbox a { color: var(--color-text); text-decoration: underline; }

.submit-btn { margin-top: 8px; position: relative; }
.submit-btn.loading .submit-label { visibility: hidden; }
.submit-btn.loading .submit-spinner { display: flex; align-items: center; justify-content: center; position: absolute; inset: 0; }
.submit-spinner svg { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { padding: 12px 14px; background: #FCEBEB; color: #791F1F; border-radius: var(--radius-sm); font-size: 13px; margin: 8px 0 0; }

.success-wrap { text-align: center; padding: 48px 20px; }
.success-icon { width: 80px; height: 80px; border-radius: 50%; background: #EAF3DE; color: #27500A; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.success-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 12px; color: var(--color-text); }
.success-text { font-size: 15px; color: var(--color-text-mute); margin: 0 0 32px; line-height: 1.5; }
.success-btn { min-width: 200px; }

@media (min-width: 768px) {
  .booking-main { padding: 32px 24px; }
  .step-title { font-size: 26px; }
  .slots-grid { grid-template-columns: repeat(4, 1fr); }
}
