@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/outfit-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/assets/fonts/outfit-variable-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF;
}

/*
  Sistema di design
  - Tema: dark unico su tutta la pagina
  - Accento: uno solo, blu brand -> ciano del logo
  - Raggi: card 20px, elementi interattivi (bottoni, input, pill) full-pill
*/
:root {
  --bg: #04061c;
  --bg-raise: #090e2c;
  --card: #0b1133;
  --accent: #2e7cf6;
  --accent-2: #56c8f2;
  --ink: #f2f6ff;
  --body: #b9c4dd;
  --muted: #8b96b4;
  --line: rgba(151, 171, 221, 0.14);
  --line-strong: rgba(151, 171, 221, 0.24);
  --radius-card: 20px;
  --grad-accent: linear-gradient(100deg, var(--accent), var(--accent-2));
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
video {
  max-width: 100%;
}

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

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Sfondo grafico a strati ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 75% 8%, rgba(46, 124, 246, 0.22), transparent 65%),
    radial-gradient(ellipse 40% 35% at 8% 20%, rgba(86, 200, 242, 0.12), transparent 65%),
    radial-gradient(ellipse 50% 40% at 55% 95%, rgba(46, 124, 246, 0.10), transparent 65%);
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140, 170, 240, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 170, 240, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(4, 6, 28, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}

.logo-image {
  height: 36px;
  width: auto;
  display: block;
}

.logo-suffix {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-bottom: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--body);
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

/* ---------- Bottoni (full-pill) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--grad-accent);
  color: #041028;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(46, 124, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(46, 124, 246, 0.45);
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--accent-2);
  background: rgba(86, 200, 242, 0.08);
}

.btn .ti {
  font-size: 1.05em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(86, 200, 242, 0.35);
  background: rgba(86, 200, 242, 0.08);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 1.75rem;
}

.hero h1 {
  font-size: clamp(3rem, 6.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}

.hero h1 .accent {
  color: var(--accent-2);
}

.hero p.lead {
  font-size: 1.12rem;
  font-weight: 350;
  line-height: 1.6;
  color: var(--body);
  max-width: 32rem;
  margin-bottom: 2.5rem;
}

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

/* ---------- Card assistente ---------- */
.assistant-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 1800px;
}

.assistant-wrap::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  background:
    radial-gradient(circle at 62% 22%, rgba(46, 124, 246, 0.4), transparent 55%),
    radial-gradient(circle at 30% 85%, rgba(86, 200, 242, 0.22), transparent 55%);
  filter: blur(44px);
  z-index: 0;
  pointer-events: none;
}

.assistant-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(19, 27, 65, 0.9), rgba(9, 14, 44, 0.95));
  border: 1px solid rgba(160, 190, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 40px 90px rgba(2, 4, 20, 0.7),
    0 0 70px rgba(46, 124, 246, 0.14);
  overflow: hidden;
  transform: rotateY(-7deg) rotateX(3deg);
  transform-style: preserve-3d;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 6, 28, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.assistant-header .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.assistant-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--body);
}

.assistant-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc85;
  box-shadow: 0 0 8px rgba(61, 220, 133, 0.7);
}

.assistant-avatar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 330px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 55% at 50% 0%, rgba(86, 200, 242, 0.22), transparent 70%),
    linear-gradient(180deg, transparent 0%, rgba(11, 17, 51, 0.9) 94%);
}

.assistant-avatar::after {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 50%;
  width: 180px;
  height: 26px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 72%);
  filter: blur(3px);
}

.avatar-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 380px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.5));
}

.avatar-video {
  width: 100%;
  height: 118%;
  /* object-fit: cover;
  object-position: 50% 12%; */
  background: transparent;
  pointer-events: none;
}

.assistant-message {
  position: relative;
  z-index: 2;
  margin: -1.6rem 1.3rem 1.1rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-card);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--body);
}

.assistant-message .ti {
  color: var(--accent-2);
  font-size: 1.1rem;
  margin-top: 2px;
}

.assistant-input {
  margin: 0 1.3rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1.15rem;
  transition: border-color 0.2s ease;
}

.assistant-input:focus-within {
  border-color: var(--accent-2);
}

.assistant-input input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
}

.assistant-input input::placeholder {
  color: var(--muted);
}

.send-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #041028;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
}

.send-btn:active {
  transform: scale(0.95);
}

.assistant-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 1.3rem 1.2rem;
}

/* ---------- Strip settori ---------- */
.sectors {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 44, 0.35);
  padding: 2.25rem 0;
}

.sectors-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.sectors-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 12rem;
  line-height: 1.5;
}

.sectors-list {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.sector-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sector-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent-2);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sector-item:hover .sector-icon {
  transform: translateY(-3px);
  border-color: var(--accent-2);
  background: rgba(86, 200, 242, 0.1);
}

