/* Giundi Barber Shop – stile barbiere vintage: crema, rosso, blu */
:root {
  --cream: #f6efe1;
  --paper: #fffaf0;
  --red: #b3261e;
  --red-dark: #8f1d17;
  --blue: #1f3a5f;
  --ink: #22272e;
  --muted: #6b6457;
  --line: #e3d8c3;
  --green: #2f7d4a;
  --green-soft: #e3f1e7;
  --yellow: #e0a526;
  --yellow-soft: #fbf0d3;
  --grey-soft: #ece6da;
  --radius: 12px;
  --tabbar-h: 64px;
  --serif: Rockwell, "Roboto Slab", "Rockwell Nova", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.45 var(--sans); }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--serif); color: var(--blue); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; }

/* insegna del barbiere */
.pole { height: 6px; background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px, var(--blue) 20px 30px, #fff 30px 40px); }
.logo { font-family: var(--serif); font-weight: 700; color: var(--red); letter-spacing: .12em; text-decoration: none; font-size: 2.6rem; text-align: center; margin: 1.2rem 0 .2rem; display: block; }
.logo-small { font-size: 1.25rem; margin: 0; text-align: left; }

/* struttura app */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem; padding: calc(env(safe-area-inset-top) + .6rem) 1rem .6rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; font-family: var(--serif); color: var(--blue); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: .4rem; }
.page { padding: 1rem 1rem calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1.5rem); max-width: 760px; margin: 0 auto; }
.page-narrow { max-width: 520px; padding-bottom: 2rem; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--muted); text-decoration: none; min-height: 44px; justify-content: center; }
.tabbar a .ico { font-size: 1.25rem; line-height: 1; }
.tabbar a.active { color: var(--red); font-weight: 600; }
.tabbar .tab-add { justify-self: center; width: 56px; height: 56px; margin-top: -22px; border-radius: 50%; background: var(--red); color: #fff; font-size: 2rem; font-weight: 300; box-shadow: 0 4px 12px rgba(143, 29, 23, .35); }
.badge-count { position: absolute; top: 2px; right: 18%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; }

/* componenti */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--blue); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:active { background: var(--red-dark); }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-whatsapp { background: #e7f6ec; border-color: #25a244; color: #156b2d; }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

label { display: block; font-weight: 600; color: var(--blue); margin: .8rem 0 .3rem; font-size: .95rem; }
input, select, textarea { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 16px var(--sans); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
textarea { min-height: 80px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { width: 22px; min-height: 22px; margin-top: 2px; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .35rem .85rem; border: 1px solid var(--blue); border-radius: 20px; background: #fff; color: var(--blue); font-weight: 600; cursor: pointer; user-select: none; }
.chip input { display: none; }
.chip.on, .chip:has(input:checked) { background: var(--blue); color: #fff; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash-ok { background: var(--green-soft); color: #1d5a33; border: 1px solid #b9dcc4; }
.flash-error { background: #fbe4e2; color: var(--red-dark); border: 1px solid #f0bdb8; }
.error { color: var(--red-dark); margin: .4rem 0 0; }
.hint { font-size: .875rem; color: var(--muted); margin: .3rem 0 0; }
.hint-ok { color: var(--green); } .hint-warn { color: #8a5a00; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.badge-confirmed { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: var(--grey-soft); color: var(--muted); }
.badge-no_show { background: var(--yellow-soft); color: #8a5a00; }
.badge-online { background: #e5ecf5; color: var(--blue); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a.item, .list .item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .8rem .2rem; color: var(--ink); text-decoration: none; min-height: 52px; }
.item-title { font-weight: 600; } .item-sub { font-size: .875rem; color: var(--muted); }

/* agenda */
.daynav { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.daynav .day-label { flex: 1; text-align: center; font-family: var(--serif); color: var(--blue); font-size: 1.1rem; }
.timeline { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.hour-row { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.hour-row span { position: absolute; left: .5rem; top: 2px; font-size: .75rem; color: var(--muted); }
.slot-free { position: absolute; left: 3.2rem; right: .5rem; display: flex; align-items: center; padding: 0 .6rem; border: 1px dashed #cfc3aa; border-radius: 8px; color: var(--muted); font-size: .8rem; text-decoration: none; background: transparent; }
.slot-free:active { background: #fff; }
.slot-break { position: absolute; left: 3.2rem; right: .5rem; display: flex; align-items: center; padding: 0 .6rem; border-radius: 8px; background: var(--grey-soft); color: var(--muted); font-size: .8rem; }
.appt { position: absolute; left: 3.2rem; right: .5rem; overflow: hidden; padding: .3rem .6rem; border-radius: 8px; background: var(--green-soft); border-left: 4px solid var(--green); color: var(--ink); text-decoration: none; font-size: .85rem; line-height: 1.25; }
.appt.online { border-left-color: var(--blue); background: #e5ecf5; }
.appt strong { display: block; }
.closed-banner { padding: 1rem; border-radius: var(--radius); background: var(--yellow-soft); color: #6e4a00; margin-bottom: 1rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.week a { display: block; padding: .5rem .2rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); text-align: center; text-decoration: none; color: var(--ink); min-height: 84px; }
.week a.today { border-color: var(--red); }
.week .wd { font-size: .75rem; color: var(--muted); text-transform: capitalize; }
.week .dn { font-family: var(--serif); font-size: 1.3rem; color: var(--blue); }
.week .cnt { font-size: .75rem; color: var(--green); font-weight: 600; }
.week .closed { font-size: .7rem; color: var(--muted); }

/* pagine pubbliche */
.public .tagline { text-align: center; color: var(--blue); font-family: var(--serif); margin: 0 0 1.2rem; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.times button, .times label { min-height: 44px; border: 1px solid var(--blue); border-radius: 10px; background: #fff; color: var(--blue); font-weight: 600; display: flex; align-items: center; justify-content: center; margin: 0; cursor: pointer; }
.times input { display: none; }
.times label:has(input:checked) { background: var(--blue); color: #fff; }
.days { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; }
.days label { flex: none; width: 64px; margin: 0; padding: .45rem 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; color: var(--ink); font-weight: 400; cursor: pointer; scroll-snap-align: start; }
.days input { display: none; }
.days label:has(input:checked) { border-color: var(--blue); background: var(--blue); color: #fff; }
.days .wd { display: block; font-size: .72rem; text-transform: capitalize; }
.days .dn { display: block; font-family: var(--serif); font-size: 1.25rem; }
.footer-note { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 1.5rem; }
