/* App dei clienti (Biconik, di TrittoStudio). Il colore principale (--brand) arriva da salone.json. */
@font-face { font-family: 'Bricolage Grotesque'; src: url(fonts/bricolage-grotesque.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
:root {
  --brand: #1F2E4A;
  --bg: #F4F5F2; --surface: #fff; --ink: #161D26; --ink-2: #5A6370; --ink-3: #8C949E;
  --line: #DFE2DE; --line-2: #ECEEEB; --bad: #B03A33; --ok: #2F7A55;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, white);
  --brand-mid: color-mix(in srgb, var(--brand) 22%, white);
  --ff-d: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --ff: 'Figtree', ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--ff); -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1; }
h1, h2, h3 { font-family: var(--ff-d); margin: 0; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--brand); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--ink-2); } .small { font-size: 14px; } .center { text-align: center; display: block; margin: 0 auto; }
.loading { min-height: 70vh; display: grid; place-items: center; color: var(--ink-2); }

.screen { max-width: 560px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.screen.no-tabs { padding-bottom: calc(32px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100svh; justify-content: center; }
.s-head h1 { font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; font-variation-settings: 'opsz' 96; }
.s-head p { color: var(--ink-2); margin-top: 8px; font-size: 17px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-size: 18px; }
.sec { font: 600 15px var(--ff); color: var(--ink-2); margin-top: 8px; }
.grp { font: 600 14px var(--ff); color: var(--ink-2); margin: 8px 0 -4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: color-mix(in srgb, var(--brand) 85%, black); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.wide { width: 100%; } .btn.big { min-height: 58px; font-size: 17px; }
.btn:disabled { opacity: .5; }
.link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.link.light { color: inherit; opacity: .85; }
.link.danger { color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; color: var(--ink-2); }
.icon-btn:disabled { opacity: .25; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-size: 13px; color: var(--ink-3); }
input, textarea { width: 100%; min-height: 50px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; }
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-mid); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--brand); flex: none; }
#authf, #codef, #forgotf, #resetf { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-weight: 500; font-size: 15px; }
.swap { text-align: center; color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.gbtn { min-height: 44px; display: flex; justify-content: center; }

/* home */
.next { background: var(--brand); color: #fff; border-radius: 24px; padding: 22px; position: relative; }
.next-l { font-size: 14px; opacity: .8; }
.next h2 { font-size: 26px; margin-top: 18px; padding-right: 76px; }
.next p { opacity: .85; margin-top: 4px; }
.next-d { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,.14); border-radius: 16px; width: 64px; padding: 8px 0; text-align: center; }
.next-d b { display: block; font: 700 26px/1 var(--ff-d); } .next-d span { font-size: 13px; opacity: .85; }
.notif-bar { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); color: var(--brand); border-radius: 14px; padding: 12px 14px; font-weight: 600; text-align: left; }
.notif-bar span { flex: 1; }
.info { gap: 4px; }
.info h3 { margin-bottom: 6px; }
.info-r, .hours summary { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-2); cursor: pointer; }
.info-r .ic, .hours summary .ic { color: var(--brand); }
.hours summary { list-style: none; } .hours summary::-webkit-details-marker { display: none; }
.h-list { display: flex; flex-direction: column; padding: 0 0 6px 32px; font-size: 15px; }
.h-list div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; } .h-list span { color: var(--ink-2); } .h-list b { font-weight: 500; text-align: right; }
.hint { flex-direction: row; gap: 14px; align-items: flex-start; }
.hint > .ic { color: var(--brand); width: 24px; height: 24px; margin-top: 2px; }
.hint div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hint p { color: var(--ink-2); font-size: 15px; } .hint p .ic { width: 16px; height: 16px; vertical-align: -3px; }

