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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a2332;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: #0d4f8b;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 700;
  color: #0f172a;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-align: center;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.narrow {
  max-width: 720px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #0f172a;
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 9999;
}

.skip-link:focus {
  left: 0;
}

/* Header — solo logo */
.site-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-agenia {
  height: 40px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 1;
  min-width: 0;
}

.header-nav a {
  color: #003366;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.header-nav a:hover {
  color: #8b1538;
  text-decoration: none;
}

.header-nav a:focus-visible {
  outline: 3px solid rgba(0, 51, 102, 0.35);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.header-nav__demo {
  background: #003366;
  color: #fff !important;
  border-radius: 0.4rem;
  padding: 0.5rem 0.95rem;
}

.header-nav__demo:hover {
  background: #002952;
  color: #fff !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-header {
  background: #fff;
  color: #003366;
  border: 2px solid #003366;
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
  border-radius: 0.4rem;
  font-weight: 600;
  box-shadow: none;
}

.btn-header:hover {
  background: #f1f5f9;
  border-color: #003366;
  color: #003366;
  text-decoration: none;
}

.btn-header:focus-visible {
  outline: 3px solid rgba(0, 51, 102, 0.35);
  outline-offset: 2px;
}

.btn-header-ghost {
  background: #003366;
  color: #fff;
  border-color: #003366;
}

.btn-header-ghost:hover {
  background: #002952;
  color: #fff;
  border-color: #002952;
  text-decoration: none;
}

.btn-header-ghost:focus-visible {
  outline: 3px solid rgba(0, 51, 102, 0.35);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .brand-agenia {
    height: 32px;
  }

  .header-nav {
    gap: 0.25rem 0.65rem;
  }

  .header-nav a {
    font-size: 0.8rem;
  }

  .header-nav__demo {
    padding: 0.4rem 0.7rem;
  }

  .btn-header {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }
}

/* Sticky wave sotto header (come solvendo.net) */
.sticky-wave {
  position: sticky;
  top: 72px;
  left: 0;
  right: 0;
  width: 100%;
  height: 0;
  z-index: 99;
  pointer-events: none;
}

.sticky-wave svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: block;
  filter: drop-shadow(0 6px 6px rgba(0, 51, 102, 0.08));
}

/* Hero — banda navy + cubo SVG + onda bottom (solvendo.net) */
.hero {
  position: relative;
  padding: 3rem 0 6rem;
  background: linear-gradient(180deg, #001a33 0%, #002952 30%, #003366 60%, #004d99 100%);
  overflow: visible;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.5) 0, transparent 50%),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.6) 0, transparent 50%),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.4) 0, transparent 50%),
    radial-gradient(2px 2px at 30% 80%, rgba(255, 255, 255, 0.5) 0, transparent 50%),
    radial-gradient(1px 1px at 90% 50%, rgba(255, 255, 255, 0.5) 0, transparent 50%),
    radial-gradient(1px 1px at 10% 60%, rgba(255, 255, 255, 0.4) 0, transparent 50%);
  background-size: 600px 600px;
  pointer-events: none;
  z-index: 0;
  animation: starsDrift 60s linear infinite;
  transform: translate3d(var(--px-stars-x, 0), var(--px-stars-y, 0), 0);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

@keyframes starsDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 600px 300px;
  }
}

.hero-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  z-index: 1;
  contain: strict;
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
  aspect-ratio: 1440 / 140;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: end;
  min-height: 340px;
}

