.pref-wrap{ max-width:800px; margin:0 auto; }

/* card */
.pref-card{ background:#fff; border-radius:10px; box-shadow:7px 0px 15px rgba(0,0,0,0.1); padding:30px 40px; margin-bottom:20px; text-align:left; }
.pref-card h3{ font-size:22px; font-weight:600; margin:0 0 4px; display:flex; align-items:center; gap:10px; }
.pref-card h3 .pref-num{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; flex:none; background:var(--primary-color-coupon); color:#fff; font-size:16px; }
.pref-card-desc{ margin-bottom:20px; }

/* intestazione contatto */
.pref-who{ display:flex; flex-wrap:wrap; gap:8px 24px; align-items:center; justify-content:center; font-size:18px; padding:20px 40px; }
.pref-who span{ display:inline-flex; gap:10px; font-weight:300; align-items:center; }
.pref-who i{ color:var(--primary-color-coupon); font-size:18px; }

/* righe */
.pref-row{ display:flex; gap:15px; align-items:flex-start; padding:20px 0; border-top:1px solid #e1e1e1; }
.pref-row[hidden]{ display:none; }
.pref-card h3 + .pref-card-desc + .pref-row, .pref-card .pref-row:first-of-type{ border-top:0; }
.pref-row .pref-icon{ flex:none; width:40px; height:40px; border-radius:5px; display:flex; align-items:center; justify-content:center; background:var(--primary-color-coupon); color:#fff; font-size:18px; }
.pref-row .pref-text{ flex:1; min-width:0; }
.pref-row .pref-text .pref-title-row{ display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; }
.pref-title{ font-weight:600; font-size:18px; margin:0; cursor:pointer; }
.pref-row.is-locked .pref-title{ cursor:default; }
.pref-desc{ font-size:16px; line-height:1.5; }
.pref-desc p:last-child{ margin-bottom:0px;}
.pref-desc a{ color:var(--primary-color-coupon); text-decoration:underline; }
.pref-desc a:hover{ text-decoration:none;}
.pref-meta{ margin:10px 0 0 0; font-size:13px; line-height:1; color:#666; }
.pref-meta:empty{ display:none; }
.pref-meta.pending{ color:#a94442; font-weight:500; }
.pref-row.pref-sub{ margin-left:56px; padding:0px; padding-bottom:20px; border-top:0;}
.pref-row.pref-sub .pref-title{ font-size:18px; }
.pref-row .pref-lock{ flex:none; width:50px; text-align:center; color:#000; font-size:20px; }

/* avvisi e note */
.pref-warn, .pref-note{ margin:10px 0 0; padding:10px 20px;; border-radius:10px; font-size:14px; line-height:1.5; }
.pref-warn{ background:#fff6e5; color:#8a5a00; }
.pref-note{ background:#efefef; color:#1d1d1f; }
.pref-note[hidden]{ display:none; }

/* pill */
.pref-pill{ display:inline-block; font-size:12px; font-weight:500; padding:0 10px; border-radius:5px;}
.pref-pill.ok{ background:#bce1bb; color:#2d872b; }
.pref-pill.off{ background:#e1e1e1; color:#666; }
.pref-pill.err{ background:#ebccd1; color:#a94442; }
.pref-pill.req{ background:#e1e1e1; color:#666; }

/* toggle: l'input resta un checkbox vero, sopra lo slider */
.pref-switch{ position:relative; flex:none; width:50px; height:28px; margin:2px 0 0; }
.pref-switch input{ position:absolute; top:0; left:0; width:100%; height:100%; opacity:0; margin:0; cursor:pointer; z-index:1; }
.pref-switch input:checked + .pref-slider{ background:var(--primary-color-coupon); }
.pref-switch input:checked + .pref-slider:after{ transform:translateX(22px); }
.pref-switch input:focus-visible + .pref-slider{ outline:3px solid #999; outline-offset:2px; }
.pref-switch input:disabled{ cursor:not-allowed; }
.pref-switch input:disabled + .pref-slider{ opacity:.45; }
.pref-slider{ position:absolute; top:0; right:0; bottom:0; left:0; border-radius:999px; background:#cfcfd4; transition:background .2s; }
.pref-slider:after{ content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .2s; }

/* barra salvataggio */
.pref-savebar{ position:sticky; bottom:0; z-index:10; display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; background:#fff; border-radius:10px; box-shadow:7px 0px 15px rgba(0,0,0,0.1); padding:14px 20px; margin-bottom:20px; }
.pref-savebar .btn{ margin:0; }
.pref-savebar .btn:disabled{ opacity:.4; cursor:not-allowed; }
.pref-savebar .pref-status{ font-size:16px; color:#666; }
.pref-savebar .pref-status.dirty{ color:#a94442; font-weight:500; }

/* alert salvato */
.pref-alert{ display:flex; gap:10px; align-items:center; text-align:center; background:#bce1bb; color:#2d872b; padding:10px 20px; border-radius:5px; margin-bottom:20px; font-size:16px; line-height:1.2; justify-content:center; }

/* disiscrizione */
.pref-danger{ text-align:center; color:#666; font-size:15px; padding:8px 0; }
.pref-danger .pref-link{ background:none; border:0; padding:0; font:inherit; color:var(--primary-color-coupon); text-decoration:underline; cursor:pointer; }
.pref-danger .pref-link:hover{ text-decoration:none;}

/* conferma */
.pref-done-icon{ width:64px; height:64px; border-radius:50%; margin:0 auto 12px; display:flex; align-items:center; justify-content:center; background:#1f7a4d; color:#fff; font-size:28px; }

/* dialog */
dialog.pref-dialog{ border:0; border-radius:12px; padding:28px; max-width:440px; width:calc(100% - 32px); box-shadow:0 20px 60px rgba(0,0,0,.25); color:#1d1d1f; }
dialog.pref-dialog:not([open]){ display:none; }
dialog.pref-dialog::backdrop{ background:rgba(0,0,0,.45); }
dialog.pref-dialog h4{ font-size:20px; font-weight:600; }
dialog.pref-dialog ul{ list-style:disc;}
dialog.pref-dialog p.small{ font-size:13px; line-height:1.4; color:#666;}
dialog.pref-dialog .pref-dialog-actions{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:20px; }
dialog.pref-dialog .pref-dialog-actions .btn{ margin:0; }
.pref-btn-ghost{ background:transparent; border:1px solid #d5d5d8; border-radius:6px; padding:10px 22px; font:inherit; cursor:pointer; }

/* pagina conferma */

.pref-card.pref-pagina-conferma{ text-align:center;}
.pref-card.pref-pagina-conferma h3{ text-align:center; justify-content:center; font-weight:400;}
.pref-card.pref-pagina-conferma .btn{ margin-top:20px;}


@media (max-width: 640px){
	.pref-savebar .pref-status{ width:100%; text-align:center;}
	.pref-card h3{ font-size:20px;}
	.pref-title, .pref-row.pref-sub .pref-title{ font-size:16px;}
	.pref-row{ padding:10px 0;}
	.pref-card-desc{ margin-bottom:10px;}
	.pref-card{ padding:30px;}
	.pref-card.pref-who{ padding:20px 30px;}
	.pref-desc{ font-size:14px; line-height:1.4; margin-top:5px;}	
	.pref-row .pref-icon{ display:none; }
	.pref-row.pref-sub{ margin-left:0; }
	.pref-savebar .btn{ width:100%; }
}