/* Bookanda: fondamenta condivise (reset, tipografia, controlli, barra, footer, telefono, striscia
   della giornata, pagine documento, pagine "Scarica"). Dipende da tokens.css. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; }
:target { scroll-margin-top: calc(var(--header-h) + 1rem); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nums { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: var(--margin); top: -4rem; z-index: 60;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 0.5rem; }

/* ---------- tipografia ---------- */
.t-xl { font-size: var(--step-xl); font-weight: 800; line-height: 0.92; letter-spacing: -0.035em; }
.t-display { font-size: var(--step-display); font-weight: 800; line-height: 0.98; letter-spacing: -0.03em; }
.t-lead { font-size: var(--step-lead); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.t-small { font-size: var(--step-small); line-height: 1.45; }
.muted { color: var(--muted); }

/* il wordmark del brand, in Righteous come nell'app */
.mark { font-family: var(--font-mark); font-weight: 400; font-size: var(--step-lead); line-height: 1; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }

/* ---------- controlli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 3rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--step-body); line-height: 1; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn--small { min-height: 2.5rem; padding: 0 1.125rem; font-size: var(--step-small); }
.link { text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 0.22em; font-weight: 600; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); color: var(--bg); }
  .link:hover { text-decoration-color: transparent; }
}

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.stores a { display: block; border-radius: 0.6rem; transition: transform var(--t-press) var(--ease-out); }
.stores a:active { transform: scale(0.97); }
.stores img { height: 3.25rem; width: auto; }

/* ---------- barra in alto ---------- */
.bar { position: sticky; top: 0; z-index: 40; background: var(--bg); }
.bar__in {
  display: flex; align-items: center; gap: var(--gutter);
  height: var(--header-h); padding-inline: var(--margin);
}
.bar__nav { display: flex; gap: 1.75rem; margin-left: auto; }
.bar__nav a { font-size: var(--step-small); font-weight: 600; text-decoration: none; padding-block: 0.5rem; text-decoration-line: underline; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .bar__nav a:hover { text-decoration-color: currentColor; } }
.bar__end { display: flex; align-items: center; gap: 0.75rem; }
.bar__menu { display: none; min-height: 2.75rem; padding: 0 0.75rem; font-weight: 700; font-size: var(--step-small); }

.theme-toggle {
  display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--surface); color: var(--ink);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; transition: transform var(--t-ui) var(--ease-out); }
:root[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle svg { transform: rotate(180deg); } }
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover { background: var(--surface-2); } }

.menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 39;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 2rem var(--margin) 3rem; background: var(--bg); overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu a:not(.btn) { font-size: var(--step-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; text-decoration: none; padding-block: 0.2rem; }
.menu .btn { align-self: flex-start; margin-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .menu:not([hidden]) { animation: menu-in var(--t-ui) var(--ease-out); }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 63.99em) {
  .bar__nav, .bar__end .btn { display: none; }
  .bar__end { margin-left: auto; }
  .bar__menu { display: inline-flex; align-items: center; }
}

/* ---------- la striscia della giornata: 20 mezz'ore dalle 9 alle 19 ---------- */
.day { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; height: 3.5rem; }
.day > span { background: var(--slot-free); }
.day > .b { background: var(--ink); }
.day > .m { background: var(--accent); }
.day--band { height: 0.5rem; gap: 2px; }
.day--band > span { background: var(--surface); }
.day--band > .b { background: var(--ink); }

/* ---------- il telefono: cornice piatta, raggio del dispositivo, nessuna ombra ---------- */
.phone { container-type: inline-size; width: 100%; }
.phone__body { background: var(--bezel); padding: 3.2cqi; border-radius: 14cqi; }
.phone__screen {
  position: relative; aspect-ratio: 860 / 1864; overflow: hidden;
  border-radius: 11cqi; background: var(--paper);
}
.phone__screen > img, .phone__screen > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--paper);
}