.hero-left {
  position: relative;
  z-index: 4;
  max-width: 560px;
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.hero-panel {
  background: rgba(139, 21, 57, 0.5);
  border: 1px solid #8b1539;
  color: #fff;
  border-radius: 1.1rem;
  padding: 1.6rem 1.75rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.hero-panel h1 {
  color: #fff;
  font-size: clamp(1.38rem, 2.6vw, 1.95rem);
  line-height: 1.25;
  margin: 0 0 1.15rem;
  max-width: 22ch;
  text-transform: none;
  letter-spacing: normal;
}

.hero-panel p {
  margin: 0 0 1.15rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.02rem;
  line-height: 1.55;
}

.btn-demo {
  background: #fff;
  color: #8b1539;
  border-color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-demo:hover {
  background: #f8f0f3;
  color: #8b1539;
  border-color: #f8f0f3;
}

.btn-demo:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-video {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

.btn-video .material-icons {
  font-size: 1.2rem;
}

.btn-video:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

.btn-video:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.hero-avatar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  margin-bottom: -4.5rem;
  transform: translate3d(var(--px-img-x, 0), var(--px-img-y, 0), 0);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.hero-avatar img {
  width: min(200px, 55vw);
  height: auto;
  mix-blend-mode: lighten;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.35));
}

@media (min-width: 900px) {
  .hero {
    padding: 2.75rem 0 5.5rem;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    min-height: 380px;
  }

  .hero-left {
    padding-bottom: 1.25rem;
  }

  .hero-avatar {
    justify-content: flex-end;
    margin-right: 1rem;
    margin-bottom: -5rem;
  }

  .hero-avatar img {
    width: min(240px, 22vw);
  }
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero-constellation,
  .hero-avatar {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Buttons / form (resto pagina) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: 0.45rem;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.btn-light {
  background: #fff;
  color: #0d4f8b;
}

.btn-light:hover {
  background: #f1f5f9;
  color: #0d4f8b;
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* Sections */
.section {
  padding: 3.5rem 0;
  border-top: 1px solid #f1f5f9;
  position: relative;
  z-index: 1;
}

.intro-section {
  padding-top: 3.5rem;
  background: #f8fafc;
}

.intro-box {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 2.15rem 2.2rem;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 1.1rem;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
}

.section-muted {
  background: #f8fafc;
}

.section-lead {
  text-align: center;
  color: #3a4759;
  max-width: 60ch;
  margin: -0.25rem auto 1.75rem;
}

.section-title-bordeaux,
.intro-section .intro-title {
  color: #8b1539;
}

.intro-section .intro-title {
  margin-bottom: 1rem;
}

#moduli .section-title-bordeaux {
  margin-bottom: 1.75rem;
}

#moduli .card {
  text-align: left;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 0;
}

#moduli .card-icon {
  color: #8b1539;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}

#moduli .card h3 {
  margin: 0;
  color: #003366;
  font-size: 1.1rem;
}

#moduli .card p {
  margin: 0;
  color: #3a4759;
  font-size: 0.9rem;
  line-height: 1.45;
}

#moduli .card--featured {
  background: rgba(139, 21, 57, 0.85);
  border: 1px solid #8b1539;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  transform: none;
}

#moduli .card--featured:hover {
  border-color: #8b1539;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

#moduli .card--featured .card-icon,
#moduli .card--featured h3,
#moduli .card--featured p {
  color: #fff;
}

#funzionalita .section-title-bordeaux {
  margin-bottom: 1.75rem;
}

.feat-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.feat-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 1.2rem 1.25rem;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 0.85rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feat-item:hover {
  transform: translateY(-2px);
  border-color: #8b1539;
  box-shadow: 0 14px 32px rgba(139, 21, 57, 0.08);
}

.feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8eef2;
  color: #8b1539;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.feat-item h3 {
  margin: 0 0 0.4rem;
  color: #003366;
  font-size: 1.05rem;
  line-height: 1.3;
}

.feat-item p {
  margin: 0;
  color: #3a4759;
  font-size: 0.92rem;
  line-height: 1.55;
}

@media (min-width: 900px) {
  .feat-list {
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem 1.35rem;
  }

  .feat-item {
    padding: 1.35rem 1.4rem;
  }
}

#academy .section-title-bordeaux,
#giro-visite .section-title-bordeaux,
#panoramica .section-title-bordeaux {
  margin-bottom: 0.35rem;
}

#academy .section-lead,
#giro-visite .section-lead,
#panoramica .section-lead {
  margin-bottom: 1.5rem;
  color: #3a4759;
  font-weight: 500;
}

.academy-slot {
  max-width: 920px;
  margin: 0 auto;
}

.academy-video {
  margin: 0;
  background: #0f172a;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.academy-video__player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  vertical-align: middle;
}

#video-tutorial .section-title-bordeaux {
  margin-bottom: 0.35rem;
}

