/*
 * Public pages of the professionals (riabilio.it). The app's design language
 * (frontend/src/index.css, .claude/skills/apple-design): white → light-blue backdrop, solid white
 * cards for content, translucent glass only for the floating tab bar, the system blue, the
 * system font with size-specific tracking. Same tokens as the app, light and dark.
 */
:root {
  color-scheme: light dark;
  --background: oklch(0.985 0.006 240);
  --foreground: oklch(0.24 0.03 255);
  --card: oklch(1 0 0);
  --primary: oklch(0.59 0.19 252);
  --primary-strong: oklch(0.5 0.2 256);
  --primary-foreground: oklch(0.99 0 0);
  --primary-soft: oklch(0.59 0.19 252 / 0.1);
  --muted: oklch(0.965 0.01 245);
  --muted-foreground: oklch(0.5 0.03 255);
  --border: oklch(0.91 0.014 245);
  --success-soft: oklch(0.7 0.17 150 / 0.14);
  --success-strong: oklch(0.47 0.12 152);
  --glass: oklch(1 0 0 / 0.62);
  --glass-edge: oklch(1 0 0 / 0.75);
  --shadow-card: 0 1px 2px oklch(0.3 0.05 250 / 0.05), 0 8px 24px -12px oklch(0.3 0.08 250 / 0.14);
  --shadow-float: 0 1px 2px oklch(0.3 0.05 250 / 0.06), 0 18px 48px -16px oklch(0.3 0.08 250 / 0.28);
  --backdrop:
    radial-gradient(60rem 40rem at 100% -10%, oklch(0.9 0.06 235 / 0.7), transparent 60%),
    radial-gradient(50rem 36rem at -10% 110%, oklch(0.93 0.045 220 / 0.8), transparent 60%),
    linear-gradient(165deg, oklch(1 0 0) 0%, oklch(0.975 0.015 235) 45%, oklch(0.95 0.03 240) 100%);
  --radius: 0.75rem;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.18 0.02 255);
    --foreground: oklch(0.97 0.005 245);
    --card: oklch(0.23 0.025 255);
    --primary: oklch(0.67 0.17 252);
    --primary-strong: oklch(0.72 0.15 250);
    --primary-soft: oklch(0.67 0.17 252 / 0.16);
    --muted: oklch(0.27 0.025 255);
    --muted-foreground: oklch(0.72 0.03 250);
    --border: oklch(1 0 0 / 10%);
    --success-soft: oklch(0.72 0.16 150 / 0.16);
    --success-strong: oklch(0.82 0.14 150);
    --glass: oklch(0.22 0.025 255 / 0.6);
    --glass-edge: oklch(1 0 0 / 0.08);
    --shadow-card: none;
    --backdrop: linear-gradient(165deg, oklch(0.2 0.03 255), oklch(0.16 0.02 255));
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--background);
  background-image: var(--backdrop);
  background-attachment: fixed;
  color: var(--foreground);
  font: 100%/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
p { margin: 0; }
.wrap { width: min(60rem, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.line { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.line .icon { transform: translateY(0.12em); }

/* Type: tight, negative tracking as it grows; body near 0. */
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: 1.125rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }

.top { padding: 1.25rem 0 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.top-search { font-size: 0.9rem; font-weight: 550; }
.top-search .icon { transform: translateY(0.14em); }
@media (max-width: 420px) { .top-search span { font-size: 0.85rem; } }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 650; letter-spacing: -0.01em; text-decoration: none;
}
.brand img { border-radius: 0.5rem; }
main { display: grid; gap: 1rem; padding-bottom: 2rem; }

.card {
  background: var(--card);
  border-radius: calc(var(--radius) * 1.8);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}
@media (prefers-color-scheme: dark) { .card { border: 1px solid var(--border); } }
.notice {
  padding: 0.75rem 1rem; border-radius: calc(var(--radius) * 1.4);
  background: var(--primary-soft); color: var(--primary-strong); font-size: 0.9rem;
}

/* Hero */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.hero .cta { grid-column: 1 / -1; display: grid; gap: 0.5rem; justify-items: stretch; }
@media (min-width: 720px) {
  .hero { grid-template-columns: auto minmax(0, 1fr) auto; padding: 1.75rem; }
  .hero .cta { grid-column: auto; justify-items: end; }
}
.avatar {
  width: 104px; height: 104px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--muted);
  font: 600 1.9rem/1 var(--font-display); color: var(--muted-foreground);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 480px) { .avatar { width: 76px; height: 76px; font-size: 1.4rem; } }
.who { display: grid; gap: 0.3rem; min-width: 0; }
.qualification { font-size: 1.05rem; color: var(--muted-foreground); }
.chips { list-style: none; padding: 0; margin: 0.45rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--muted); font-size: 0.8125rem;
}
.chip.ok { background: var(--success-soft); color: var(--success-strong); font-weight: 550; }
.soon {
  display: inline-flex; align-items: center; gap: 0.4rem; justify-self: start;
  font-size: 0.875rem; color: var(--primary-strong); font-weight: 550;
}
@media (min-width: 720px) { .hero .soon { justify-self: end; } }

