/* Area Referti — hero dedicato */

.page-hero--referti {
  padding: calc(var(--site-header) + 1.65rem) 0 2.35rem;
}

.page-hero--referti .page-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
}

.ref-hero-panel-left {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.3rem, 2.4vw, 1.65rem) clamp(1.3rem, 2.4vw, 1.75rem);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 38px rgba(0, 30, 38, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ref-hero-head {
  position: relative;
  z-index: 1;
}

.page-hero--referti .breadcrumb {
  margin-bottom: 0.75rem;
}

.page-hero--referti .page-hero__eyebrow {
  margin-bottom: 0.75rem;
}

.ref-hero__mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 90% 80% at 18% 12%, #000 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 18% 12%, #000 8%, transparent 72%);
  opacity: 0.55;
}

.page-hero--referti .page-hero__title {
  max-width: 16ch;
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 3.8vw, 2.85rem);
}

.page-hero--referti .page-hero__title-accent {
  background: linear-gradient(
    100deg,
    #dbeafe 0%,
    #93c5fd 35%,
    #60a5fa 65%,
    #3b82f6 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(59, 130, 246, 0.28));
}

.page-hero--referti .page-hero__desc--lead {
  margin: 0;
  font-size: clamp(1rem, 1.9vw, 1.08rem);
  font-weight: 500;
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.93);
  max-width: 52ch;
}

.ref-hero-visual {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: auto;
}

.ref-hero-visual__item {
  margin: 0;
  padding: 0.5rem 0.5rem 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-align: center;
}

.ref-hero-visual__item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.ref-hero-visual__item figcaption {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

.ref-hero-visual__item--cf {
  border-color: rgba(147, 197, 253, 0.28);
}

.ref-hero-visual__item--foglio {
  border-color: rgba(79, 184, 178, 0.28);
}

.ref-hero-visual__item--portale {
  border-color: rgba(134, 239, 172, 0.28);
}

.page-hero--referti .page-hero__aside {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.ref-hero-aside__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.ref-hero-aside__intro {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 38ch;
}

.ref-hero-cards {
  display: grid;
  gap: 0.75rem;
}

.ref-hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: var(--color-white);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.ref-hero-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-primary));
  z-index: 1;
}

.ref-hero-card__icon,
.ref-hero-card__body,
.ref-hero-card__arrow {
  position: relative;
  z-index: 2;
}

.ref-hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 16px 34px rgba(0, 30, 38, 0.18);
}

.ref-hero-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  color: var(--color-primary);
  background: rgba(13, 115, 119, 0.08);
  flex-shrink: 0;
}

.ref-hero-card__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.ref-hero-card--step1 .ref-hero-card__icon {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.ref-hero-card--step1::before {
  background: linear-gradient(180deg, #93c5fd, #2563eb);
}

.ref-hero-card--step2 .ref-hero-card__icon {
  color: var(--color-primary);
  background: rgba(13, 115, 119, 0.08);
}

.ref-hero-card--step3 .ref-hero-card__icon {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.ref-hero-card--step3::before {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}

.ref-hero-card__body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.ref-hero-card__kicker {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.ref-hero-card--step1 .ref-hero-card__kicker {
  color: #2563eb;
}

.ref-hero-card--step3 .ref-hero-card__kicker {
  color: #16a34a;
}

.ref-hero-card__body strong {
  font-size: 0.96rem;
  line-height: 1.25;
  color: var(--color-primary-dark);
}

.ref-hero-card__body > span:last-child {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.ref-hero-card__arrow {
  font-size: 1.05rem;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.5;
  transition: transform var(--transition), opacity var(--transition);
}

.ref-hero-card:hover .ref-hero-card__arrow {
  transform: translateX(3px);
  opacity: 1;
}

.ref-hero-card--step1 .ref-hero-card__arrow {
  color: #2563eb;
}

.ref-hero-card--step3 .ref-hero-card__arrow {
  color: #16a34a;
}

#guideTitle,
#accessTitle {
  scroll-margin-top: calc(var(--site-header) + 1.25rem);
}

@media (hover: none) {
  .ref-hero-card:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
  }

  .ref-hero-card:active {
    transform: scale(0.985);
    border-color: rgba(0, 122, 148, 0.22);
  }
}

@media (max-width: 1040px) {
  .page-hero--referti {
    padding: calc(var(--site-header) + 1rem) 0 1.5rem;
  }

  .page-hero--referti .page-hero__inner {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .ref-hero-panel-left {
    display: contents;
  }

  .ref-hero-head {
    order: 1;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 1.1rem 1.15rem 1.15rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(0, 30, 38, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .page-hero--referti .page-hero__aside {
    order: 2;
    gap: 0.55rem;
  }

  .ref-hero-visual {
    order: 3;
    display: flex;
    gap: 0.6rem;
    margin-top: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.1rem 0.15rem 0.2rem;
  }

  .ref-hero-visual::-webkit-scrollbar {
    display: none;
  }

  .ref-hero-visual__item {
    flex: 0 0 calc((100% - 1.2rem) / 3);
    min-width: 6.75rem;
    scroll-snap-align: start;
    padding: 0.45rem 0.45rem 0.55rem;
    border-radius: 12px;
  }

  .ref-hero-visual__item figcaption {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  .page-hero--referti .page-hero__title {
    max-width: none;
    margin-bottom: 0.6rem;
    font-size: clamp(1.65rem, 6.8vw, 2.05rem);
    line-height: 1.14;
  }

  .page-hero--referti .page-hero__desc--lead {
    max-width: none;
    font-size: 0.9375rem;
    line-height: 1.58;
  }

  .page-hero--referti .breadcrumb {
    margin-bottom: 0.55rem;
  }

  .page-hero--referti .page-hero__eyebrow {
    margin-bottom: 0.6rem;
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
  }

  .ref-hero-aside__label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .ref-hero-aside__intro {
    display: none;
  }

  .ref-hero-cards {
    gap: 0.6rem;
  }

  .ref-hero-card {
    gap: 0.7rem;
    padding: 0.9rem 0.95rem;
    min-height: 4.25rem;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .ref-hero-card__icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  .ref-hero-card__body strong {
    font-size: 0.92rem;
  }

  .ref-hero-card__body > span:last-child {
    font-size: 0.78rem;
    line-height: 1.42;
  }
}

@media (max-width: 480px) {
  .ref-hero-head {
    padding: 1rem 1.05rem;
    border-radius: 14px;
  }

  .ref-hero-visual__item {
    min-width: 7.25rem;
  }

  .ref-hero-card {
    padding: 0.85rem 0.9rem;
    min-height: 4.5rem;
  }

  .ref-hero-card__arrow {
    font-size: 1.15rem;
    padding-left: 0.15rem;
  }
}