/* ---------- footer ---------- */
.foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); min-height: 100svh; background: var(--surface); }
.foot__photo { grid-column: 1 / span 6; position: relative; overflow: clip; background: var(--surface-2); }
.foot__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 70%; filter: brightness(var(--photo-dim)); }
.foot__body { grid-column: 8 / span 5; display: flex; flex-direction: column; padding: 5rem var(--margin) 2rem 0; }
.foot__menu { display: flex; flex-direction: column; gap: 1.75rem; margin-top: 3rem; }
.foot__menu a {
  font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  text-decoration: none; transition: transform var(--t-ui) var(--ease-out), color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .foot__menu:hover a { color: var(--muted); }
  .foot__menu a:hover { color: var(--ink); transform: translateX(12px); }
}
.foot__blocks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: 4rem; font-size: var(--step-small); }
.foot__blocks h2 { font-size: var(--step-small); font-weight: 700; margin-bottom: 0.5rem; }
.foot__blocks ul { display: grid; gap: 0.35rem; list-style: none; padding: 0; margin: 0; }
.foot__blocks a { text-decoration-color: transparent; text-decoration-line: underline; }
.foot__blocks a:hover { text-decoration-color: currentColor; }
.foot__legal { margin-top: auto; padding-top: 3rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: var(--step-small); }
.foot__legal a { text-decoration-color: transparent; text-decoration-line: underline; }
.foot__legal a:hover { text-decoration-color: currentColor; }

.foot--compact { min-height: 0; }
.foot--compact .foot__body { grid-column: 1 / -1; padding: 4rem var(--margin) 2rem; }
.foot--compact .foot__menu { flex-direction: row; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 2rem; }

.foot--compact .foot__blocks { max-width: 40rem; margin-top: 3rem; }

@media (max-width: 63.99em) {
  .foot { grid-template-columns: 1fr; min-height: 0; }
  .foot__photo { grid-column: 1; height: 50svh; }
  .foot__body { grid-column: 1; padding: 3rem var(--margin) 2rem; }
  .foot__menu { gap: 1.25rem; margin-top: 2rem; }

  .foot__blocks { grid-template-columns: 1fr; gap: 2rem; margin-top: 3rem; }
}

/* ---------- ingressi una volta sola (il contenuto resta visibile senza JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0; transform: translateY(24px);
    transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * var(--stagger-item));
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js [data-reveal="fade"] { transform: none; }
}

/* ---------- pagine documento: privacy, termini, cancellazione account, supporto ----------
   Testata come la card dell'hero della home (striscia della giornata, titolo, foto del salone),
   poi un indice fisso a sinistra e una colonna di lettura. Il testo legale resta com'?. */
.doc-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.75rem; padding: 0 var(--margin); }
.doc-head__card {
  grid-column: 1 / span 6; display: flex; flex-direction: column; justify-content: space-between; gap: 4rem;
  min-height: clamp(26rem, calc(100svh - var(--header-h) - 6rem), 44rem);
  padding: clamp(1.5rem, 0.8rem + 2.2vw, 3rem); background: var(--surface);
}
.doc-head__title { font-size: var(--step-display); font-weight: 800; line-height: 0.98; letter-spacing: -0.03em; max-width: 14ch; }
.doc-head__meta { max-width: 46ch; margin-top: 1.25rem; }
.doc-head__photo { grid-column: 7 / span 6; position: relative; margin: 0; overflow: clip; background: var(--surface-2); }
.doc-head__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(var(--photo-dim)); }

