:root {
  --font-main: "Inter", sans-serif;
  --font-heading: "Inter", sans-serif;

  --color-primary: #245cf6;
  --color-primary-dark: #1747c9;
  --color-text: #111827;
  --color-text-soft: #5b6474;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #eef3fb;
  --color-page-alt: #f3f4f6;
  --color-border: #e6e8ee;
  --color-footer: #08132b;

  --shadow-card: 0 10px 24px rgba(17, 24, 39, 0.08);
  --radius-xl: 2rem;
  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --radius-sm: 0.75rem;

  --container: min(92%, 1600px);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.25rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  padding-top: 5rem;
  overflow-x: hidden;
  width: 100%;
}

body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.narrow-container {
  max-width: 68rem;
}

.logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.brand-name,
.nav-link,
.btn,
.section-heading h2,
.section-heading h1,
.footer-grid h3,
.service-card h3,
.pathology-card h3,
.path-step h3,
.cta-content h2 {
  font-family: var(--font-heading);
}

/* ---------------- HEADER ---------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  margin: 0;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #23407e;
}

.brand-role {
  font-size: 1rem;
  color: var(--color-text-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  padding-bottom: 0.1rem;
}

.nav-link.active {
  font-weight: 700;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -3px;
  width: calc(100% + 12px);
  height: 2px;
  background: transparent;
  border-radius: 999px;
  transition: 0.2s;
}

.nav-link:hover::after {
  background: rgba(36, 92, 246, 0.4);
}

.nav-link.active::after {
  background: var(--color-primary);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
  z-index: 1100;
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 1.5rem;
  height: 2px;
  background: var(--color-text);
  border-radius: 999px;
  transform: translateX(-50%);
  transition:
    transform 0.3s ease,
    opacity 0.25s ease,
    top 0.3s ease,
    bottom 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  top: 0.72rem;
}

.menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}

.menu-toggle span:nth-child(3) {
  bottom: 0.72rem;
}

.menu-toggle.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  font-weight: 600;
  transition: 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-light {
  background: white;
  color: var(--color-primary);
  border: 1px solid white;
}

.btn-light:hover {
  background: #f4f7ff;
}

/* ---------------- PAGE HERO ---------------- */
.about-hero {
  padding: 0;
}

.about-hero-box {
  width: 100%;
  background: #eef3fb;
  text-align: center;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  margin-top: 0;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.about-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.about-hero-box h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
}

.about-hero-box p {
  max-width: 46rem;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--color-text-soft);
}

/* ---------------- SECTIONS ---------------- */
.section {
  padding: 4rem 0 5rem;
}

.section-alt {
  background: var(--color-page-alt);
}

.section-heading {
  text-align: center;
  margin-bottom: 2.8rem;
}

.section-badge {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: #dfe9ff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.section-badge svg {
  width: 2rem;
  height: 2rem;
}

.section-badge-alert {
  background: #fde8e8;
  color: #ef4444;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0 0 0.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.section-heading p {
  max-width: 48rem;
  margin: 0 auto;
  color: var(--color-text-soft);
  font-size: 1.2rem;
}

/* ---------------- SERVIZI PRINCIPALI ---------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
  align-items: stretch;
}

.service-card,
.pathology-card {
  background: var(--color-surface);
  border: 1px solid rgba(230, 232, 238, 0.9);
  box-shadow: var(--shadow-card);
  border-radius: 1rem;
  padding: 1.4rem 1.3rem;
}

.service-card {
  min-height: 100%;
}

.service-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.7rem;
  background: #dfe9ff;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.service-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.service-icon-large svg {
  width: 1.8rem;
  height: 1.8rem;
}

.service-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.35;
}

.service-card p {
  margin: 0 0 0.85rem;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.service-card ul,
.pathology-card ul {
  margin: 0;
  padding-left: 1rem;
}

.service-card li,
.pathology-card li {
  margin: 0.22rem 0;
  color: var(--color-text-soft);
  font-size: 0.93rem;
}

.service-card li::marker,
.pathology-card li::marker {
  color: var(--color-primary);
}

/* ---------------- PATOLOGIE TRATTATE ---------------- */
.pathologies-section {
  margin-bottom: 4rem;
}

