/* ClinicReminder landing, editorial variant.
   Light surfaces, generous whitespace, navy text, one teal accent. */

:root {
  --navy: #21274f;
  --navy-soft: #2a3270;
  --teal: #27a5ad;
  --teal-light: #40bcc8;
  --teal-deep: #17707a;
  --teal-tint: #e6f4f5;
  --ink: #21274f;
  --muted: #4b5068;
  --line: #dde3e8;
  --paper: #ffffff;
  --paper-2: #f6f9fa;
  --gray-bg: #eef0f3;
  --gray-ink: #4b5563;
  --header-h: 72px;
  --font:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 4.6vw, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 700;
}

h3 {
  font-size: 1.2rem;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--teal-deep);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 760px;
}

.center {
  text-align: center;
}

/* Off screen by its own height, whatever the wrapping, until it gets focus. */
.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  transform: translateY(calc(-100% - 12px));
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 100;
}

.skip-link:focus {
  transform: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--teal-deep);
  text-decoration: underline;
}

/* Header buttons at the right edge of the row, demo first, Accedi last:
   - Demo: only useful while no other "Richiedi una demo" is on screen. With
     JS (`has-js`, set in the head before the first paint, only where
     IntersectionObserver exists) it starts hidden and app.js sets `data-shown`;
     with JS disabled, or without that API, it is always visible. The fade keeps
     the slot, so the gap it leaves sits between the links and Accedi, and
     nothing shifts.
   - Accedi: always visible, pinned to the edge by its auto margin. */
.header-cta {
  margin-left: auto;
  transition:
    opacity 0.25s ease,
    visibility 0.25s;
}

.has-js .header-cta:not([data-shown]) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Mobile menu toggle and the demo item of the dropdown: below 915px only. */
.nav-toggle,
.nav-demo {
  display: none;
}

/* Mobile header, one row: logo on the left, Accedi and the hamburger on the
   right. The header demo button is not shown; the demo sits in the hero, in the
   final call to action and as the last item of the dropdown. Below 915px the
   one-row desktop header (logo, links, buttons) no longer fits. Without JS the
   links stay inline and wrap, and the toggle is never shown. */
@media (max-width: 914px) {
  :root {
    --header-h: 72px;
  }
  .header-row {
    gap: 8px 12px;
  }
  .brand-logo {
    height: 28px;
  }
  .site-nav {
    order: 3;
  }
  .site-nav ul {
    gap: 20px;
  }
  /* Two classes: `.button` below sets display and is declared later. */
  .header-row .header-cta {
    display: none;
  }
  /* Same height as the toggle; two classes beat `.button`, declared later. */
  .header-row .header-login {
    order: 2;
    margin-left: auto;
    height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
  }
  .js .nav-demo {
    display: block;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 4px;
  }

  .js .site-nav {
    position: relative;
  }
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--ink);
    background: none;
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
  }
  .js .nav-toggle[aria-expanded='true'] {
    border-color: var(--teal);
    color: var(--teal-deep);
  }
  .js .site-nav ul {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    flex-direction: column;
    gap: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px -12px rgba(33, 39, 79, 0.3);
  }
  .js .site-nav ul.is-open {
    display: flex;
  }
  .js .site-nav li a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
  }
  .js .site-nav li a:hover {
    background: var(--teal-tint);
  }
}

/* Narrow phones: a smaller logo keeps logo, Accedi and the toggle on one row
   (27px fits 375px wide screens, 24px fits 360px). */
@media (max-width: 449px) {
  .brand-logo {
    height: 27px;
  }
}
@media (max-width: 374px) {
  .brand-logo {
    height: 24px;
  }
}

