/**
 * Patient-facing typography: spacing and line-height for readable copy.
 */
.homepage-body {
  line-height: 1.65;
}

.homepage-body .page-hero {
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
}

.homepage-body section.bg-primary\/5 > .container > div.page-hero,
.homepage-body #dashboard-banner > .container > div.page-hero {
  margin-inline: auto;
  text-align: center;
  align-items: center;
}

.homepage-body section.bg-primary\/5 .page-hero-lead,
.homepage-body #dashboard-banner .page-hero-lead,
.homepage-body section.bg-primary\/5 > .container > div.page-hero > p,
.homepage-body #dashboard-banner > .container > div.page-hero > p {
  max-width: 42rem;
  width: 100%;
}

.homepage-body section.bg-primary\/5 > .container > div.page-hero .flex,
.homepage-body #dashboard-banner > .container > div.page-hero .flex {
  justify-content: center;
}

.homepage-body .page-hero > :is(h1, h2, p, .page-hero-lead) {
  margin: 0;
}

.homepage-body .page-hero h1 {
  line-height: 1.2;
}

.homepage-body .page-hero :is(p, .page-hero-lead) {
  line-height: 1.75;
}

.homepage-body .readable-copy :is(p, li, dd) {
  line-height: 1.75;
}

.homepage-body .readable-copy p + p {
  margin-top: 0.875rem;
}

.homepage-body .card-body :is(p, .text-sm:not(.label-text)) {
  line-height: 1.7;
}

.homepage-body .card-body p + p {
  margin-top: 0.75rem;
}

.homepage-body h1:is(.text-4xl, .text-5xl) {
  line-height: 1.2;
}

.homepage-body h2:is(.text-xl, .text-2xl) {
  line-height: 1.35;
}

.homepage-body .alert :is(p, div) {
  line-height: 1.65;
}

.homepage-body .alert p + p {
  margin-top: 0.5rem;
}

.homepage-body .label-text {
  line-height: 1.5;
}

/* Hero headers across patient pages (title blocks) */
.homepage-body section.bg-primary\/5 > .container > div.max-w-3xl.space-y-4 > * + *,
.homepage-body section.bg-primary\/5 > .container > div.max-w-4xl.space-y-4 > * + *,
.homepage-body #dashboard-banner > .container > div.max-w-3xl.space-y-4 > * + * {
  margin-top: 1.375rem !important;
}

.homepage-body section.bg-primary\/5 h1,
.homepage-body #dashboard-banner h1 {
  line-height: 1.2;
}

.homepage-body section.bg-primary\/5 > .container p,
.homepage-body #dashboard-banner p {
  line-height: 1.75;
}

#symbyogut-root,
.patient-dashboard-root,
section#biological-capital-section {
  line-height: 1.65;
}

#symbyogut-root p,
.patient-dashboard-root p {
  line-height: 1.7;
}

#symbyogut-root p + p,
.patient-dashboard-root p + p {
  margin-top: 0.75rem;
}

