/* IOCIVIVO — landing statica (porting da Framer) */

:root {
  --navy: #1f3f5c;
  --navy-70: rgba(31, 63, 92, 0.72);
  --navy-55: rgba(31, 63, 92, 0.55);
  --ink: #0b0d10;
  --text: #2b3440;
  --bg: #f4f5f6;
  --bg-soft: #f9fafb;
  --surface: #ffffff;
  --border: #eaedf0;
  --blue: #0099ff;
  --blue-hover: #0082fb;
  --logo: #4060b3;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --container: 1280px;
  --gutter: 16px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  height: 72px;
}

.logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--logo);
  text-decoration: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: var(--blue-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Hero ---------- */

.hero-wrap {
  position: relative;
  background: var(--bg) url("img/hero-bg.jpg") center / cover no-repeat;
}

.hero {
  display: grid;
  gap: 48px;
  align-items: center;
  padding-block: 64px 80px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  color: var(--navy);
}

.hero-lead {
  max-width: 520px;
  margin-top: 24px;
  font-size: 18px;
  color: var(--navy-70);
}

.hero .btn {
  margin-top: 32px;
}

.hero-media img {
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
}

/* ---------- Sections ---------- */

.section {
  padding-block: 80px;
}

.section-title {
  text-align: center;
  font-size: clamp(32px, 4.4vw, 56px);
  margin-bottom: 56px;
}

.split-list {
  display: grid;
  gap: 32px;
}

.split {
  display: grid;
  gap: 32px;
  align-items: center;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.split-media img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow: inset 0 -2px 0 rgba(16, 24, 40, 0.03);
  color: var(--navy);
  font-size: 28px;
}

.icon-tile--sm {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  font-size: 22px;
}

.split h3 {
  margin-top: 28px;
  font-size: clamp(28px, 3vw, 40px);
}

.split p,
.split li {
  color: var(--text);
}

.split-body > p {
  margin-top: 20px;
}

.split ol,
.split ul {
  margin: 20px 0 0;
  padding-left: 20px;
}

.split li + li {
  margin-top: 6px;
}

.split li::marker {
  color: var(--navy-55);
}

.split li strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Features ---------- */

.features {
  display: grid;
  gap: 16px;
}

.feature {
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.feature h3 {
  margin-top: 28px;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.feature p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--navy-70);
}

/* ---------- FAQ ---------- */

.faq-wrap {
  background: var(--bg-soft);
}

.faq {
  display: grid;
  gap: 40px;
}

.faq-intro h2 {
  font-size: clamp(36px, 4.4vw, 56px);
  color: var(--navy);
}

.faq-intro p {
  margin-top: 20px;
  max-width: 420px;
  color: var(--navy-70);
}

.faq-intro .btn {
  margin-top: 28px;
}

.faq-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}

/* "+" che diventa "−": la barra verticale si chiude subito, poi l'icona ruota di 180° */
.faq-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  transition: transform 0.6s var(--ease-spring);
}
.faq-icon path {
  transform-box: view-box;
  transform-origin: 12px 12px;
}
.faq-icon .bar-v {
  transition: transform 0.2s ease-out;
}
.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}
.faq-item[open] .faq-icon .bar-v {
  transform: rotate(90deg);
}

.faq-item p {
  padding: 0 24px 24px;
  max-width: 560px;
  color: var(--navy-70);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 64px 32px;
  background: var(--bg);
}

.footer-top {
  display: grid;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand h2 {
  font-size: 36px;
  font-weight: 400;
  color: var(--navy);
}

.footer-brand p {
  margin-top: 20px;
  max-width: 380px;
  font-size: 14px;
  color: var(--navy-70);
}

.footer-links h3 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--navy-55);
}

.footer-links ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: 16px;
}

.footer-links a {
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  font-size: 14px;
  color: var(--navy);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-links li + li {
  border-left: 1px solid var(--navy);
  margin-left: 16px;
  padding-left: 16px;
}

.legal-links a {
  text-decoration: none;
}
.legal-links a:hover {
  text-decoration: underline;
}

/* ---------- Page hero (contact, disclaimer) ---------- */

.page-hero {
  padding-block: 72px 56px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  color: var(--navy);
}

.page-hero p {
  max-width: 360px;
  margin: 20px auto 0;
  font-size: 18px;
  color: var(--navy-70);
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  gap: 24px;
  align-items: start;
  padding-bottom: 80px;
}

.card {
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-form h2 {
  font-size: 32px;
  color: var(--navy);
}

.form-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.field label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--navy-70);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(31, 63, 92, 0.3);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.15);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}