.pathologies-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

.pathology-column {
  display: flex;
  flex-direction: column;
}

.pathology-column-title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #4b5565;
}

.pathology-column-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pathology-card h3 {
  margin: 0 0 0.75rem;
  color: var(--color-primary);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
}

.pathology-card p {
  margin: 0 0 0.85rem;
  color: var(--color-text-soft);
  font-size: 0.98rem;
}

.pathology-card h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.pathologies-note {
  text-align: center;
  margin-top: 2.8rem;
}

.pathologies-note-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--color-text-soft);
  font-weight: 500;
}

.pathologies-note p:last-child {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 1rem;
}

.inline-link {
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------------- PERCORSO CLINICO ---------------- */
.clinical-path {
  background: #eef3fb;
}

.path-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  text-align: center;
  align-items: start;
}

.path-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.path-number {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.path-step h3 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 500;
}

.path-step p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.98rem;
  max-width: 15rem;
}

/* ---------------- CTA ---------------- */
.cta-section {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.cta-box {
  position: relative;
  overflow: hidden;
  background: var(--color-primary);
  color: white;
  border-radius: 1.5rem;
  padding: clamp(6rem, 4vw, 4rem);
  margin: 2rem 0;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-content {
  text-align: center;
  max-width: 46rem;
  position: relative;
  z-index: 2;
}

.cta-content h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.cta-content p {
  margin: 0 auto 1.5rem;
  max-width: 38rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}

.cta-calendar-decor {
  position: absolute;
  right: -0.05rem;
  bottom: -0.05rem;
  width: min(30%, 12rem);
  aspect-ratio: 194 / 194;
  color: rgba(74, 85, 101, 0.36);
  pointer-events: none;
}

.cta-calendar-frame,
.cta-calendar-dots {
  position: absolute;
  display: block;
}

.cta-calendar-frame {
  inset: 0;
  width: 100%;
  height: 100%;
}

.cta-calendar-dots {
  width: 71.65%;
  height: auto;
  left: 16.5%;
  top: 51.5%;
}

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: var(--color-footer);
  color: white;
  margin-top: 0;
  padding-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: 2rem;
}

.footer-grid h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.footer-grid p {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.82);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 2rem;
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.footer-social {
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transition: 0.2s;
}

.social-link:hover {
  background: #0A66C2;
}

.social-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.privacy-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
  font-size: 1.1rem;
  padding-bottom: 0.6rem;
}

.privacy-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ---------------- BACK TO TOP ---------------- */
#backToTop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 999rem;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease,
    padding 0.3s ease;
  gap: 0;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}

#backToTop:hover {
  width: 8rem;
  justify-content: flex-start;
  padding-left: 1rem;
  gap: 0.5rem;
}

.top-icon {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 auto;
  display: block;
  transform: translateY(-0.03rem);
}

.top-text {
  white-space: nowrap;
  font-weight: 600;
  line-height: 1;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-width 0.3s ease,
    opacity 0.2s ease;
}

#backToTop:hover .top-text {
  max-width: 5rem;
  opacity: 1;
}

/* ---------------- ANIMATIONS ---------------- */
.reveal {
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal-up {
  transform: translateY(2rem);
}

.reveal-left {
  transform: translateX(-2rem);
}

.reveal-right {
  transform: translateX(2rem);
}

.reveal-hero {
  transform: translateY(1.5rem);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1100px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.2rem 1.5rem;
  }
}

