/* D'Angio Prenotazioni – il tema può ridefinire le variabili --dgb-* */
.dgb-app, .dgb-action-card {
	--_ink: var(--dgb-ink, #12302a);
	--_surface: var(--dgb-surface, #fbfaf6);
	--_soft: var(--dgb-soft, #eeebe2);
	--_line: var(--dgb-line, #d9d4c6);
	--_muted: var(--dgb-muted, #5d6560);
	--_accent: var(--dgb-accent, #c59a4a);
	--_accent-ink: var(--dgb-accent-ink, #12302a);
	--_focus: var(--dgb-focus, #2f6bd8);
	--_display: var(--dgb-font-display, inherit);
	--_r: var(--dgb-radius, 14px);
	color: var(--_ink);
	background: var(--_surface);
	border-radius: var(--_r);
	font-size: 1rem;
	line-height: 1.5;
}
.dgb-app { padding: clamp(18px, 3vw, 36px); position: relative; }
.dgb-app *, .dgb-app *::before, .dgb-app *::after { box-sizing: border-box; }
.dgb-app button { font: inherit; color: inherit; cursor: pointer; }
.dgb-app [hidden] { display: none !important; }
.dgb-app :focus-visible, .dgb-action-card :focus-visible { outline: 3px solid var(--_focus); outline-offset: 2px; }
.dgb-loading, .dgb-hint, .dgb-empty { color: var(--_muted); padding: 12px 0; }
.dgb-error, .dgb-flash { color: #8a1f1f; background: #fbeaea; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }

/* Passaggi */
.dgb-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 26px; padding: 0; counter-reset: s; }
.dgb-steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--_muted); }
.dgb-steps li::before { content: ""; height: 3px; border-radius: 3px; background: var(--_line); transition: background .3s; }
.dgb-steps li.is-done::before, .dgb-steps li.is-current::before { background: var(--_accent); }
.dgb-steps li.is-current { color: var(--_ink); font-weight: 600; }
.dgb-steps-n { display: none; }
@media (max-width: 640px) { .dgb-steps-l { display: none; } .dgb-steps li.is-current .dgb-steps-l { display: inline; } .dgb-steps li { flex: 1 1 0; } .dgb-steps li.is-current { flex: 4; } }

.dgb-panel { outline: none; min-height: 220px; }
.dgb-panel.is-in { animation: dgb-in .35s ease both; }
@keyframes dgb-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .dgb-panel.is-in { animation: none; } }

.dgb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dgb-head h3 { margin: 0; font-family: var(--_display); font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.15; font-weight: 700; }
.dgb-sub { margin: 0; color: var(--_muted); width: 100%; }
.dgb-note { color: var(--_muted); font-size: .92rem; margin: 0 0 14px; max-width: 62ch; }

/* Persone */
.dgb-counter { display: inline-flex; align-items: center; border: 1.5px solid var(--_line); border-radius: 999px; }
.dgb-counter button { width: 42px; height: 42px; border: 0; background: none; font-size: 1.3rem; border-radius: 999px; }
.dgb-counter button:disabled { opacity: .3; cursor: default; }
.dgb-counter output { min-width: 2ch; text-align: center; font-weight: 700; font-size: 1.1rem; }
.dgb-person { border: 0; padding: 0; margin: 0 0 22px; }
.dgb-person legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.dgb-pname { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: .9rem; color: var(--_muted); }
.dgb-pname input { max-width: 220px; }

/* Servizi */
.dgb-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.dgb-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px 12px 40px; border-radius: 10px; border: 1.5px solid var(--_line); background: var(--_surface); position: relative; transition: border-color .2s, background .2s; }
.dgb-chip::before { content: ""; position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--_muted); transition: all .2s; }
.dgb-chip[aria-pressed="true"] { border-color: var(--_ink); background: var(--_soft); }
.dgb-chip[aria-pressed="true"]::before { background: var(--_ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/100% no-repeat; border-color: var(--_ink); }
.dgb-chip:hover { border-color: var(--_muted); }
.dgb-chip-name { font-weight: 600; }
.dgb-chip-meta { font-size: .85rem; color: var(--_muted); }

/* Barbieri */
.dgb-barbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dgb-barber { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border: 1.5px solid var(--_line); border-radius: var(--_r); background: var(--_surface); text-align: center; transition: border-color .2s, transform .2s; }
.dgb-barber:hover { border-color: var(--_muted); }
.dgb-barber[aria-pressed="true"] { border-color: var(--_ink); background: var(--_soft); }
.dgb-barber-img { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--_ink); color: var(--_accent); display: grid; place-items: center; font-family: var(--_display); font-size: 2rem; font-weight: 700; }
.dgb-barber-img img { width: 100%; height: 100%; object-fit: cover; }
.dgb-barber-name { font-weight: 700; }
.dgb-barber-role { font-size: .85rem; color: var(--_muted); }

/* Calendario */
.dgb-when { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: clamp(18px, 3vw, 36px); align-items: start; }
@media (max-width: 720px) { .dgb-when { grid-template-columns: 1fr; } }
.dgb-cal.is-busy { opacity: .5; pointer-events: none; }
.dgb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dgb-cal-head strong { text-transform: capitalize; }
.dgb-cal-head button { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--_line); background: none; font-size: 1.2rem; }
.dgb-cal-head button:disabled { opacity: .3; cursor: default; }
.dgb-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dgb-wd { font-size: .75rem; text-align: center; color: var(--_muted); padding: 4px 0; }
.dgb-day { aspect-ratio: 1; border: 0; border-radius: 8px; background: var(--_soft); font-weight: 600; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.dgb-day:hover:not(:disabled) { background: var(--_line); }
.dgb-day:disabled { background: none; color: var(--_muted); opacity: .45; font-weight: 400; cursor: default; }
.dgb-day.is-full:disabled { text-decoration: line-through; }
.dgb-day.is-today { box-shadow: inset 0 0 0 1.5px var(--_muted); }
.dgb-day[aria-pressed="true"] { background: var(--_ink); color: var(--_surface); }
.dgb-slots-day { margin: 4px 0 12px; font-weight: 600; }
.dgb-slots-day::first-letter { text-transform: uppercase; }
.dgb-slot-group { margin-bottom: 14px; }
.dgb-slot-group > span { display: block; font-size: .85rem; color: var(--_muted); margin-bottom: 6px; }
.dgb-slot-group > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.dgb-slot { padding: 9px 0; border-radius: 8px; border: 1.5px solid var(--_line); background: var(--_surface); font-variant-numeric: tabular-nums; font-weight: 600; }
.dgb-slot:hover { border-color: var(--_ink); }
.dgb-slot[aria-pressed="true"] { background: var(--_accent); border-color: var(--_accent); color: var(--_accent-ink); }

/* Dati */
.dgb-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.dgb-form .dgb-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .dgb-form { grid-template-columns: 1fr; } }
.dgb-form label > span { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 5px; }
.dgb-form small { display: block; color: var(--_muted); margin-top: 4px; }
.dgb-app input[type=text], .dgb-app input[type=email], .dgb-app input[type=tel], .dgb-app textarea {
	width: 100%; font: inherit; color: var(--_ink); background: #fff; border: 1.5px solid var(--_line); border-radius: 8px; padding: 11px 12px;
}
.dgb-app input:focus, .dgb-app textarea:focus { border-color: var(--_ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--_focus) 35%, transparent); }
.dgb-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.dgb-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--_ink); flex: none; }
.dgb-check a { color: inherit; }
.dgb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Riepilogo */
.dgb-summary { margin: 0 0 18px; display: grid; gap: 0; }
.dgb-summary > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--_line); }
.dgb-summary dt { color: var(--_muted); font-size: .9rem; }
.dgb-summary dd { margin: 0; font-weight: 600; }
.dgb-link { background: none; border: 0; padding: 0; margin-left: 8px; text-decoration: underline; font-weight: 400 !important; color: var(--_muted) !important; font-size: .9rem; }
@media (max-width: 520px) { .dgb-summary > div { grid-template-columns: 1fr; gap: 2px; } }