.doc-body {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start;
  padding: clamp(3.5rem, 2rem + 4vw, 6.5rem) var(--margin) var(--section);
}
.doc-toc {
  grid-column: 1 / span 3; position: sticky; top: calc(var(--header-h) + 1.5rem);
  max-height: calc(100svh - var(--header-h) - 3rem); overflow-y: auto; overscroll-behavior: contain;
}
.doc-toc summary { font-weight: 800; margin-bottom: 1rem; list-style: none; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ul { display: grid; gap: 0.1rem; margin: 0; padding: 0 0 1rem; list-style: none; }
.doc-toc a {
  position: relative; display: block; padding: 0.35rem 0 0.35rem 1.1rem;
  font-size: var(--step-small); line-height: 1.35; color: var(--muted); text-decoration: none;
  transition: color var(--t-hover) ease;
}
.doc-toc a::before {
  content: ""; position: absolute; left: 0; top: 0.5rem; width: 0.4rem; height: 1rem;
  background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform var(--t-ui) var(--ease-out);
}
.doc-toc a[aria-current="location"] { color: var(--ink); }
.doc-toc a[aria-current="location"]::before { transform: none; }
@media (hover: hover) and (pointer: fine) { .doc-toc a:hover { color: var(--ink); } }

.doc-text { grid-column: 4 / -1; justify-self: end; width: 100%; max-width: 46rem; min-width: 0; }
.doc-sec + .doc-sec, .doc-note + .doc-sec { margin-top: clamp(3.5rem, 2.5rem + 3vw, 6rem); }
.doc-sec > h2 { font-size: var(--step-lead); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.doc-text h3 { font-size: var(--step-body); font-weight: 700; line-height: 1.35; margin: 2.25rem 0 0.5rem; }
.doc-text p + p, .doc-text p + ul, .doc-text p + ol, .doc-text ul + p, .doc-text ol + p { margin-top: 0.9em; }
.doc-text ul, .doc-text ol { padding-left: 1.25rem; margin-top: 0.75rem; }
.doc-text li + li { margin-top: 0.45em; }
.doc-text li::marker { color: var(--muted); }
.doc-text a { font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .doc-text a:hover { text-decoration-color: transparent; } }

/* gli avvisi: un campo a contrasto, come la sezione clienti della home */
.doc-note { background: var(--field); color: var(--field-ink); padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
.doc-note h3 { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 1rem; }
.doc-note p + p { margin-top: 0.6em; }
.doc-sec + .doc-note { margin-top: clamp(3.5rem, 2.5rem + 3vw, 6rem); }
/* i riquadri di contatto: un tono di superficie */
.doc-box { background: var(--surface); padding: clamp(1.25rem, 1rem + 1vw, 2rem); margin-top: 2rem; }
.doc-box h3 { margin-top: 0; }
.doc-box p + p { margin-top: 0.5em; }
.doc-row { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); column-gap: 1.5rem; }
/* l'ultimo riquadro, con i contatti: lo scontrino della home, tagliato a zig-zag */
.doc-box--end { margin-top: clamp(3.5rem, 2.5rem + 3vw, 6rem); padding-bottom: calc(clamp(1.25rem, 1rem + 1vw, 2rem) + 10px); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), 97.5% 100%, 95.0% calc(100% - 10px), 92.5% 100%, 90.0% calc(100% - 10px), 87.5% 100%, 85.0% calc(100% - 10px), 82.5% 100%, 80.0% calc(100% - 10px), 77.5% 100%, 75.0% calc(100% - 10px), 72.5% 100%, 70.0% calc(100% - 10px), 67.5% 100%, 65.0% calc(100% - 10px), 62.5% 100%, 60.0% calc(100% - 10px), 57.5% 100%, 55.0% calc(100% - 10px), 52.5% 100%, 50.0% calc(100% - 10px), 47.5% 100%, 45.0% calc(100% - 10px), 42.5% 100%, 40.0% calc(100% - 10px), 37.5% 100%, 35.0% calc(100% - 10px), 32.5% 100%, 30.0% calc(100% - 10px), 27.5% 100%, 25.0% calc(100% - 10px), 22.5% 100%, 20.0% calc(100% - 10px), 17.5% 100%, 15.0% calc(100% - 10px), 12.5% 100%, 10.0% calc(100% - 10px), 7.5% 100%, 5.0% calc(100% - 10px), 2.5% 100%, 0.0% calc(100% - 10px)); }
.doc-note + .doc-box--end { margin-top: 0.75rem; }