/* Buttons: feedback on press. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.35rem; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  border: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px oklch(0.3 0.08 250 / 0.2);
  transition: transform 100ms ease-out, background-color 150ms ease-out;
}
.button:hover { background: var(--primary-strong); }
.button:active { transform: scale(0.97); }
.button:focus-visible, .link:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Tabs: a floating segmented control in glass, content scrolls under it. Without the script
   (site.js) the tabs are links to the sections, all shown. */
.tabs {
  position: sticky; top: 0.75rem; z-index: 10;
  justify-self: start; max-width: 100%;
  padding: 0.3rem; border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-float);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tablist { display: flex; gap: 0.15rem; }
.tab {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem;
  border-radius: 999px; white-space: nowrap; text-decoration: none;
  font-size: 0.9375rem; font-weight: 550; color: var(--muted-foreground);
  transition: background-color 200ms cubic-bezier(0.32, 0.72, 0, 1), color 200ms;
}
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"], .tab[aria-current="page"] { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-card); }
.tab .count {
  margin-left: 0.4rem; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px;
  background: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; text-align: center;
}
@media (prefers-reduced-transparency: reduce) {
  .tabs { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.panel { display: grid; gap: 1rem; }
.js-tabs .panel[hidden] { display: none; }
.js-tabs .panel { animation: in 220ms cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
/* The tab already names the section. */
.js-tabs .panel-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.panel-title { margin: 0.5rem 0 0; }

/* Sedi */
.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.place { display: grid; gap: 0.9rem; align-content: start; }
.place header { display: grid; gap: 0.3rem; }
.place footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.25rem; }
.upcoming { display: grid; gap: 0.45rem; }
.upcoming h4 {
  margin: 0; display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em; color: var(--muted-foreground);
}
.upcoming .icon { width: 0.95rem; height: 0.95rem; }
.hours { margin: 0; display: grid; gap: 0.25rem; font-size: 0.9rem; }
.hours div { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.5rem; }
.hours dt { color: var(--muted-foreground); }
.hours dd { margin: 0; font-variant-numeric: tabular-nums; }
.services { list-style: none; margin: 0; padding: 0; border-radius: calc(var(--radius) * 1.2); background: var(--muted); }
.services li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.65rem 0.85rem; font-size: 0.925rem;
}
.services li + li { border-top: 1px solid var(--border); }
.services li > :last-child { white-space: nowrap; }
.svc { display: grid; }
.svc em { font-style: normal; font-size: 0.78rem; color: var(--muted-foreground); }

/* Presentazione, curriculum */
.stack { gap: 1rem; }
.prose p { max-width: 65ch; white-space: pre-line; }
.prose p + p { margin-top: 0.75rem; }
.cv { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.cv li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
.cv .years { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .cv li { grid-template-columns: 1fr; gap: 0.1rem; } }

/* Studio page: filters (a GET form; with the script they apply on change) and professionals. */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.field { display: grid; gap: 0.3rem; font-size: 0.8rem; font-weight: 550; color: var(--muted-foreground); }
.field select {
  appearance: none; min-height: 2.5rem; min-width: 12rem; padding: 0 2.25rem 0 0.9rem;
  border: 1px solid var(--border); border-radius: 999px; background-color: var(--card);
  color: var(--foreground); font: 500 0.925rem var(--font);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 55%, calc(100% - 0.8rem) 55%;
  background-size: 0.3rem 0.3rem; background-repeat: no-repeat;
}
.field select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.button.secondary { background: var(--card); color: var(--foreground); border: 1px solid var(--border); box-shadow: none; }
.button.secondary:hover { background: var(--muted); }
.js-filters .filters button[type="submit"] { display: none; }
@media (max-width: 560px) { .filters { display: grid; } .field select { width: 100%; } }
.pro-head { display: flex !important; align-items: center; gap: 0.85rem; }
.pro-head h3 { margin: 0; }
.avatar.small { width: 56px; height: 56px; font-size: 1.05rem; flex-shrink: 0; }
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.empty { display: grid; gap: 0.75rem; justify-items: start; padding: 2rem; }
.foot { padding: 1rem 0 2.5rem; color: var(--muted-foreground); font-size: 0.8rem; display: grid; gap: 0.25rem; }

/* Search (riabilio.it/cerca, SPEC_MEDICI §20): the search bar, the filters (a GET form; on a
   phone in a «Filtri» sheet) and one card per professional or studio. */
.searchbar { display: grid; gap: 0.75rem; padding: 1rem; }
@media (min-width: 720px) {
  .searchbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; padding: 1.1rem 1.25rem; }
}
.sfield { display: grid; gap: 0.3rem; font-size: 0.8rem; font-weight: 600; color: var(--muted-foreground); }
.sfield input {
  width: 100%; min-height: 3rem; padding: 0 1rem;
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.2);
  background: var(--background); color: var(--foreground);
  font: 500 1rem var(--font); letter-spacing: -0.005em;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.sfield input::placeholder { color: var(--muted-foreground); font-weight: 400; }
.sfield input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--card); }
.sactions { display: flex; gap: 0.5rem; }
.sactions .button { min-height: 3rem; gap: 0.45rem; }
.sactions .button[type="submit"] { flex: 1; }
@media (min-width: 720px) { .sactions .button[type="submit"] { flex: none; } }
.nearme .icon, .sactions .icon { width: 1.05rem; height: 1.05rem; }