.sector-item span {
  color: var(--body);
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Sezioni ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 0;
}

.section-head {
  max-width: 44rem;
  margin-bottom: 3.5rem;
}

.section-head .eyebrow {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-weight: 700;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.section-head p {
  color: var(--body);
  font-size: 1.05rem;
  font-weight: 350;
  line-height: 1.65;
  max-width: 38rem;
  text-wrap: pretty;
}

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.4rem;
}

.bento-cell {
  position: relative;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  padding: 2.2rem;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.bento-cell:hover {
  border-color: rgba(86, 200, 242, 0.4);
  transform: translateY(-4px);
}

.bento-cell h3 {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
}

.bento-cell>p {
  color: var(--body);
  font-size: 0.96rem;
  font-weight: 350;
  line-height: 1.6;
  max-width: 30rem;
}

.bento-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 1.4rem;
}

.bento-main {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(46, 124, 246, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.025);
}

.chat-demo {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.chat-demo .bubble {
  max-width: 85%;
  padding: 0.8rem 1.05rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.bubble-user {
  align-self: flex-end;
  background: var(--grad-accent);
  color: #041028;
  font-weight: 500;
  border-radius: 18px 18px 4px 18px;
}

.bubble-aika {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--body);
  border-radius: 18px 18px 18px 4px;
}

.bento-tinted {
  background:
    radial-gradient(ellipse 100% 90% at 0% 100%, rgba(86, 200, 242, 0.13), transparent 65%),
    rgba(255, 255, 255, 0.025);
}

.bento-tinted .watermark {
  position: absolute;
  right: -18px;
  bottom: -24px;
  font-size: 7.5rem;
  line-height: 1;
  color: rgba(86, 200, 242, 0.1);
  pointer-events: none;
}

.bento-pattern {
  background-image:
    radial-gradient(rgba(140, 170, 240, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  background-color: rgba(255, 255, 255, 0.02);
}

/* ---------- Partner ---------- */
.partners-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.partners-head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.partners-head .muted {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
  margin-bottom: 0.2rem;
}

.trust-divider {
  height: 1px;
  background: var(--line-strong);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000, transparent);
  mask-image: linear-gradient(90deg, transparent, #000, transparent);
  max-width: 40rem;
  margin: 2.25rem auto;
}

.trust-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0.5rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.trust-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 4rem;
  will-change: transform;
}

.trust-marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.trust-marquee-track span:hover {
  opacity: 1;
  color: var(--ink);
}

.trust-marquee-track span svg,
.trust-marquee-track span img {
  flex-shrink: 0;
  pointer-events: none;
}

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 4rem;
  align-items: start;
}

.contact-intro h2 {
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.1rem;
}

.contact-intro p {
  color: var(--body);
  font-size: 1.05rem;
  font-weight: 350;
  line-height: 1.65;
  max-width: 26rem;
  margin-bottom: 2rem;
}

.contact-channels {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-channels a {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--body);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.contact-channels a:hover {
  color: var(--accent-2);
}

.contact-channels .ti {
  color: var(--accent-2);
  font-size: 1.1rem;
}

.contact-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(46, 124, 246, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.03);
  padding: 2.5rem;
}

.contact-form {
  display: grid;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--body);
}