/* Barra in basso */
.dgb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--_line); margin-top: 24px; padding-top: 18px; }
.dgb-bar-total span { color: var(--_muted); }
.dgb-bar-actions { display: flex; gap: 8px; margin-left: auto; }

/* Pulsanti */
.dgb-app .dgb-btn, .dgb-action-card .dgb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: var(--dgb-btn-radius, 999px); border: 1.5px solid var(--_ink); background: transparent; color: var(--_ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.dgb-app .dgb-btn:active { transform: scale(.98); }
.dgb-app .dgb-btn-primary, .dgb-action-card .dgb-btn-primary { background: var(--_ink); color: var(--_surface); }
.dgb-app .dgb-btn-primary:hover, .dgb-action-card .dgb-btn-primary:hover { background: color-mix(in srgb, var(--_ink) 85%, #000); }
.dgb-app .dgb-btn-ghost { border-color: var(--_line); }
.dgb-action-card .dgb-btn-danger { border-color: #8a1f1f; color: #8a1f1f; }
.dgb-app .dgb-btn.is-disabled { opacity: .45; }
.dgb-app .dgb-btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.dgb-app .dgb-btn[disabled] { opacity: .6; cursor: progress; }

/* Conferma */
.dgb-done { text-align: center; padding: 30px 10px; outline: none; }
.dgb-done h3 { font-family: var(--_display); font-size: 2rem; margin: 10px 0; }
.dgb-done p { max-width: 46ch; margin: 0 auto 10px; }
.dgb-done .dgb-btn { margin-top: 14px; }
.dgb-done-mark { width: 64px; height: 64px; fill: none; stroke: var(--_accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dgb-done-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: dgb-draw .6s ease forwards; }
.dgb-done-mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: dgb-draw .4s .5s ease forwards; }
@keyframes dgb-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .dgb-done-mark * { animation: none; stroke-dashoffset: 0; } }

/* Pagina azioni da email */
.dgb-action-page { padding: clamp(40px, 8vw, 100px) 16px; display: flex; justify-content: center; }
.dgb-action-card { width: 100%; max-width: 620px; padding: clamp(22px, 4vw, 44px); box-shadow: 0 1px 0 var(--_line); }
.dgb-action-card h1 { font-family: var(--_display); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 18px; }
.dgb-action-kicker { color: var(--_muted); margin: 0 0 6px; }
.dgb-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dgb-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 18px; }
.dgb-notice-ok { background: #e4f1e8; color: #14532d; }
.dgb-notice-err { background: #fbeaea; color: #8a1f1f; }
.dgb-msg { margin: 0 0 12px; padding: 10px 16px; border-left: 3px solid var(--_accent); background: var(--_soft); font-style: italic; }
.dgb-small { color: var(--_muted); font-size: .9rem; margin-top: 14px; }