#video-tutorial .section-lead {
  margin-bottom: 1.75rem;
  color: #3a4759;
  font-weight: 500;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}

button.video-card {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
}

button.video-card:hover {
  border-color: #8b1539;
  box-shadow: 0 8px 22px rgba(139, 21, 57, 0.12);
}

button.video-card:focus-visible {
  outline: 3px solid rgba(139, 21, 57, 0.35);
  outline-offset: 2px;
}

.video-card h3,
.video-card p {
  margin: 0;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.video-card h3 {
  padding-top: 0.85rem;
}

.video-card p {
  padding-bottom: 1.15rem;
  color: #3a4759;
  font-size: 0.95rem;
  font-weight: 400;
}

.video-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.video-card__media .material-icons:not(.video-card__play) {
  font-size: 2.75rem;
}

.video-card__play {
  position: absolute;
  font-size: 3.5rem !important;
  color: #fff;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  transition: transform 0.15s ease;
}

button.video-card:hover .video-card__play {
  transform: scale(1.08);
}

.video-card--placeholder {
  border-style: dashed;
  cursor: default;
}

.video-card--placeholder:hover {
  border-color: #e5e7eb;
  box-shadow: none;
}

.video-card video,
.video-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0f172a;
}

.video-modal[hidden] {
  display: none !important;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
}

.video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: #fff;
  border-radius: 1rem;
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.video-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.video-modal__close:hover {
  background: #e2e8f0;
}

.video-modal__title {
  margin: 0 2.5rem 0.85rem 0;
  font-size: 1.2rem;
  text-align: left;
  color: #0f172a;
}

.video-modal__body {
  background: #0f172a;
  border-radius: 0.75rem;
  overflow: hidden;
}

.video-modal__player {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  vertical-align: middle;
}

/* Dashboard — screenshot sinistra + testo destra */
#dashboard .section-title-bordeaux {
  margin-bottom: 0.35rem;
}

#dashboard .section-lead {
  margin-bottom: 1.75rem;
  color: #8b1539;
  font-weight: 600;
}

#ecosistema .section-title-bordeaux {
  margin-bottom: 0.35rem;
}

#ecosistema .section-lead {
  margin-bottom: 1.75rem;
  color: #3a4759;
  font-weight: 500;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.eco-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  border-top: 3px solid #e5e7eb;
}

.eco-card p {
  margin: 0;
}

.eco-card__logo {
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 0.35rem;
}

.eco-card__tag {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.eco-card__link {
  margin-top: auto;
  padding-top: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.eco-card--mercuria {
  border-top-color: #0e9aa7;
}

.eco-card--mercuria .eco-card__tag,
.eco-card--mercuria .eco-card__link {
  color: #0e9aa7;
}

.eco-card--claria {
  border-top-color: #2d8a6e;
}

.eco-card--claria .eco-card__tag,
.eco-card--claria .eco-card__link {
  color: #2d8a6e;
}

.eco-card .card-icon,
.eco-card__icon {
  color: #003366;
  font-size: 1.85rem;
  margin-bottom: 0.15rem;
}

.eco-card__title {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
}

.eco-card--local {
  border-top-color: #003366;
  background: linear-gradient(165deg, #f4f8fc 0%, #eef4fa 55%, #e8f0f7 100%);
  border-color: #d7e3ef;
}

.eco-card--local .eco-card__tag,
.eco-card--local .eco-card__icon {
  color: #003366;
}

.eco-card--local p:not(.eco-card__tag) {
  color: #3a4759;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}

.dash-shots {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dash-shots-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8b1539;
  text-transform: none;
}

.dash-frame {
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.4) inset;
}

.dash-frame--main {
  width: 100%;
}

.dash-shots-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.dash-frame--thumb {
  border-radius: 0;
  overflow: visible;
  background: #f8fafc;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-frame--thumb .dash-shot {
  border-radius: 0.85rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.dash-caption {
  margin: 0;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3a4759;
}

.dash-caption strong {
  display: block;
  color: #0f172a;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.dash-shot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  vertical-align: middle;
}

.dash-copy {
  min-height: 0;
  padding: 0.25rem 0;
}

.dash-copy p {
  margin: 0;
  color: #3a4759;
  font-size: 1.05rem;
  line-height: 1.7;
}

@media (min-width: 900px) {
  .dash-split {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.25rem;
    align-items: center;
  }
}

/* AI — chat sinistra + avatar destra */
#ai .section-title-bordeaux {
  margin-bottom: 0.75rem;
}

.ai-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: end;
}

.ai-chat {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 51, 102, 0.08);
}

.ai-chat__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: rgba(139, 21, 57, 0.92);
  color: #fff;
}

