/* Prenotazione pubblica: mobile-first, colori del marchio dal branding del tenant (--brand). */

body { background: var(--bg); }
.pb { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

.pb-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); padding-top: max(var(--sp-4), env(safe-area-inset-top)); }
.pb-head img { max-height: 48px; width: auto; }
.pb-head-text { display: flex; flex-direction: column; min-width: 0; }
.pb-head-text strong { font-size: 1.25rem; line-height: 1.2; }
.pb-loc { color: var(--text-muted); font-size: var(--fs-sm); }
.pb-loc:empty { display: none; }

.pb-main { flex: 1; padding: 0 var(--sp-4) var(--sp-5); }
.pb-progress-wrap { margin-bottom: var(--sp-3); }
.pb-steplabel { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 6px; }
.pb-progress { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.pb-progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.2s ease; }

.pb-step {
  display: flex; flex-direction: column; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-4); box-shadow: var(--shadow-sm);
}
.pb-step h1 { font-size: 1.375rem; margin: 0; outline: none; }
.pb-step p { margin: 0; }
.pb-help { color: var(--text-muted); font-size: var(--fs-md); }
.pb-subtitle { font-size: var(--fs-md); margin: 0; color: var(--text-muted); }
.pb-label { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
/* 16 px o più: iOS non ingrandisce la pagina sul campo */
.pb-input { min-height: 52px; font-size: 1.1875rem; border-radius: var(--radius); }
.pb-error { color: var(--danger); font-weight: 600; }
.pb-error:empty { display: none; }
.pb-notice { background: var(--warn-soft); color: var(--warn); padding: var(--sp-3); border-radius: var(--radius-sm); font-weight: 600; }

.pb-actions { display: flex; gap: var(--sp-2); }
.pb-actions .btn { min-height: 52px; font-size: 1.0625rem; border-radius: var(--radius); }
.pb-next { flex: 1; }
.pb-back { flex: 0 0 auto; }
.pb-wide { width: 100%; min-height: 52px; font-size: 1.0625rem; border-radius: var(--radius); }
.pb-confirm { min-height: 56px; font-size: 1.125rem; }

/* Scelte (lavoro) */
.pb-choices { display: flex; flex-direction: column; gap: var(--sp-2); }
.pb-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 64px;
  padding: var(--sp-3) var(--sp-4); text-align: left; cursor: pointer;
  border: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit;
}
.pb-choice strong { font-size: 1.0625rem; }
.pb-choice span { color: var(--text-muted); font-size: var(--fs-sm); }
.pb-choice:hover, .pb-choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.pb-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.pb-type { align-items: center; justify-content: center; text-align: center; font-weight: 600; min-height: 52px; }
.pb-choice-alt { border-style: dashed; }

/* Giorni e orari liberi */
.pb-other { display: flex; flex-direction: column; gap: var(--sp-3); }
.pb-days { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.pb-day {
  flex: 0 0 auto; min-width: 64px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 6px 8px; scroll-snap-align: start; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit;
}
.pb-day span { font-size: var(--fs-xs); color: var(--text-muted); text-transform: capitalize; }
.pb-day strong { font-size: 1.25rem; }
.pb-day[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.pb-day[aria-pressed="true"] span { color: var(--brand-contrast); }
.pb-datepick { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.pb-day-slots { display: flex; flex-direction: column; gap: var(--sp-2); }
.pb-day-title { font-size: var(--fs-md); margin: 0; }
.pb-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--sp-2); }
.pb-time {
  min-height: 48px; cursor: pointer; font: inherit; font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.pb-time:hover, .pb-time.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* Riepilogo */
.pb-summary { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pb-row { display: grid; grid-template-columns: 6.5em 1fr; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.pb-row dt { color: var(--text-muted); }
.pb-row dd { margin: 0; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.pb-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pb-edit { background: none; border: 0; color: var(--brand); font: inherit; font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 32px; padding: 0; }
.pb-consents { display: flex; flex-direction: column; gap: var(--sp-3); }
.pb-check { display: flex; gap: var(--sp-3); align-items: flex-start; cursor: pointer; }
.pb-check input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.pb-check > span { display: flex; flex-direction: column; gap: 2px; }

/* Fatto */
.pb-done { align-items: center; text-align: center; }
.pb-done-icon {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-size: 2.25rem; font-weight: 800;
}
.pb-done-when { font-size: 1.25rem; font-weight: 700; }
.pb-done-msg { font-weight: 600; }

.pb-foot { padding: var(--sp-4); padding-bottom: max(var(--sp-4), env(safe-area-inset-bottom)); color: var(--text-muted); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: var(--sp-2); }
.pb-foot p { margin: 0; }
.pb-hours { list-style: none; margin: 4px 0 0; padding: 0; }
.pb-noscript { max-width: 560px; margin: var(--sp-4) auto; padding: var(--sp-4); }

@media (min-width: 600px) {
  .pb-head { padding-top: var(--sp-5); }
  .pb-step { padding: var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) {
  .pb-progress span { transition: none; }
}
