:root {
  --green-900: #1f4d3f;
  --green-700: #2f6f5c;
  --green-100: #e6f1ec;
  --sand-100: #f6efe3;
  --sand-200: #ebdfca;
  --sky-100: #e8f3f8;
  --text-900: #1f2a2d;
  --text-700: #516168;
  --white: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 18px 50px rgba(20, 42, 35, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text-900);
  background: linear-gradient(180deg, #f9fbfa 0%, #f7f4ed 100%);
  line-height: 1.6;
}

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

a {
  color: inherit;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 88vh;
  color: var(--white);
  overflow: hidden;
  z-index: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/hero-mountains.jpeg") center / cover no-repeat;
  transform: scale(1.04);
  animation: heroDrift 22s ease-in-out infinite alternate;
  z-index: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 28, 23, 0.5) 0%,
    rgba(8, 28, 23, 0.68) 100%
  );
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
  position: relative;
  z-index: 2;
}

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

.brand-logo {
  width: clamp(120px, 16vw, 170px);
  height: auto;
  object-fit: contain;
}

.nav-link {
  text-decoration: none;
  font-weight: 500;
  opacity: 0.95;
}

.hero-content {
  padding: 3.5rem 0 6rem;
  max-width: 740px;
  transition: transform 220ms ease-out;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-weight: 600;
  margin-bottom: 1.1rem;
  color: #d9efe7;
}

h1,
h2,
h3 {
  margin: 0 0 1rem;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.9rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.6rem);
  letter-spacing: -0.02em;
}

.lead {
  max-width: 640px;
  color: #e5f2ec;
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 2rem;
}

.section {
  padding: clamp(4rem, 7vw, 7rem) 0;
}

.section-tag {
  color: var(--green-700);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}

.section p {
  color: var(--text-700);
  max-width: 760px;
}

.section-soluzione {
  background: linear-gradient(180deg, var(--sky-100) 0%, #f5fbff 100%);
}

.soluzione-grid {
  display: grid;
  gap: 2.4rem;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

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

.feature-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(47, 111, 92, 0.12);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1.2rem;
}

.feature-card h3 {
  color: var(--green-900);
  font-size: 1rem;
  margin-bottom: 0.45rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.94rem;
}

.mockup-wrap {
  background: linear-gradient(180deg, #f8f4ec 0%, #f1e7d7 100%);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: var(--shadow-soft);
  animation: floatSoft 6.5s ease-in-out infinite;
}

.mockup-wrap img {
  transition: transform 260ms ease, filter 260ms ease;
}

.mockup-wrap:hover img {
  transform: translateY(-4px) scale(1.01);
  filter: saturate(1.06);
}

.section-visione {
  text-align: center;
}

.section-visione p {
  margin-inline: auto;
}

.section-collabora {
  background: linear-gradient(180deg, var(--sand-100) 0%, var(--sand-200) 100%);
}

.collabora-box {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}

.section-cta .cta-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(47, 111, 92, 0.12);
}

.policy-date {
  margin: -0.2rem 0 1.4rem;
  color: var(--text-700);
  font-size: 0.98rem;
}

.policy-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3.2vw, 2.6rem);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(47, 111, 92, 0.12);
}

.policy-card p {
  max-width: none;
}

.policy-list {
  margin: 1.2rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-700);
}

.policy-list > li {
  margin: 0 0 1.2rem;
}

.policy-list h3 {
  margin: 0 0 0.45rem;
  color: var(--green-900);
  font-size: 1.05rem;
}

.policy-list ul {
  margin: 0.7rem 0 0.9rem 1.1rem;
  padding-left: 1rem;
  color: var(--text-700);
}

.policy-card a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.policy-card a:hover {
  opacity: 0.9;
}

.privacy-dialog {
  width: min(920px, 92vw);
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: var(--shadow-soft);
}

.privacy-dialog::backdrop {
  background: rgba(8, 28, 23, 0.65);
  backdrop-filter: blur(2px);
}

.privacy-dialog-inner {
  background: linear-gradient(180deg, #f9fbfa 0%, #f4f7f5 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(47, 111, 92, 0.16);
  padding: clamp(1.4rem, 3.2vw, 2.2rem);
  max-height: min(78vh, 760px);
  overflow: auto;
}

.privacy-dialog-topbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
}

.privacy-close {
  border: 1px solid rgba(47, 111, 92, 0.22);
  background: rgba(255, 255, 255, 0.85);
  color: var(--green-900);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.privacy-close:hover {
  opacity: 0.95;
}

.email-form {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.email-form input {
  flex: 1;
  min-width: 220px;
  border-radius: 12px;
  border: 1px solid #c7d7cf;
  padding: 0.9rem 1rem;
  font: inherit;
  outline: none;
}

.email-form input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(47, 111, 92, 0.12);
}

.form-note {
  margin: 0.85rem 0 0;
  color: var(--text-700);
  font-size: 0.95rem;
}

.form-note.is-success {
  color: var(--green-700);
}

.form-note.is-error {
  color: #b42318;
}

.form-note.is-info {
  color: var(--text-700);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 0.86rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

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

.btn-primary {
  color: var(--white);
  background: linear-gradient(180deg, var(--green-700) 0%, var(--green-900) 100%);
  box-shadow: 0 10px 24px rgba(31, 77, 63, 0.3);
  animation: pulseSoft 3.2s ease-in-out infinite;
}

.hero .btn-primary {
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: pulseSoftHero 3.2s ease-in-out infinite;
}

.btn-secondary {
  color: var(--green-900);
  background: var(--white);
}

.footer {
  background: #16372f;
  color: #dcece4;
}

.footer-content {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  font-size: 0.94rem;
}

.footer a {
  text-decoration: none;
}

.footer .footer-link {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.footer .footer-link:hover {
  opacity: 0.9;
}

.fade-in {
  animation: fadeInUp 750ms ease both;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 650ms ease, transform 650ms ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-12px, -8px, 0);
  }
}

@keyframes floatSoft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulseSoft {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(31, 77, 63, 0.28);
  }
  50% {
    box-shadow: 0 16px 30px rgba(31, 77, 63, 0.38);
  }
}

@keyframes pulseSoftHero {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .mockup-wrap,
  .btn-primary,
  .hero .btn-primary {
    animation: none;
  }

  .hero-content,
  .reveal,
  .mockup-wrap img {
    transition: none;
  }
}

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

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

  .collabora-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 80vh;
  }

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

  .email-form {
    flex-direction: column;
  }

  .email-form .btn {
    width: 100%;
  }
}