.ai-chat__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #001a33;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.ai-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.ai-chat__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.ai-chat__meta strong {
  font-size: 1rem;
}

.ai-chat__meta span {
  font-size: 0.82rem;
  opacity: 0.85;
}

.ai-chat__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 1.1rem;
  min-height: 240px;
  background: #f8fafc;
}

.ai-bubble {
  max-width: 82%;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ai-bubble p {
  margin: 0;
}

.ai-bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1a2332;
  border-bottom-left-radius: 0.25rem;
}

.ai-bubble--user {
  align-self: flex-end;
  background: rgba(139, 21, 57, 0.9);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.ai-chat__foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.ai-chat__input {
  flex: 1;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.92rem;
  background: #f8fafc;
}

.ai-chat__send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #8b1539;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  opacity: 0.85;
}

.ai-chat__send .material-icons {
  font-size: 1.15rem;
}

.ai-portrait {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(160px, 1.1fr);
  align-items: center;
  gap: 0.75rem 1rem;
  background: radial-gradient(circle at 50% 35%, #003366 0%, #001a33 70%);
  border-radius: 1rem;
  padding: 1.25rem 1rem 0 1.1rem;
  min-height: 280px;
  overflow: hidden;
}

.ai-portrait__prompts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding-bottom: 1.25rem;
  z-index: 2;
}

.ai-prompt {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  background: #fff;
  color: #1a2332;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  border-bottom-left-radius: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ai-prompt::before {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 10px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 6px 0;
  border-color: transparent #e5e7eb transparent transparent;
}

.ai-prompt::after {
  content: "";
  position: absolute;
  left: -5px;
  bottom: 11px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 7px 5px 0;
  border-color: transparent #fff transparent transparent;
}

.ai-portrait img {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  justify-self: end;
  align-self: end;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.25));
}

@media (max-width: 899px) {
  .ai-portrait {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 1.1rem 1rem 0;
  }

  .ai-portrait__prompts {
    width: 100%;
    align-items: stretch;
    order: 2;
    padding-bottom: 1.1rem;
  }

  .ai-portrait img {
    order: 1;
    max-width: 280px;
    justify-self: center;
  }
}

@media (min-width: 900px) {
  .ai-split {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
    align-items: stretch;
  }

  .ai-portrait {
    min-height: 100%;
  }

  .ai-portrait img {
    max-width: 360px;
  }

  .ai-chat__body {
    min-height: 280px;
  }
}

.intro-box .intro-lead,
.intro-box p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #3a4759;
  text-align: justify;
  text-justify: inter-word;
  margin: 0 0 1em;
}

.intro-box p:last-child {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 700px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: #0d4f8b;
  box-shadow: 0 4px 12px rgba(13, 79, 139, 0.08);
}