/* Below 360px row 2 still overflows: a narrower gap and tighter header buttons. */
@media (max-width: 359px) {
  .header-row {
    column-gap: 8px;
  }
  .brand-logo {
    height: 20px;
  }
  .header-row .button {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Narrower than any phone: two rows, the logo above, both buttons below on
   the right, instead of the toggle wrapping alone. */
@media (max-width: 319px) {
  .site-header {
    min-height: 0;
  }
  .brand {
    flex-basis: 100%;
  }
  .brand-logo {
    height: 24px;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.button-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.button-primary:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
}

.button-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.button-ghost:hover {
  background: var(--teal-tint);
}

.button-large {
  padding: 16px 28px;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  padding: clamp(36px, 6vw, 80px) 0 20px;
  display: flex;
  flex-direction: column;
  min-height: min(calc(100svh - var(--header-h)), 760px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  flex: 1;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 40px;
  }
}

.eyebrow {
  color: var(--teal-deep);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin-bottom: 1.2em;
}

.lead {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 30em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Tease to the next section: a bobbing chevron at the bottom of the hero. */
.hero-tease {
  align-self: center;
  margin-top: clamp(28px, 5vw, 56px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 8px 12px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s;
}

/* Hidden by app.js once the page has scrolled past the hero's opening view. */
.hero-tease[data-hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-tease:hover span {
  text-decoration: underline;
}

.hero-tease svg {
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-tease svg {
    animation: none;
  }
}

/* Product mock: the clinic dashboard, in the app's own neutral shadcn look. */
.mock {
  margin: 0;
  min-width: 0;
}

.app {
  --app-ink: #0a0a0a;
  --app-muted: #737373;
  --app-line: #e5e5e5;
  --app-muted-bg: #f5f5f5;
  background: #fff;
  color: var(--app-ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(33, 39, 79, 0.06),
    0 24px 48px -24px rgba(33, 39, 79, 0.3);
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.4;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--app-line);
}

.app-logo {
  height: 20px;
  width: auto;
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--app-ink);
}

.app-user {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--app-muted);
  min-width: 0;
}

.app-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--app-muted-bg);
  color: var(--app-ink);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.app-main {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.app-tabs {
  display: inline-flex;
  width: fit-content;
  background: var(--app-muted-bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.app-tab {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--app-muted);
  font-weight: 500;
}

.app-tab.is-active {
  background: #fff;
  color: var(--app-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.app-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 10px 12px;
}

.app-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.app-label {
  font-weight: 500;
  font-size: 11px;
}

.app-input {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  min-width: 76px;
  background: #fff;
}

.app-date {
  color: var(--app-muted);
  min-width: 96px;
}

.app-filter-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.app-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--app-ink);
  color: #fff;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.app-btn-ghost {
  background: transparent;
  color: var(--app-ink);
}

.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.app-table th,
.app-table td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid var(--app-line);
  white-space: nowrap;
  vertical-align: middle;
}

.app-table th {
  color: var(--app-muted);
  font-weight: 500;
  white-space: normal;
  line-height: 1.2;
  vertical-align: bottom;
}

.app-table tbody tr:last-child td {
  border-bottom: 0;
}

.app-table tbody tr:hover {
  background: color-mix(in srgb, var(--tint) 10%, transparent);
}

.app-table td svg {
  color: var(--app-muted);
  display: block;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  color: var(--app-ink);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.app-badge-ok {
  --c: #16a34a;
  color: #15803d;
}

.app-badge-soon {
  --c: #f59e0b;
  color: #b45309;
}

.app-badge-overdue {
  --c: #dc2626;
  color: #b91c1c;
}

/* Narrow screens: keep the real column order, drop the least telling columns. */
@media (max-width: 640px) {
  .app-filters,
  .app-email {
    display: none;
  }
  .app-table th:nth-child(2),
  .app-table td:nth-child(2),
  .app-table th:nth-child(6),
  .app-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-table th:nth-child(4),
  .app-table td:nth-child(4) {
    display: none;
  }
  .app-table td:first-child {
    white-space: normal;
  }
}

/* Sections */
.section {
  padding: clamp(48px, 7vw, 88px) 0;
  scroll-margin-top: var(--header-h);
}

.section-intro {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: -0.4em;
  margin-bottom: 1.6em;
}

/* Oggi / con ClinicReminder */
.section-change {
  padding-top: 0;
}

.change-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 820px) {
  .change-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.change-card {
  border-radius: 16px;
  padding: clamp(24px, 3vw, 36px);
}

.face {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 0 18px;
}

.change-card h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

.change-card p:last-child {
  margin-bottom: 0;
}

.change-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.change-before {
  background: var(--gray-bg);
  color: var(--gray-ink);
}

.change-before h3 {
  color: #374151;
}

.change-before .change-label {
  color: #6b7280;
}

.change-after {
  background: var(--teal-tint);
  color: var(--ink);
  border: 1px solid #bfe3e6;
}

.change-after h3 {
  color: var(--teal-deep);
}

.change-after .change-label {
  color: var(--teal-deep);
}

/* Cos'è ClinicReminder:
   - 720px and up, with JS: five tabs, one panel at a time, auto-advancing with a
     progress bar under the active tab.
   - Below 720px, or without JS: no tabs, every panel listed as a stacked card. */
.section-features {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 18px;
}

@media (min-width: 720px) {
  .js .feature-tabs {
    display: flex;
  }
}

.feature-tabs button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 10px 2px 12px;
  cursor: pointer;
  position: relative;
  flex: 1 1 auto;
  text-align: left;
}

.feature-tabs button:hover {
  color: var(--navy);
}

/* Selected label takes the bar's color, so tab and progress read as one unit. */
.feature-tabs button[aria-selected='true'] {
  color: var(--teal-deep);
}

.ft-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.ft-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
}

.feature-tabs button[aria-selected='true'] .ft-bar::after {
  transform: scaleX(var(--progress, 0));
}

.feature-panels {
  display: grid;
  gap: 16px;
}

.feature-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 28px;
}

.js .feature-panel[hidden] {
  display: none;
}

.feature-panel h3 {
  margin-bottom: 0.4em;
}

.feature-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Stacked list: a teal edge echoes the desktop progress bar. */
@media (max-width: 719px) {
  .feature-panels {
    gap: 12px;
  }
  .feature-panel {
    padding: 18px 20px;
    border-left: 3px solid var(--teal);
  }
  .feature-panel h3 {
    font-size: 1.1rem;
  }
  .feature-panel p {
    font-size: 1rem;
  }
}

/* Come funziona: three steps on one connected line. */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  position: relative;
  padding-bottom: 32px;
}