.results-head { display: grid; gap: 0.35rem; margin-top: 0.75rem; }
.results-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }

.filters-sheet > summary { list-style: none; display: none; gap: 0.45rem; }
.filters-sheet > summary::-webkit-details-marker { display: none; }
.filters-sheet > summary .count {
  min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--primary); color: var(--primary-foreground);
  font-size: 0.75rem; text-align: center;
}
@media (max-width: 719px) {
  .filters-sheet > summary { display: inline-flex; }
  .filters-sheet[open] > summary { margin-bottom: 0.75rem; }
  .filters-sheet .filters { padding: 1rem; border-radius: calc(var(--radius) * 1.8); background: var(--card); box-shadow: var(--shadow-card); }
}
.filters .field select { min-width: 10.5rem; }
.toggles { display: flex; flex-wrap: wrap; gap: 0.5rem; align-self: end; }
.toggle {
  position: relative; display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  font-size: 0.925rem; font-weight: 500; cursor: pointer; user-select: none;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); font-weight: 600; }
.toggle:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.toggle:active { transform: scale(0.97); }

.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.result { display: grid; gap: 1rem; }
@media (min-width: 720px) {
  .result { grid-template-columns: minmax(0, 1fr) 17.5rem; gap: 1.5rem; padding: 1.4rem; }
}
.result-who { display: flex; gap: 1rem; align-items: flex-start; min-width: 0; }
.result-who .avatar.small { width: 64px; height: 64px; text-decoration: none; }
.result-id { display: grid; gap: 0.25rem; min-width: 0; }
.result-id h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.015em; }
.result-id h2 a { text-decoration: none; }
.result-id h2 a:hover { color: var(--primary); }
.result-id .where strong { font-weight: 600; color: var(--foreground); }
.result-id .chips { margin-top: 0.35rem; }
.result-when {
  display: grid; gap: 0.6rem; align-content: start;
  padding: 0.9rem 1rem; border-radius: calc(var(--radius) * 1.3); background: var(--muted);
}
.first-slot { display: grid; gap: 0.1rem; }
.first-slot .soon { font-size: 0.8rem; }
.first-slot .soon .icon { width: 0.9rem; height: 0.9rem; }
.first-slot strong { font: 650 1.05rem/1.3 var(--font-display); letter-spacing: -0.01em; }
.result-when .hours div { grid-template-columns: 3.75rem 1fr; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.15rem; }
.actions .button { min-height: 2.5rem; }
@media (max-width: 719px) { .actions .button { flex: 1; } }
.suggest { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.5rem; }
.browse h2 { margin-bottom: 0.85rem; }
.link-chip { text-decoration: none; transition: background-color 150ms ease-out; }
.link-chip:hover { background: var(--primary-soft); color: var(--primary-strong); }
.credit { margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .button, .tab { transition: none; }
  .js-tabs .panel { animation: fade 150ms ease; }
  @keyframes fade { from { opacity: 0; } }
}
@media (prefers-contrast: more) {
  .card, .tabs { border: 1px solid var(--foreground); }
}

/* Phone: the segmented control spans the width, equal segments (never a hidden scroll). */
@media (max-width: 560px) {
  .tabs { justify-self: stretch; }
  .tab { flex: 1 1 0; justify-content: center; padding: 0 0.5rem; font-size: 0.875rem; }
}

/* A sede booked by contacting the studio (SPEC_MEDICI_2 §4.3). */
.contacts { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