/* ── Mobile: keep copy and UI messages readable without zoom ───────────── */
@media (max-width: 767px) {
  .homepage-body {
    scroll-padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  }

  .homepage-body main :is(p, li, dd, blockquote) {
    font-size: max(1rem, 1em);
    line-height: 1.7;
  }

  .homepage-body .card-body :is(p, li) {
    font-size: max(1rem, 1em);
  }

  .homepage-body .text-sm:not(.badge):not(.btn):not(.label-text) {
    font-size: 0.9375rem;
    line-height: 1.65;
  }

  .homepage-body .label,
  .homepage-body .label-text {
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .homepage-body .alert {
    font-size: 1rem;
    line-height: 1.65;
  }

  .homepage-body .doctor-patient-nav .menu :is(a, button) {
    font-size: 1rem;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
  }

  .homepage-body .doctor-patient-nav .menu-title {
    font-size: 0.8125rem;
    line-height: 1.4;
    opacity: 0.85;
  }

  .vex-legacy-body main :is(p, li, dd, label, .form-label) {
    font-size: max(1rem, 1em);
    line-height: 1.65;
  }

  .sb-nav-fixed #layoutSidenav_content :is(p, li, dd, .card-body, .form-label) {
    font-size: max(1rem, 1em);
    line-height: 1.65;
  }

  .sb-nav-fixed #layoutSidenav_content .text-muted,
  .sb-nav-fixed #layoutSidenav_content small {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* ── Health program page ─────────────────────────────────────────────────── */
.vc-program-title,
.vc-program-heading {
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.vc-program-nav {
  position: sticky;
  top: 4.75rem;
  z-index: 30;
  border-bottom: 1px solid #DCE0E5;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(10px);
}

.homepage-body:has(.vc-program-nav) {
  scroll-padding-top: 8.25rem;
}

.vc-program-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.25rem;
  padding: 0.65rem 0;
}

.vc-program-nav__list a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: #5B6B7A;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.vc-program-nav__list a:hover,
.vc-program-nav__list a:focus-visible {
  color: #247B76;
  background: rgba(52, 178, 172, 0.08);
}

.vc-program-areas {
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .vc-program-areas {
    display: grid;
  }
}

.vc-program-areas__nav {
  position: sticky;
  top: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.vc-program-area-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
  color: #5B6B7A;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.vc-program-area-btn:hover {
  color: #172126;
  background: #F9FAFB;
}

.vc-program-area-btn.is-active {
  color: #247B76;
  background: #EDF4F4;
}

.vc-program-area-btn:focus-visible {
  outline: 2px solid #247B76;
  outline-offset: 2px;
}

.vc-program-area-btn__icon {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(52, 178, 172, 0.1);
  color: #247B76;
}

.vc-program-accordion {
  border: 1px solid #DCE0E5;
  border-radius: 1.05rem;
  background: #fff;
}

.vc-program-accordion > summary {
  display: flex;
  cursor: pointer;
  list-style: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
}

.vc-program-accordion > summary::-webkit-details-marker {
  display: none;
}

.vc-program-accordion__body {
  border-top: 1px solid #DCE0E5;
  padding: 0.25rem 0.65rem 0.65rem;
}

.vc-program-accordion__body article {
  border: 0;
  box-shadow: none;
  padding: 1rem 0.5rem 0.5rem;
}

.vc-program-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: 56rem;
  margin-inline: auto;
  padding: 1.35rem 1.5rem;
  border: 1px solid #DCE0E5;
  border-radius: 1.15rem;
  background: #fff;
}

@media (min-width: 640px) {
  .vc-program-cta {
    flex-direction: row;
    align-items: center;
  }
}

/*
 * Dashboard paziente: stessa palette accessibile dell'area medico (WCAG AA, testo almeno 4.5:1).
 * I token daisyUI vanno ridefiniti qui: quelli di :root sono gia' risolti e non seguono --primary.
 * #34B2AC resta per logo e superfici; comandi, link e stati usano le tinte scure.
 */
.patient-app {
  --primary: 177 55% 31%;
  --muted-foreground: 209 15% 42%;
  --destructive: 0 72% 32%;
  --ring: 177 55% 31%;
  --color-primary: hsl(var(--primary));
  --color-primary-content: #fff;
  --color-ring: hsl(var(--primary));
  --color-muted-foreground: hsl(var(--muted-foreground));
  --color-destructive: hsl(var(--destructive));
  --color-error: #8c1717;
  --color-error-content: #fff;
  --color-success: #2e7d32;
  --color-success-content: #fff;
  --color-warning: #a56218;
  --color-warning-content: #fff;
  --color-info: #3970a9;
  --color-info-content: #fff;
}

.patient-app .text-base-content\/50,
.patient-app .text-base-content\/55,
.patient-app .text-base-content\/60 {
  color: #5b6b7a;
}