/* supporto: titoli a sinistra, contenuto a destra, come le domande della home */
.doc-body--support { row-gap: clamp(4rem, 3rem + 4vw, 8rem); }
.doc-body--support > .doc-sec { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin: 0; }
.doc-body--support > .doc-sec > h2 { grid-column: 1 / span 3; }
.doc-body--support > .doc-sec > :not(h2) { grid-column: 5 / span 8; }
.doc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.doc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-height: 15rem; padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); background: var(--surface); }
.doc-card h3 { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.doc-card .btn { margin-top: auto; }
.doc-faq { columns: 2; column-gap: 3.5rem; }
.doc-faq > div { break-inside: avoid; margin-bottom: 1.75rem; }
.doc-faq h3 { font-size: var(--step-body); font-weight: 700; line-height: 1.35; margin: 0 0 0.35rem; }
.doc-faq a { font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

@media (prefers-reduced-motion: no-preference) {
  .js .doc-head .day > span { transform: scaleY(0); transform-origin: bottom; animation: day-in 420ms var(--ease-out) forwards; }
  .js .doc-head .day > span:nth-child(1) { animation-delay: 100ms; }
  .js .doc-head .day > span:nth-child(2) { animation-delay: 140ms; }
  .js .doc-head .day > span:nth-child(3) { animation-delay: 180ms; }
  .js .doc-head .day > span:nth-child(4) { animation-delay: 220ms; }
  .js .doc-head .day > span:nth-child(5) { animation-delay: 260ms; }
  .js .doc-head .day > span:nth-child(6) { animation-delay: 300ms; }
  .js .doc-head .day > span:nth-child(7) { animation-delay: 340ms; }
  .js .doc-head .day > span:nth-child(8) { animation-delay: 380ms; }
  .js .doc-head .day > span:nth-child(9) { animation-delay: 420ms; }
  .js .doc-head .day > span:nth-child(10) { animation-delay: 460ms; }
  .js .doc-head .day > span:nth-child(11) { animation-delay: 500ms; }
  .js .doc-head .day > span:nth-child(12) { animation-delay: 540ms; }
  .js .doc-head .day > span:nth-child(13) { animation-delay: 580ms; }
  .js .doc-head .day > span:nth-child(14) { animation-delay: 620ms; }
  .js .doc-head .day > span:nth-child(15) { animation-delay: 660ms; }
  .js .doc-head .day > span:nth-child(16) { animation-delay: 700ms; }
  .js .doc-head .day > span:nth-child(17) { animation-delay: 740ms; }
  .js .doc-head .day > span:nth-child(18) { animation-delay: 780ms; }
  .js .doc-head .day > span:nth-child(19) { animation-delay: 820ms; }
  .js .doc-head .day > span:nth-child(20) { animation-delay: 860ms; }
  .js .doc-head .day > span.m { animation-delay: 950ms; animation-duration: 600ms; }
}
@keyframes day-in { to { transform: none; } }

@media (max-width: 63.99em) {
  .doc-head { display: flex; flex-direction: column; gap: 0; }
  .doc-head__photo { order: -1; height: 30svh; min-height: 13rem; }
  .doc-head__card { position: relative; z-index: 1; margin: -1.5rem 0.75rem 0; min-height: 0; gap: 2.5rem; padding: 1.25rem 1.25rem 2rem; }
  .doc-body { display: block; padding-top: 2.5rem; }
  .doc-toc { position: static; max-height: none; overflow: visible; background: var(--surface); padding: 0 1.25rem; margin-bottom: 3rem; }
  .doc-toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 3.25rem; margin: 0; cursor: pointer; }
  .doc-toc summary::after { content: "+"; font-size: var(--step-lead); font-weight: 600; line-height: 1; transition: transform var(--t-ui) var(--ease-out); }
  .doc-toc[open] summary::after { transform: rotate(45deg); }
  .doc-toc a { font-size: var(--step-body); }
  .doc-sec > h2 { line-height: 1.2; }
  .doc-text h3 { margin-top: 1.75rem; }
  .doc-row { grid-template-columns: 1fr; }
  .doc-body--support { display: block; }
  .doc-body--support > .doc-sec { display: block; }
  .doc-body--support > .doc-sec + .doc-sec { margin-top: 4rem; }
  .doc-body--support > .doc-sec > h2 { font-size: var(--step-lead); }
  .doc-card { min-height: 0; }
  .doc-card .btn { margin-top: 1.5rem; }
}
@media (max-width: 39.99em) {
  .doc-cards { grid-template-columns: 1fr; }
  .doc-faq { columns: 1; }
}

/* ---------- pagine "Scarica Bookanda": 404 (slug senza app), provider, reset password ---------- */
.get { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.get__top { display: flex; align-items: center; justify-content: space-between; padding: 1rem var(--margin); }
.get__main { display: grid; place-items: center; padding: 2rem var(--margin) 4rem; }
.get__card { width: min(100%, 30rem); display: flex; flex-direction: column; align-items: center; text-align: center; }
.get__card .day { width: 100%; height: 2.5rem; margin-bottom: 2.5rem; }
.get__icon { width: 6rem; height: 6rem; border-radius: 22%; margin-bottom: 2rem; }
.get h1 { font-size: var(--step-display); font-weight: 800; line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 1rem; }
.get .subtitle { max-width: 34ch; margin-bottom: 2rem; }
.get .open-app-btn { display: none; margin-bottom: 1.25rem; }
.get .open-app-btn.is-visible { display: inline-flex; }
.get .install-note { max-width: 36ch; margin-bottom: 1.5rem; }
.get .stores { justify-content: center; }
.get .home-link { margin-top: 2.5rem; font-weight: 600; }
.get__foot { padding: 1.5rem var(--margin); font-size: var(--step-small); text-align: center; }
.get__foot a { text-decoration-color: transparent; text-decoration-line: underline; }
.get__foot a:hover { text-decoration-color: currentColor; }