/* prenotazione */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.steps li { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding-top: 8px; border-top: 3px solid var(--line); }
.steps li.done { color: var(--ink-2); border-color: var(--brand-mid); }
.steps li.on { color: var(--brand); border-color: var(--brand); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; align-self: flex-start; margin-left: -6px; padding: 4px 6px; }
.chosen { font-weight: 600; color: var(--ink-2); margin-top: -8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; }
.opt:active, .opt.on { border-color: var(--brand); background: var(--brand-soft); }
.o-t { font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.o-s { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.o-p { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 600 18px var(--ff-d); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.cal { gap: 8px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; }
.cal-h b { font: 600 19px var(--ff-d); text-transform: capitalize; }
.cal-dow, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.cal-load { grid-column: 1 / -1; padding: 30px 0; }
.day { aspect-ratio: 1; border-radius: 12px; font-weight: 500; color: var(--ink-3); }
.day.free { color: var(--ink); background: var(--brand-soft); font-weight: 600; }
.day.today { box-shadow: 0 0 0 1.5px var(--brand) inset; }
.day.on { background: var(--brand); color: #fff; box-shadow: none; }
.day:disabled { cursor: default; }
.slots { display: flex; flex-direction: column; gap: 12px; }
.slots-h { font-size: 22px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.chip { min-height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.chip:active { background: var(--brand); color: #fff; border-color: var(--brand); }
.summary { gap: 0; }
.sum-r { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.sum-r span { color: var(--ink-2); } .sum-r b { text-align: right; font-weight: 600; }
.sum-r.total b { font: 700 22px var(--ff-d); }
.summary .field { margin-top: 14px; }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 0 6px; }
.done h1 { font-size: 38px; font-weight: 700; }
.done-i { width: 76px; height: 76px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 8px; }
.done-i .ic { width: 38px; height: 38px; stroke-width: 2.4; }

/* appuntamenti */
.ap { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.ap.canc { opacity: .6; }
.ap-d { width: 58px; flex: none; text-align: center; background: var(--brand-soft); color: var(--brand); border-radius: 14px; padding: 8px 0; align-self: flex-start; }
.ap-d b { display: block; font: 700 24px/1 var(--ff-d); } .ap-d span { font-size: 13px; }
.ap-b { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ap-b h3 { font-size: 18px; } .ap-b p { color: var(--ink-2); font-size: 15px; }
.tag { font-size: 13px; font-weight: 600; background: var(--line-2); border-radius: 999px; padding: 1px 9px; color: var(--ink-2) !important; }
.empty { align-items: flex-start; }
.actions { align-items: stretch; }

/* barra in basso */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-decoration: none; padding: 6px 0; border-radius: 12px; }
.tabbar a.on { color: var(--brand); }
.tabbar .ic { width: 24px; height: 24px; }
.made { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-top: 18px; }
.made img, .made .mk { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.tabbar[hidden] { display: none; }
.tabbar a:active, .btn:active, .opt:active { opacity: .75; }

.sheet-back { position: fixed; inset: 0; background: rgba(15, 20, 28, .4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 80vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nt { padding: 12px 0; border-top: 1px solid var(--line-2); } .nt p { color: var(--ink-2); font-size: 15px; } .nt span { font-size: 13px; color: var(--ink-3); }
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }
@media (min-width: 700px) { .screen { padding-top: 48px; } .s-head h1 { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* orari: aperto/chiuso e freccia */
.hours summary span { flex: 1; }
.hours summary .open { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--line-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.hours summary .open.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, white); }
.hours summary > .ic:last-child { color: var(--ink-3); transition: transform .2s; }
.hours[open] summary > .ic:last-child { transform: rotate(180deg); }
/* orari: tutto resta dentro la casella, anche su schermi stretti */
.hours summary { flex-wrap: wrap; row-gap: 4px; }
.hours summary span { min-width: 0; }
.hours summary .open { order: 3; margin-left: 32px; white-space: normal; }
.h-list { padding-right: 2px; }
.h-list div { align-items: flex-start; }
.h-list b { white-space: nowrap; line-height: 1.5; }
.card.info { overflow: hidden; }

/* schede a segmenti (Donna/Uomo/Bambino, Prossimi/Storico/Disdetti) */
.seg { display: flex; background: var(--line-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { flex: 1; min-height: 40px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg small { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* storico */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stats b { display: block; font: 700 22px/1.15 var(--ff-d); }
.stats span { font-size: 13px; color: var(--ink-2); }
.stats div:nth-child(4) b { font-size: 17px; }
.ap .price { font-weight: 700; color: var(--ink) !important; font-family: var(--ff-d); font-size: 17px !important; }
.ap-d span + span { display: block; font-size: 11px; opacity: .8; }

/* finestra di conferma */
.sheet.confirm { display: flex; flex-direction: column; gap: 14px; }
.sheet.confirm h2 { font-size: 24px; }
.sheet-sum { background: var(--brand-soft); border-radius: 16px; padding: 14px 16px; }
.sheet-sum b { font: 600 19px var(--ff-d); }
.sheet-sum p { color: var(--ink-2); margin-top: 2px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 4px; }
.btn.danger { background: var(--bad); color: #fff; }

/* password dimenticata, anti-robot, recensioni */
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns .btn { flex: 1; }
.ok-msg { background: #EAF3EC; color: #24553A; border-radius: 12px; padding: 12px 14px; margin: 0; line-height: 1.5; }
.g-note { margin: 8px 0 0; }
.ts { min-height: 65px; margin: 4px 0 12px; }

details.more summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more:not([open]) { gap: 0; }

/* ---------- schermata d'avvio (3 secondi): fondo nel colore del salone, logo chiaro ---------- */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--sp-bg, #141B2B); display: grid; place-items: center; transition: opacity .4s ease, transform .4s ease; }
#splash.out { opacity: 0; transform: scale(1.02); pointer-events: none; }
.sp-in { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.sp-mark { width: 108px; height: 108px; overflow: visible; }
.sp-mark * { transform-box: view-box; }
.sp-tile { fill: var(--sp-paper); transform-origin: 32px 32px; animation: sp-pop .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.sp-bar { fill: none; stroke: var(--sp-bg); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 28; stroke-dashoffset: 28; animation: sp-draw .5s ease-out .45s forwards; }
.sp-glass { fill: none; stroke: var(--sp-acc); stroke-width: 2.6; stroke-linejoin: round; opacity: 0; animation: sp-fade .35s ease .65s forwards; }
.sp-sand-top { fill: var(--sp-acc); transform-origin: 32px 31.5px; opacity: 0; animation: sp-fade .3s ease .7s forwards, sp-drain 1.2s cubic-bezier(.5, 0, .7, 1) .95s forwards; }
.sp-stream { stroke: var(--sp-acc); stroke-width: 1.4; stroke-linecap: round; opacity: 0; animation: sp-stream 1.2s linear .95s forwards; }
.sp-sand-bot { fill: var(--sp-acc); transform-origin: 32px 45px; transform: scaleY(0); animation: sp-fill 1.2s cubic-bezier(.3, 0, .5, 1) 1s forwards; }
.sp-word { width: 160px; height: auto; opacity: 0; transform: translateY(10px); animation: sp-up .6s ease-out 1.7s forwards; }
.sp-word .w-ink { fill: var(--sp-paper); } .sp-word .w-acc { fill: var(--sp-acc); }
.sp-firma { margin: -8px 0 0; font-size: 14px; letter-spacing: .02em; color: var(--sp-paper); opacity: 0; animation: sp-soft .6s ease-out 2s forwards; }
@keyframes sp-pop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-fade { to { opacity: 1; } }
@keyframes sp-drain { to { transform: scale(0); } }
@keyframes sp-fill { to { transform: scaleY(1); } }
@keyframes sp-stream { 0% { opacity: 0; } 12%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sp-up { to { opacity: 1; transform: none; } }
@keyframes sp-soft { to { opacity: .75; } }
@media (prefers-reduced-motion: reduce) {
  #splash *, #splash { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; }
}