.form-group label .optional {
  color: var(--muted);
  font-weight: 400;
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group textarea {
  border-radius: var(--radius-card);
  resize: vertical;
  min-height: 120px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Checkbox custom ---------- */
.form-checks {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0.15rem 0;
}

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

/* Input nativo nascosto ma focusabile e accessibile */
.check input {
  position: absolute;
  width: 22px;
  height: 22px;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.check-box {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.check:hover .check-box {
  border-color: var(--accent-2);
}

.check input:checked+.check-box {
  background: var(--grad-accent);
  border-color: transparent;
  color: #041028;
}

.check input:focus-visible+.check-box {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.check-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--body);
}

.check-text a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.check-text a:hover {
  color: var(--ink);
}

.form-actions {
  margin-top: 0.4rem;
}

.form-error {
  display: none;
  margin-top: 0.9rem;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
  font-size: 0.88rem;
  line-height: 1.5;
}

.form-error.visible {
  display: block;
}

.form-actions .btn {
  width: 100%;
  justify-content: center;
  border: none;
  font-size: 0.98rem;
  padding: 0.85rem 2rem;
}

/* ---------- Demo chat ---------- */
.demo-head {
  max-width: 44rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.demo-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  font-weight: 700;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.demo-head p {
  color: var(--body);
  font-size: 1.05rem;
  font-weight: 350;
  line-height: 1.65;
  text-wrap: pretty;
}

.chat-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(19, 27, 65, 0.9), rgba(9, 14, 44, 0.95));
  border: 1px solid rgba(160, 190, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 40px 90px rgba(2, 4, 20, 0.7),
    0 0 70px rgba(46, 124, 246, 0.14);
  overflow: hidden;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: min(56vh, 460px);
  overflow-y: auto;
  padding: 1.4rem 1.3rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.8rem 1.05rem;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.chat-bubble.from-user {
  align-self: flex-end;
  background: var(--grad-accent);
  color: #041028;
  font-weight: 500;
  border-radius: 18px 18px 4px 18px;
}

.chat-bubble.from-aika {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--body);
  border-radius: 18px 18px 18px 4px;
}

.chat-bubble.error {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fda4af;
}

/* Indicatore "sta scrivendo" */
.chat-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.85rem 1.05rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px 18px 18px 4px;
}

.chat-typing .t-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.5;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0 1.3rem 1rem;
}

.chat-suggestion {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--body);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chat-suggestion:hover {
  border-color: var(--accent-2);
  color: var(--ink);
  background: rgba(86, 200, 242, 0.08);
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ---------- Loading bar ---------- */
.loader-card {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(46, 124, 246, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.03);
  padding: 2rem 2.2rem;
}

.loader-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.loader-label {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.loader-value {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.loader-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad-accent);
  box-shadow: 0 0 14px rgba(86, 200, 242, 0.45);
}

/* Indeterminato senza animazioni: barra piena attenuata */
.loader-track.indeterminate .loader-fill {
  width: 100%;
  opacity: 0.45;
}

.loader-hint {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  font-weight: 350;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Timer demo ---------- */
.demo-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--body);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.demo-timer .ti {
  color: var(--accent-2);
  font-size: 0.9rem;
}

.demo-timer.ending {
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.4);
}

.demo-timer.ending .ti {
  color: #fda4af;
}

/* ---------- Questionario (popup) ---------- */
.survey-dialog {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(86vh, 720px);
  overflow-y: auto;
  margin: auto;
  border: 1px solid rgba(160, 190, 255, 0.16);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(19, 27, 65, 0.98), rgba(9, 14, 44, 0.99));
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 40px 90px rgba(2, 4, 20, 0.8);
  padding: 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.survey-dialog::backdrop {
  background: rgba(2, 4, 20, 0.65);
  backdrop-filter: blur(5px);
}

.survey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.survey-head h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.survey-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--body);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.survey-close:hover {
  border-color: var(--accent-2);
  color: var(--ink);
}

.survey-sub {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.survey-form {
  display: grid;
  gap: 1.4rem;
  counter-reset: survey-q;
}

.survey-field {
  border: none;
  display: grid;
  gap: 0.75rem;
}

.survey-field legend {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--body);
  margin-bottom: 0.75rem;
}

.survey-field legend::before {
  counter-increment: survey-q;
  content: counter(survey-q) ". ";
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.survey-field legend label {
  cursor: pointer;
}

.survey-field legend .optional {
  color: var(--muted);
  font-weight: 400;
}

.rating-row,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Opzioni lunghe: una per riga, larghezza adattata al testo */
.choice-row.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

/* Scala 0-10 (raccomandazione): pillole più compatte */
.rating-row.nps {
  gap: 0.35rem;
}

.rating-row.nps .rating-pill span {
  width: 38px;
  height: 38px;
  font-size: 0.85rem;
}

.rating-pill,
.choice-pill {
  position: relative;
  cursor: pointer;
}

.rating-pill input,
.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.rating-pill span,
.choice-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rating-pill span {
  width: 44px;
  height: 44px;
}

.choice-pill span {
  padding: 0.55rem 1.2rem;
}

.rating-pill:hover span,
.choice-pill:hover span {
  border-color: var(--accent-2);
}

.rating-pill input:checked+span,
.choice-pill input:checked+span {
  background: var(--grad-accent);
  border-color: transparent;
  color: #041028;
  font-weight: 700;
}

.rating-pill input:focus-visible+span,
.choice-pill input:focus-visible+span {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.rating-ends {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 260px;
}

.rating-ends.wide {
  max-width: 100%;
}

.survey-form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.survey-form textarea::placeholder {
  color: var(--muted);
}

.survey-form textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.06);
}

.survey-submit {
  width: 100%;
  justify-content: center;
  border: none;
}

.survey-thanks[hidden] {
  display: none;
}

.survey-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem 0 1rem;
  color: var(--body);
}

.survey-thanks .ti {
  font-size: 2.4rem;
  color: var(--accent-2);
}

