:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #27283c;
  --muted: #5e6070;
  --primary: #62929e;
  --primary-dark: #4f7680;
  --line: #e7eaee;
  --ok: #62929e;
  --error: #9d0208;
}

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

html {
  scroll-behavior: smooth;
}

#soluzioni,
#integrazione {
  scroll-margin-top: 120px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.narrow {
  width: min(860px, calc(100% - 2rem));
}

.section-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 42%);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.section-media--reverse .section-figure {
  order: -1;
}

.section-media__content {
  max-width: 56ch;
}

.section-media__content--wide {
  max-width: none;
}

.section-figure {
  margin: 0;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(39, 40, 60, 0.1);
  background: var(--surface);
  border: 1px solid var(--line);
}

.section-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(39, 40, 60, 0.08) 0%,
    rgba(98, 146, 158, 0.12) 100%
  );
}

.section-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}

.section {
  padding: 5.5rem 0;
  background: #fdfdff;
}

.section--alt {
  background: #e7eaee;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 64px;
  width: auto;
  max-width: min(56vw, 360px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.nav a.btn {
  color: #fff;
}

.hero {
  padding-top: 6.5rem;
  padding-bottom: 6.5rem;
  background: linear-gradient(160deg, #f8f9fa 0%, #edf1f4 100%);
}

.section--hero-bg {
  background: linear-gradient(160deg, #f8f9fa 0%, #edf1f4 100%);
}

.hero h1 {
  position: relative;
  padding-bottom: 0.8rem;
}

.hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0.9;
}

.hero-animate .hero .container > h1,
.hero-animate .hero .container > .lead,
.hero-animate .hero .container > .btn {
  opacity: 0;
  transform: translateY(12px);
}

.hero-animate.hero-ready .hero .container > h1 {
  animation: hero-fade-up 0.48s ease forwards;
}

.hero-animate.hero-ready .hero h1::after {
  animation: hero-line-in 0.72s ease forwards;
  animation-delay: 0.25s;
}

.hero-animate.hero-ready .hero .container > .lead {
  animation: hero-fade-up 0.48s ease forwards;
  animation-delay: 0.16s;
}

.hero-animate.hero-ready .hero .container > .btn {
  animation: hero-fade-up 0.48s ease forwards, hero-cta-pulse 0.55s ease;
  animation-delay: 0.28s, 1.55s;
}

@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-line-in {
  from {
    transform: scaleX(0);
    opacity: 0.2;
  }
  to {
    transform: scaleX(1);
    opacity: 0.9;
  }
}

@keyframes hero-cta-pulse {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(0) scale(1.03);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.kicker {
  margin: 0 0 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 0.8rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  max-width: 16ch;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-top: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.lead {
  font-size: 1.2rem;
  max-width: 70ch;
  margin-bottom: 1.75rem;
}

.btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: var(--primary);
  color: #fff;
  padding: 0.82rem 1.25rem;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(76, 92, 104, 0.26);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(63, 76, 86, 0.3);
}

.btn--small {
  padding: 0.55rem 0.9rem;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: #27283c;
  box-shadow: none;
}

.btn--ghost:hover {
  background: #ececef;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border-radius: 0.9rem;
  border: 1px solid rgba(98, 146, 158, 0.34);
  padding: 1.15rem;
  box-shadow: 0 8px 24px rgba(15, 30, 50, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

#soluzioni {
  background: #27283c;
}

#soluzioni h2 {
  color: #ffffff;
}

#soluzioni .card {
  background: #ffffff;
  border: 1px solid #ffffff;
}

#soluzioni .card h3,
#soluzioni .card p {
  color: #27283c;
}

#soluzioni .card h3 {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card p {
  font-size: 1.03rem;
}

.card:hover {
  transform: translateY(-6px) scale(1.025);
  box-shadow: 0 18px 34px rgba(15, 30, 50, 0.14);
  z-index: 2;
}

.grid:hover .card {
  opacity: 0.84;
  transform: scale(0.985);
}

.grid:hover .card:hover {
  opacity: 1;
  transform: translateY(-6px) scale(1.025);
}

.checklist {
  margin: 1.2rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.logo-carousel {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  padding: 0.65rem;
}

.logos .container {
  display: grid;
  gap: 1.4rem;
}

.logos h2,
.logos p {
  margin: 0;
}

.logo-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: logo-scroll 28s linear infinite;
  will-change: transform;
}

.logo-track__set {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.logo-item {
  flex: 0 0 220px;
  width: 220px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-logo {
  display: block;
  max-width: 82%;
  max-height: 82%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter 0.25s ease;
}

.logo-item:hover .client-logo,
.logo-item:focus-within .client-logo {
  filter: grayscale(0);
}

.client-logo--jaked {
  max-width: 56%;
  max-height: 56%;
}

.client-logo--paigem {
  max-width: 68%;
  max-height: 68%;
}

@keyframes logo-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.form {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid rgba(98, 146, 158, 0.4);
  border-radius: 1rem;
  padding: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.96rem;
}

.required {
  color: var(--error);
  font-weight: 700;
}

.label-title {
  display: inline-block;
}

input,
textarea,
select {
  border: 1px solid #c8d2de;
  border-radius: 0.5rem;
  padding: 0.78rem 0.8rem;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #62929e;
  box-shadow: 0 0 0 3px rgba(98, 146, 158, 0.22);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(166, 20, 34, 0.12);
}

textarea {
  resize: vertical;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-weight: 500;
}

.consent.is-invalid {
  outline: 2px solid rgba(166, 20, 34, 0.22);
  border-radius: 0.45rem;
  padding: 0.3rem 0.35rem;
}

.consent input {
  margin-top: 0.2rem;
}

.consent a {
  color: var(--primary);
}

.section p a {
  color: var(--primary);
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.form-actions small {
  color: var(--muted);
  font-size: 0.98rem;
}

.form-feedback {
  min-height: 1.2rem;
  margin-top: 0.65rem;
  font-weight: 600;
}

.form-feedback.is-success {
  color: var(--ok);
}

.form-feedback.is-error {
  color: var(--error);
}

.footer {
  border-top: 2px solid #62929e;
  background: #27283c;
  color: #f1f4f8;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 1rem 0;
}

.footer p {
  margin: 0;
  color: #d7e3e8;
}

.footer strong {
  color: #f3f8fb;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(168, 198, 207, 0.45);
  color: #a8c6cf;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-social a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-social a:hover {
  color: #d2e6ed;
  border-color: #62929e;
  background: rgba(98, 146, 158, 0.16);
}

.footer a {
  color: #a8c6cf;
  text-decoration: none;
}

.footer a:hover {
  color: #d2e6ed;
}

.menu-toggle {
  display: none;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner__inner {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 18px 30px rgba(15, 30, 50, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.95rem;
}

.cookie-banner a {
  color: var(--primary);
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .section-media,
  .section-media--reverse {
    grid-template-columns: 1fr;
  }

  .section-media--reverse .section-figure {
    order: 0;
  }

  .section-figure {
    max-width: min(100%, 520px);
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .topbar__inner {
    min-height: 74px;
  }

  .brand img {
    height: 50px;
  }

  .menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0;
  }

  .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 1rem;
    right: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    padding: 0.8rem;
    box-shadow: 0 16px 28px rgba(15, 30, 50, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid rgba(25, 133, 161, 0.18);
  }

  .nav a.btn {
    width: 100%;
    border-bottom: 0;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 4.25rem 0;
  }

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

  .logo-item {
    flex: 0 0 180px;
    width: 180px;
    height: 75px;
  }
}

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

  .logo-track,
  .reveal,
  .btn,
  .card,
  .hero h1::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-animate .hero .container > h1,
  .hero-animate .hero .container > .lead,
  .hero-animate .hero .container > .btn {
    opacity: 1 !important;
    transform: none !important;
  }
}