@media (max-width: 860px) {
  body {
    padding-top: 4.5rem;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 5rem;
    right: 4%;
    left: 4%;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 100;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.98);
    pointer-events: none;
    transition:
      opacity 0.28s ease,
      transform 0.28s ease,
      visibility 0.28s ease;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .main-nav ul,
  .main-nav .nav-cta {
    opacity: 0;
    transform: translateY(-6px);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .main-nav.open ul,
  .main-nav.open .nav-cta {
    opacity: 1;
    transform: translateY(0);
  }

  .main-nav.open ul {
    transition-delay: 0.05s;
  }

  .main-nav.open .nav-cta {
    transition-delay: 0.1s;
  }

  .main-nav li {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    font-size: 1.1rem;
    padding-bottom: 0.9rem;
  }

  .nav-link::after {
    content: none;
  }

  .nav-link.active {
    background: #eef4ff;
    color: var(--color-primary);
    font-weight: 600;
  }

  .nav-link:hover {
    background: #f5f8ff;
    color: var(--color-primary);
  }

  .nav-cta {
    width: 100%;
    margin-top: 0.75rem;
  }

  .pathologies-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .pathology-column-title {
    font-size: 1.35rem;
    margin-bottom: 0.9rem;
  }

  .pathology-column-list {
    gap: 1.2rem;
  }

  .path-steps {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
  }

  .path-step {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    align-items: start;
    gap: 0 0.4rem;
    padding-left: 1.2rem;
    text-align: left;
  }

  .path-number {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 4rem;
    height: 4rem;
    margin: 0;
    align-self: start;
    justify-self: start;
  }

  .path-text {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .path-text h3 {
    margin: 0 0 0.45rem;
    text-align: left;
  }

  .path-text p {
    margin: 0;
    max-width: none;
    text-align: left;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cta {
  padding: 1.5rem 0 2rem;
  }

  .cta-box {
    padding: 2rem 1.25rem;
    min-height: 0;
    border-radius: 1.5rem;
  }

  .cta-box h2 {
    font-size: 1.5rem;
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .cta-box p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 28rem;
    margin: 0 auto 1.5rem;
  }

  .cta-box .btn {
    min-height: 2.8rem;
    padding: 0 1.2rem;
    font-size: 1rem;
  }

  .cta-calendar-decor {
    width: 20%;
    right: 0.02rem;
    bottom: 0.02rem;
  }
}

@media (max-width: 640px) {
  .about-hero {
    padding: 0;
    margin: 0;
  }

  .about-hero-box {
    width: 100%;
    min-height: 220px;
    padding: 3rem 1rem;
    margin: 0;
  }

  .about-hero-content {
    width: 100%;
    padding: 0;
  }

  .about-hero-box h1 {
    font-size: 2.2rem;
  }

  .about-hero-box p {
    font-size: 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-heading h2 {
    font-size: 2rem;
  }

  .section-heading p,
  .service-card p,
  .pathology-card p,
  .service-card li,
  .pathology-card li,
  .path-step p {
    font-size: 0.94rem;
  }

  .services-grid,
  .path-steps {
    grid-template-columns: 1fr;
  }

  .service-card,
  .pathology-card {
    padding: 1.2rem 1rem;
  }

  .service-card h3 {
    font-size: 1.05rem;
  }

  .pathology-column-title {
    font-size: 1.2rem;
  }

  .pathology-card h3 {
    font-size: 1.35rem;
  }

  .path-number {
    width: 3rem;
    height: 3rem;
    font-size: 1.3rem;
  }

  .path-step h3 {
    font-size: 1.2rem;
  }

  .pathologies-note-title {
    font-size: 1.25rem;
  }

  .cta {
  padding: 1.5rem 0 2rem;
  }

  .cta-box {
    padding: 2rem 1.25rem;
    min-height: 0;
    border-radius: 1.5rem;
  }

  .cta-box h2 {
    font-size: 1.3rem;
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .cta-box p {
    font-size: 0.8rem;
    line-height: 1.5;
    max-width: 28rem;
    margin: 0 auto 1.5rem;
  }

  .cta-box .btn {
    min-height: 2.8rem;
    padding: 0 1.2rem;
    font-size: 1rem;
  }

  .cta-calendar-decor {
    width: 20%;
    right: 0.02rem;
    bottom: 0.02rem;
  }

  #backToTop {
    display: none;
  }
}