.card p {
  color: #3a4759;
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* CTA / form */
.cta-final {
  background: #0d4f8b;
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
}

.cta-final h2 {
  color: #fff;
}

.cta-final > .container > p {
  color: #dbeafe;
  max-width: 55ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  margin-top: 1.75rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.6rem;
  padding: 1.25rem;
}

.form-row {
  margin-bottom: 0.9rem;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #fff;
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.4rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: #0f172a;
  background: #fff;
}

.form-row input:focus-visible,
.form-row textarea:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 1px;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.contact-form .btn {
  width: 100%;
  margin-top: 0.35rem;
}

.form-status {
  margin: 0.85rem 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.form-status.is-ok {
  color: #bbf7d0;
}

.form-status.is-err {
  color: #fecaca;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 2.5rem 0 1rem;
}

.site-footer a {
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.legal {
  text-align: center;
  border-top: 1px solid #1e293b;
  margin-top: 1.5rem;
  padding-top: 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ——— Mobile: no overflow + layout semplificato ——— */
html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

@media (max-width: 899px) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .site-header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .header-inner {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.65rem;
  }

  .sticky-wave {
    top: 64px;
  }

  .sticky-wave svg {
    height: 40px;
  }

  .hero {
    padding: 1.75rem 0 4.5rem;
    overflow: hidden;
  }

  .hero-constellation {
    opacity: 0.35;
  }

  .hero-grid {
    min-height: 0;
    gap: 1rem;
    align-items: start;
  }

  .hero-left {
    max-width: none;
    padding-top: 0.75rem;
    padding-bottom: 0;
  }

  .hero-panel {
    padding: 1.25rem 1.2rem;
    border-radius: 0.9rem;
  }

  .hero-panel h1 {
    max-width: none;
    font-size: clamp(1.38rem, 6.2vw, 1.7rem);
  }

  .hero-panel p {
    font-size: 0.98rem;
  }

  .btn-demo {
    width: 100%;
    min-height: 48px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-video {
    width: 100%;
    min-height: 48px;
  }

  /* Avatar ridotto e non invasivo sotto il CTA */
  .hero-avatar {
    margin-bottom: -2.5rem;
    justify-content: center;
  }

  .hero-avatar img {
    width: min(150px, 42vw);
    opacity: 0.92;
  }

  .section {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  .intro-box {
    padding: 1.4rem 1.25rem 1.5rem;
    border-radius: 0.9rem;
  }

  .card-grid {
    gap: 0.85rem;
  }

  .card {
    padding: 1.1rem;
  }

  /* Dashboard: thumbs in colonna leggibile */
  .dash-shots-row {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .dash-frame--thumb {
    max-width: 420px;
    width: 100%;
    margin-inline: auto;
  }

  .dash-caption {
    font-size: 0.9rem;
  }

  .dash-copy p {
    font-size: 1rem;
    line-height: 1.65;
  }

  /* AI: chat full-width, portrait più compatto */
  .ai-split {
    gap: 1.15rem;
  }

  .ai-chat__body {
    min-height: 0;
  }

  .ai-bubble {
    max-width: 92%;
    font-size: 0.92rem;
  }

  .ai-portrait {
    min-height: 0;
    padding: 1rem 0.9rem 0;
    gap: 0.85rem;
  }

  .ai-portrait img {
    max-width: 200px;
  }

  .ai-prompt {
    font-size: 0.88rem;
  }

  .cta-final {
    padding: 2.75rem 0;
  }

  .contact-form {
    padding: 1.1rem;
  }

  .form-row input,
  .form-row textarea {
    font-size: 16px; /* evita zoom iOS */
    min-height: 48px;
  }

  .form-row textarea {
    min-height: 120px;
  }

  .contact-form .btn {
    min-height: 48px;
  }

  .site-footer {
    padding: 2rem 0 calc(1rem + env(safe-area-inset-bottom));
  }

  .footer-grid {
    gap: 1.25rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 520px) {
  .header-actions {
    gap: 0.4rem;
  }

  .btn-header {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
    min-height: 40px;
  }

  .hero {
    padding: 1.35rem 0 3.75rem;
  }

  /* Su schermi stretti: priorità al messaggio, avatar discreto */
  .hero-avatar {
    margin-bottom: -1.75rem;
  }

  .hero-avatar img {
    width: min(120px, 38vw);
  }

  .hero-constellation,
  .hero::before {
    opacity: 0.22;
  }

  .hero-panel {
    padding: 1.1rem 1rem;
  }

  .feat-item {
    padding: 1.05rem 1rem;
    gap: 0.7rem 0.8rem;
  }

  .feat-item h3 {
    font-size: 0.98rem;
  }

  /* Portrait AI: solo prompts, senza cutout pieno */
  .ai-portrait {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    min-height: 0;
  }

  .ai-portrait img {
    display: none;
  }

  .ai-portrait__prompts {
    order: 0;
    padding-bottom: 0;
  }

  .ai-prompt {
    border-bottom-left-radius: 0.75rem;
  }

  .ai-prompt::before,
  .ai-prompt::after {
    display: none;
  }
}
