/* 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 ---------- */
.doc main { padding: clamp(3rem, 2rem + 4vw, 6rem) var(--margin) var(--section); }
.doc .page-header, .doc .support-hero { max-width: 72rem; margin: 0 auto clamp(3rem, 2rem + 3vw, 5rem); }
.doc .page-title, .doc .support-title {
  font-size: var(--step-display); font-weight: 800; line-height: 0.98; letter-spacing: -0.03em; margin: 0 0 1rem;
}
.doc .page-subtitle, .doc .support-subtitle { font-size: var(--step-body); color: var(--ink); max-width: 46ch; margin: 0; }
.doc .content, .doc .support-content { max-width: 72rem; margin: 0 auto; display: grid; gap: clamp(2.5rem, 2rem + 2vw, 4rem); }
.doc .content > *, .doc .support-content > * { max-width: 46rem; margin: 0; }
.doc .section-title {
  font-size: var(--step-lead); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 1rem;
}
.doc .section-content p, .doc .section-content li { max-width: var(--measure); }
.doc .section-content p + p, .doc .section-content p + ul, .doc .section-content ul + p,
.doc .section-content p + ol, .doc .section-content ol + p { margin-top: 0.9em; }
.doc .section-content h3, .doc .highlight-box h3, .doc .contact-box h3 { font-size: var(--step-body); font-weight: 700; margin: 1.5em 0 0.5em; }
.doc .section-content ul, .doc .section-content ol { padding-left: 1.25rem; margin-top: 0.5em; }
.doc .section-content li + li { margin-top: 0.35em; }
.doc .highlight-box, .doc .contact-box, .doc .contact-info {
  background: var(--surface); padding: clamp(1.25rem, 1rem + 1vw, 2rem); margin-top: 1.25rem;
}
.doc .highlight-box > :first-child, .doc .contact-box > :first-child { margin-top: 0; }
.doc .highlight-box p + p, .doc .contact-box p + p { margin-top: 0.6em; }
.doc main a, .doc main a[style] { color: inherit !important; text-decoration: underline; font-weight: 600; }
.doc main ul[style] { margin-left: 0 !important; }

/* supporto */
.doc .support-content .section { max-width: 46rem; }
.doc .contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.75rem; }
.doc .contact-card { background: var(--surface); padding: 1.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.doc .contact-title { font-size: var(--step-body); font-weight: 700; margin: 0; }
.doc .contact-info { background: none; padding: 0; margin: 0 0 0.75rem; }
.doc .contact-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.125rem; margin-top: auto;
  background: var(--accent); color: var(--accent-ink) !important; border-radius: var(--radius-pill);
  font-weight: 700; text-decoration: none !important;
}
.doc .faq-item + .faq-item { margin-top: 2rem; }
.doc .faq-question { font-size: var(--step-body); font-weight: 700; margin: 0 0 0.4rem; }
.doc .faq-answer { max-width: var(--measure); }

/* ---------- 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; }