@media (max-width: 640px) {
  .survey-dialog {
    padding: 1.25rem;
  }

  .rating-pill span {
    width: 40px;
    height: 40px;
  }

  .rating-row.nps .rating-pill span {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-row .logo-image {
  height: 30px;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Motion ----------
   Easing unico: cubic-bezier(0.16, 1, 0.3, 1) (ease-out expo).
   Tutto disattivato sotto prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
  }

  @keyframes cardIn {
    from {
      opacity: 0;
      transform: rotateY(-7deg) rotateX(3deg) translateY(36px) scale(0.96);
    }

    to {
      opacity: 1;
      transform: rotateY(-7deg) rotateX(3deg) translateY(0) scale(1);
    }
  }

  .hero-copy .badge {
    animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
  }

  .hero-copy h1 {
    animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
  }

  .hero-copy .lead {
    animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
  }

  .hero-copy .hero-actions {
    animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
  }

  .assistant-card {
    animation: cardIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
  }

  .assistant-message {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.85s both;
  }

  /* Reveal on scroll: la classe .js-reveal viene aggiunta SOLO via JS,
     quindi senza JS (o con reduced motion) tutto resta visibile. */
  .js-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--reveal-i, 0) * 90ms);
  }

  .js-reveal.in {
    opacity: 1;
    transform: none;
  }

  header {
    transition: box-shadow 0.3s ease;
  }

  header.scrolled {
    box-shadow: 0 12px 40px rgba(2, 4, 18, 0.55);
  }

  .btn .ti-arrow-right {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .btn:hover .ti-arrow-right {
    transform: translateX(3px);
  }

  @keyframes typingDot {

    0%,
    60%,
    100% {
      opacity: 0.35;
      transform: translateY(0);
    }

    30% {
      opacity: 1;
      transform: translateY(-3px);
    }
  }

  .chat-typing .t-dot {
    animation: typingDot 1.2s ease-in-out infinite;
  }

  .chat-typing .t-dot:nth-child(2) {
    animation-delay: 0.15s;
  }

  .chat-typing .t-dot:nth-child(3) {
    animation-delay: 0.3s;
  }

  .chat-bubble {
    animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .loader-fill {
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes loaderSlide {
    from {
      transform: translateX(-110%);
    }

    to {
      transform: translateX(280%);
    }
  }

  .loader-track.indeterminate .loader-fill {
    width: 38%;
    opacity: 1;
    animation: loaderSlide 1.3s ease-in-out infinite;
  }

  @keyframes dialogIn {
    from {
      opacity: 0;
      transform: translateY(16px) scale(0.97);
    }
  }

  .survey-dialog[open] {
    animation: dialogIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    padding: 3rem 0 4rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .nav-links {
    display: none;
  }

  .bento {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .bento-main {
    grid-row: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .sectors-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .sectors-list {
    gap: 1.25rem 1.75rem;
  }

  .contact-card {
    padding: 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }

  .chat-thread {
    height: min(62vh, 480px);
    padding: 1.1rem 1rem;
  }

  /* 16px: evita lo zoom automatico di iOS al focus */
  .assistant-input input {
    font-size: 1rem;
  }
}

/* ---------- Banner gestione cookie ---------- */
.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  padding: 1rem;
  background: rgba(4, 6, 28, 0.72);
  backdrop-filter: blur(6px);
}

.cookie-banner-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.cookie-banner-text strong {
  color: var(--ink);
  font-size: 1rem;
}

.cookie-banner-text p {
  margin: 0.4rem 0 0;
  color: var(--body);
  font-size: 0.88rem;
  line-height: 1.55;
}

.cookie-banner-text a {
  color: var(--accent-2);
  text-decoration: underline;
}

.cookie-prefs {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cookie-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.cookie-pref small {
  color: var(--muted);
}

.cookie-pref input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.cookie-banner-actions {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* "Accetta tutti" e "Rifiuta tutti" con pari evidenza (linee guida Garante) */
.cookie-btn-secondary {
  border: 1px solid var(--line-strong);
  color: var(--body);
  background: transparent;
}

.cookie-btn-secondary:hover {
  border-color: var(--accent-2);
  color: var(--ink);
}

@media (max-width: 640px) {
  .cookie-banner {
    padding: 0.5rem;
  }

  .cookie-banner-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---------- Pagina cookie policy ---------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 7rem 1.25rem 4rem;
  color: var(--body);
  line-height: 1.65;
}

.legal-page h1 {
  color: var(--ink);
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.legal-page h2 {
  color: var(--ink);
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
}

.legal-page p,
.legal-page li {
  font-size: 0.95rem;
}

.legal-page a {
  color: var(--accent-2);
  text-decoration: underline;
}

.legal-page table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.legal-page th,
.legal-page td {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-page th {
  color: var(--ink);
  background: var(--bg-raise);
}

.legal-updated {
  color: var(--muted);
  font-size: 0.85rem;
}