/* Avvisi su fondo chiaro: piu' calmi per il paziente, testo comunque sopra 4.5:1. */
.patient-app .alert-info { background-color: #e7f1fb; border-color: #E7F1FB; color: #3970a9; }
.patient-app .alert-success { background-color: #eaf5ea; border-color: #DCE0E5; color: #2e7d32; }
.patient-app .alert-warning { background-color: #fff8ee; border-color: #A56218; color: #a56218; }
.patient-app .alert-error { background-color: #fde7e7; border-color: #FDE7E7; color: #8C1717; }

/*
 * Etichette di stato condivise con l'area medico: stesso colore per lo stesso stato, sempre con icona.
 * attesa = grigio-blu, in corso = verde acqua, fatto = verde, da fare = arancio, errore = rosso, chiuso = grigio.
 */
.vx-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.5rem;
  padding: 0.1rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.vx-state::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 0.7rem;
}

.vx-state--wait { background: #EAEDF0; color: #5b6b7a; }
.vx-state--wait::before { content: "\f252"; }
.vx-state--progress { background: #EDF4F4; color: #247b76; }
.vx-state--progress::before { content: "\f042"; }
.vx-state--done { background: #eaf5ea; color: #2e7d32; }
.vx-state--done::before { content: "\f00c"; }
.vx-state--action { background: #fff8ee; color: #a56218; border-color: #A56218; }
.vx-state--action::before { content: "\f06a"; }
.vx-state--error { background: #fde7e7; color: #8C1717; }
.vx-state--error::before { content: "\f071"; }
.vx-state--closed { background: #EAEDF0; color: #172126; }
.vx-state--closed::before { content: "\f05e"; }

/* Categorie (tipo di richiesta, numero d'ordine): neutre, non sono stati. */
.vx-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.65rem;
  border: 1px solid #dce0e5;
  border-radius: 999px;
  background: #fff;
  color: #5b6b7a;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.vx-edge--wait { border-left-color: #5B6B7A !important; }
.vx-edge--progress { border-left-color: #247b76 !important; }
.vx-edge--done { border-left-color: #2e7d32 !important; }
.vx-edge--action { border-left-color: #a56218 !important; }
.vx-edge--error { border-left-color: #8C1717 !important; }
.vx-edge--closed { border-left-color: #8a96a3 !important; }

/* Bordi dei campi visibili come nell'area medico (3:1 sullo sfondo bianco). */
.patient-app :is(.input, .select, .textarea, .file-input) {
  border-color: #8a96a3;
}

/* Conteggi (non letti, richieste aperte): neutri come il badge "Da fare" del medico. */
.badge.vx-count { background: #172126; border-color: #172126; color: #fff; }

/*
 * I miei esami: elenco delle prescrizioni a sinistra, dettaglio della prescrizione scelta a destra.
 * Stessi teal, grigi e stati vx-state della dashboard paziente.
 */
.vx-exams { background: #fff; }

.vx-exams__filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.vx-exams__filter {
  padding: 0.55rem 1.1rem;
  border: 1px solid #dce0e5;
  border-radius: 999px;
  background: #EAEDF0;
  color: #172126;
  font-size: 0.875rem;
  font-weight: 500;
}
.vx-exams__filter:hover { border-color: #8a96a3; }
.vx-exams__filter.is-active { background: #247B76; border-color: #247B76; color: #fff; }
.vx-exams__filter:focus-visible { outline: 2px solid #247B76; outline-offset: 2px; }

/* Dettaglio: pannello laterale largo sopra la pagina (dialog modale), a tutto schermo sotto i 768px. */
.vx-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(960px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 1.5rem 0 0 1.5rem;
  background: #fff;
  box-shadow: -24px 0 48px rgb(16 24 40 / 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.vx-drawer[open] { animation: vx-drawer-in 0.22s ease-out; }
.vx-drawer::backdrop { background: rgb(31 42 51 / 0.45); }
@keyframes vx-drawer-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vx-drawer[open] { animation: none; } }
html.vx-drawer-open { overflow: hidden; }

.vx-drawer .vx-detail { position: relative; padding: 2rem 2.5rem 2.5rem; border: 0; border-radius: 0; box-shadow: none; }
.vx-drawer .vx-detail__head { padding-right: 3rem; }
.vx-drawer__close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border: 1px solid #dce0e5; border-radius: 999px;
  background: #fff; color: #172126; font-size: 1.1rem;
}
.vx-drawer__close:hover { border-color: #247B76; color: #247B76; }
.vx-drawer__close:focus-visible { outline: 2px solid #247B76; outline-offset: 2px; }
.vx-drawer .vx-detail__pdf { width: fit-content; padding-inline: 1.5rem; }
.vx-drawer .vx-detail__tabs { position: sticky; top: 0; z-index: 1; background: #fff; }
@media (max-width: 767px) {
  .vx-drawer { border-radius: 0; }
  .vx-drawer .vx-detail { padding: 1.25rem 1rem 2rem; }
  .vx-drawer__close { top: 1rem; right: 1rem; }
  .vx-drawer .vx-detail__pdf { width: auto; }
}

.vx-exams__list { display: flex; flex-direction: column; gap: 0.75rem; }
.vx-exams__empty { padding: 1.5rem; border: 1px dashed #dce0e5; border-radius: 1rem; color: #5b6b7a; text-align: center; font-size: 0.875rem; }

/* Riga prescrizione */
.vx-rx {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid #DCE0E5;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04);
  transition: border-color 0.15s, background-color 0.15s;
}
.vx-rx[hidden] { display: none; }
.vx-rx.is-selected { border-color: rgb(36 123 118 / 0.45); background: #EAEDF0; box-shadow: 0 0 0 1px rgb(36 123 118 / 0.25); }
.vx-rx__date { display: flex; flex-direction: column; min-width: 4.25rem; padding-top: 0.15rem; }
.vx-rx__day { font-size: 1.6rem; font-weight: 600; line-height: 1.1; color: #172126; }
.vx-rx__month { margin-top: 0.2rem; font-size: 0.75rem; letter-spacing: 0.04em; color: #5b6b7a; }
.vx-rx__main { display: flex; flex-direction: column; gap: 0.15rem; }
.vx-rx__progress, .vx-rx__actions { grid-column: 1 / -1; }
.vx-rx__bar { height: 0.4rem; margin-top: 0.5rem; border-radius: 999px; background: #EAEDF0; overflow: hidden; }
.vx-rx__bar > span { display: block; height: 100%; border-radius: inherit; background: #247b76; }
.vx-rx__bar.is-complete > span { background: #2e7d32; }
.vx-rx__actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.vx-rx__details { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.25rem; color: #247B76; font-size: 0.875rem; font-weight: 600; }
.vx-rx__details:hover { text-decoration: underline; }
@media (min-width: 768px) {
  .vx-rx { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(200px, 300px) auto; align-items: center; }
  .vx-rx__progress, .vx-rx__actions { grid-column: auto; }
}

/* Pannello di dettaglio */
.vx-detail { padding: 1.5rem; border: 1px solid #DCE0E5; border-radius: 1.25rem; background: #fff; box-shadow: 0 8px 24px rgb(16 24 40 / 0.06); }
.vx-detail[hidden] { display: none; }
.vx-detail__pdf {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: 1rem; padding: 0.7rem 1rem;
  border: 1px solid #dce0e5; border-radius: 0.75rem; background: #EAEDF0;
  color: #247B76; font-size: 0.9rem; font-weight: 600;
}
.vx-detail__pdf:hover { border-color: #247B76; }
.vx-detail__tabs { display: flex; gap: 0.25rem; margin-top: 1.25rem; border-bottom: 1px solid #DCE0E5; overflow-x: auto; }
.vx-detail__tabs [role="tab"] {
  padding: 0.65rem 0.9rem; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: #172126; font-size: 0.9rem; font-weight: 500; white-space: nowrap;
}
.vx-detail__tabs [role="tab"][aria-selected="true"] { border-bottom-color: #247B76; color: #247B76; font-weight: 600; }
.vx-detail__tabs [role="tab"]:focus-visible { outline: 2px solid #247B76; outline-offset: -2px; }
.vx-detail__panel { padding-top: 1rem; }
.vx-detail__note {
  display: flex; gap: 0.6rem; margin-top: 1rem; padding: 0.9rem 1rem;
  border-radius: 0.9rem; background: #EAEDF0; color: #172126; font-size: 0.85rem; line-height: 1.5;
}
.vx-detail__note i { margin-top: 0.2rem; color: #3970a9; }

/* Singolo esame */
.vx-exam { border: 1px solid #DCE0E5; border-radius: 1rem; background: #fff; }
.vx-exam__summary { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem; cursor: pointer; list-style: none; }
.vx-exam__summary::-webkit-details-marker { display: none; }
.vx-exam__num {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 999px; background: #EAEDF0; color: #172126; font-size: 0.85rem; font-weight: 600;
}
.vx-exam__chevron { margin-top: 0.35rem; font-size: 0.8rem; color: #5b6b7a; transition: transform 0.15s; }
.vx-exam[open] .vx-exam__chevron { transform: rotate(180deg); }
.vx-exam__body { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1rem 1rem 3.75rem; }
@media (max-width: 639px) { .vx-exam__body { padding-left: 1rem; } }
.vx-exam__lab { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 0.75rem; background: #EAEDF0; }
.vx-exam__options { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.vx-exam__options > p { grid-column: 1 / -1; }
@media (min-width: 768px) { .vx-exam__options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vx-exam__more > summary { list-style: none; }
.vx-exam__more > summary::-webkit-details-marker { display: none; }
.vx-exam__more[open] > summary i { transform: rotate(180deg); }
.vx-exam__other > summary {
  width: fit-content; margin: 0 auto; cursor: pointer; list-style: none;
  color: #247B76; font-size: 0.85rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.vx-exam__other > summary::-webkit-details-marker { display: none; }

.vx-offer { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 1rem; border: 1px solid #DCE0E5; border-radius: 0.9rem; background: #fff; }
.vx-doc { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border: 1px solid #DCE0E5; border-radius: 0.9rem; background: #fff; }
.vx-doc:hover { border-color: #247B76; }