.steps li::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 3px;
  background: var(--teal);
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps li:last-child::before {
  display: none;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.steps h3 {
  margin: 8px 0 0.3em;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* FAQ: buttons with an animated grid-rows panel; without JS every answer is open. */
.section-faq {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.faq-item {
  border-top: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

.faq-q {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  width: 100%;
  background: none;
  border: 0;
  padding: 16px 40px 16px 0;
  position: relative;
  cursor: pointer;
}

.faq-q::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--teal-deep);
  border-bottom: 2px solid var(--teal-deep);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.3s ease;
}

.faq-q[aria-expanded='true']::after {
  transform: translateY(-30%) rotate(225deg);
}

.js .faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.js .faq-panel.is-open {
  grid-template-rows: 1fr;
}

.faq-inner {
  overflow: hidden;
}

.faq-inner p {
  margin: 0;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .js .faq-panel,
  .faq-q::after {
    transition: none;
  }
}

/* Final CTA: the accent tint, the navy button on it */
.section-cta {
  background: var(--teal-tint);
  padding: clamp(64px, 9vw, 112px) 0;
}

.section-cta h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}

.section-cta p {
  color: var(--muted);
  font-size: 1.15rem;
  margin-bottom: 28px;
}

/* Footer */
.site-footer {
  padding: 28px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
}

.footer-row p {
  margin: 0;
}

.footer-row ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-company {
  flex-basis: 100%;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