.consent {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy-70);
}

.consent input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.consent a {
  color: var(--navy);
  font-weight: 500;
}

.hp {
  position: absolute;
  left: -9999px;
}

.form-status {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
}
.form-status[hidden] {
  display: none;
}
.form-status.is-ok {
  background: #e8f6ee;
  color: #1b5e3a;
}
.form-status.is-error {
  background: #fdecec;
  color: #8a1f1f;
}

.contact-aside h2 {
  margin-top: 20px;
  font-size: 24px;
  color: var(--navy);
}

.contact-aside p {
  margin-top: 6px;
  color: var(--navy-70);
}

.contact-aside a {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.contact-aside a:hover {
  text-decoration: underline;
}

/* ---------- Text page (disclaimer, 404) ---------- */

.text-page {
  max-width: 760px;
  padding-block: 72px 96px;
}

.text-page h1 {
  font-size: clamp(32px, 4vw, 44px);
  color: var(--navy);
}

.text-page p {
  margin-top: 20px;
  font-size: 17px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
  }

  .hero {
    grid-template-columns: 1fr 1fr;
    padding-block: 96px 120px;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 32px 48px 32px 96px;
  }

  .split--reverse {
    padding: 32px 64px 32px 24px;
  }

  .split--reverse .split-media {
    order: -1;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-top {
    grid-template-columns: 1fr auto;
  }

  .contact {
    grid-template-columns: 1.8fr 1fr;
  }

  .card {
    padding: 40px 32px;
  }

  .form-grid--2 {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (min-width: 1100px) {
  :root {
    --gutter: 80px;
  }

  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Animazioni (ricostruite da Framer) ---------- */

:root {
  /* approssima le spring di Framer (stiffness 400, damping 50–60) */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  interpolate-size: allow-keywords;
}

@keyframes blur-in {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

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

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(150px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Al caricamento: testo con blur, pulsante dal basso, immagine da destra */
.anim-blur {
  animation: blur-in 1s var(--ease-spring) var(--delay, 0s) backwards;
}
.anim-fade-up {
  animation: fade-up 0.9s var(--ease-spring) var(--delay, 0s) backwards;
}
.anim-slide-in {
  animation: slide-in-right 1.4s var(--ease-spring) var(--delay, 0s) backwards;
}

.d-2 { --delay: 0.2s; }
.d-4 { --delay: 0.4s; }
.d-6 { --delay: 0.6s; }

/* All'ingresso nel viewport (classe .is-in aggiunta da main.js) */
.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-y, 50px));
  transition: opacity 0.9s var(--ease-spring), transform 0.9s var(--ease-spring), filter 0.9s var(--ease-spring);
  transition-delay: var(--delay, 0.1s);
}
.js .reveal--blur {
  --reveal-y: 20px;
  filter: blur(10px);
}
.js .reveal--far {
  --reveal-y: 100px;
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Pulsante: il testo scorre in alto e ne entra una copia dal basso */
.btn-label {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 1.5;
}
.btn-label > span {
  display: block;
  transition: transform 0.45s var(--ease-spring);
}
.btn-label > span + span {
  position: absolute;
  inset: 100% 0 auto;
}
.btn:hover .btn-label > span,
.btn:focus-visible .btn-label > span {
  transform: translateY(-100%);
}

/* Card "Perché è utile": si impilano allo scroll (la scala di quelle sotto è in main.js).
   Solo su schermi abbastanza alti da contenere una card intera. */
@media (min-width: 768px) and (min-height: 720px) {
  .split {
    position: sticky;
    top: calc(96px + var(--i, 0) * 24px);
    transform-origin: 50% 0;
  }
}

/* FAQ: apertura animata dove il browser lo supporta (::details-content) */
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.4s var(--ease-spring), content-visibility 0.4s allow-discrete;
}
.faq-item[open]::details-content {
  block-size: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  /* regola separata: un selettore non supportato annullerebbe l'intera lista */
  .faq-item::details-content {
    transition: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
