:root {
  --panna: #FAF8F5;
  --rosso: #e6194b;
  --rosso-light: #ff2d5e;
  --dark: #1E2D37;
  --ink: #1a1a1a;
  --card: #ffffff;
  --muted: #5d6670;
  --hair: rgba(30, 45, 55, 0.10);
  --hair-soft: rgba(30, 45, 55, 0.06);
  --shadow-soft: 0 1px 2px rgba(30, 45, 55, 0.04), 0 18px 48px -24px rgba(30, 45, 55, 0.22);
  --shadow-lift: 0 1px 2px rgba(30, 45, 55, 0.05), 0 32px 64px -28px rgba(30, 45, 55, 0.32);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
  --term-green: #57c98a;
  --term-comment: #7d8893;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--panna);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: "Sora", system-ui, sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0;
  font-weight: 700;
}

h1 em, h2 em {
  font-style: italic;
  color: var(--rosso);
  line-height: 1.1;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.kicker {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--rosso);
  margin: 0 0 20px;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.site-head.is-stuck {
  padding: 10px 0;
  background: rgba(250, 248, 245, 0.82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--hair-soft);
}

.head-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand img { display: block; height: 34px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav > a:not(.btn-area) {
  font-size: 15px;
  font-weight: 500;
  color: var(--dark);
  position: relative;
  padding: 4px 0;
}

.nav > a:not(.btn-area)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1.5px;
  width: 0;
  background: var(--rosso);
  transition: width 0.35s var(--ease);
}

.nav > a:not(.btn-area):hover::after { width: 100%; }

.btn-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 9px 9px 20px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.btn-area:hover { background: #16242d; }
.btn-area:active { transform: scale(0.97); }

.btn-area-ico {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.btn-area:hover .btn-area-ico {
  background: var(--rosso);
  transform: translateX(2px);
}

.btn-area-ico svg { width: 14px; height: 14px; }

.flash {
  max-width: var(--maxw);
  margin: 14px auto -8px;
  padding: 14px 20px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 500;
}

.flash-ok { background: rgba(230, 25, 75, 0.06); color: var(--rosso); }
.flash-err { background: rgba(30, 45, 55, 0.06); color: var(--dark); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 15px 15px 26px;
  border-radius: 999px;
  background: var(--rosso);
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 14px 30px -14px rgba(230, 25, 75, 0.6);
}

.btn-primary:hover { background: var(--rosso-light); box-shadow: 0 20px 38px -14px rgba(230, 25, 75, 0.66); }
.btn-primary:active { transform: scale(0.98); }

.btn-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: transform 0.35s var(--ease);
}

.btn-primary:hover .btn-ico { transform: translateY(2px); }
.btn-ico svg { width: 16px; height: 16px; }

.btn-block { width: 100%; justify-content: center; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 15px 24px;
  border-radius: 999px;
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  box-shadow: inset 0 0 0 1.5px var(--hair);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(30, 45, 55, 0.28); }
.btn-ghost:active { transform: scale(0.98); }

.hero {
  padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 8vw, 100px);
}

.hero-grid {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(40px, 6vw, 84px);
}

.hero-text h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.7rem);
  font-weight: 800;
  margin: 0 0 26px;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-visual { perspective: 1400px; }

.preview-shell {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02));
  padding: 10px;
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow-lift);
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform 0.5s var(--ease);
  will-change: transform;
}

.term {
  position: relative;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(230, 25, 75, 0.22), transparent 55%),
    linear-gradient(165deg, #243743, var(--dark) 60%, #16232c);
  border-radius: calc(var(--r-lg) - 8px);
  padding: 22px;
  color: #eef2f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.term-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.term-dots { display: flex; gap: 7px; }
.term-dots i { display: block; width: 11px; height: 11px; border-radius: 999px; }
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }

.term-title { font-family: var(--mono); font-size: 12px; color: #aeb8bf; }

.term-stamp {
  margin-left: auto;
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfd7dc;
}

.term-body {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.95;
  padding-top: 16px;
  min-height: 212px;
}

.term-ln { display: block; white-space: pre-wrap; }
.term-sp { height: 0.5em; }
.term-ind { padding-left: 2px; color: #aab4bb; }
.term-cmt { color: var(--term-comment); }
.term-me { color: var(--rosso-light); font-weight: 700; }
.term-sep { color: var(--term-comment); }
.term-flag { color: #cdd5da; }
.term-tool { color: var(--term-green); font-weight: 700; }
.term-ok { color: var(--term-green); }

.term-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--rosso-light);
  vertical-align: -2px;
  margin-left: 2px;
  animation: term-blink 1s steps(1) infinite;
}

@keyframes term-blink { 50% { opacity: 0; } }

.term-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c4ccd1;
}

.term-foot .term-arrow { color: var(--rosso-light); }
.term-foot b { color: #fff; font-weight: 700; }

.term.is-play .term-ln[data-term-line],
.term.is-play .term-foot { opacity: 0; }
.term.is-play .term-ln.is-in,
.term.is-play .term-foot.is-in { opacity: 1; transition: opacity 0.45s var(--ease); }

.metodo-code {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2.15;
  color: #ffffff;
  opacity: 0.05;
  white-space: pre;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
}

.metodo-code-col {
  padding: 0 28px;
  animation: metodo-scroll 48s linear infinite;
}

@keyframes metodo-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.servizi { padding: clamp(72px, 9vw, 120px) 0; }

.sec-head { margin-bottom: clamp(40px, 5vw, 64px); max-width: 62ch; }

.sec-head h2 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
}

.sec-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 22px 0 0;
  max-width: 56ch;
}

.serv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.serv-card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 32px 30px 34px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.serv-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }

.serv-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(230, 25, 75, 0.08);
  color: var(--rosso);
  margin-bottom: 24px;
}

.serv-ico svg { width: 26px; height: 26px; }

.serv-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.serv-card p { color: var(--muted); margin: 0 0 22px; }

.serv-list {
  list-style: none;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--hair-soft);
  display: grid;
  gap: 12px;
}

.serv-list li {
  position: relative;
  padding-left: 24px;
  font-size: 15px;
  color: var(--dark);
}

.serv-cta {
  margin-top: clamp(36px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.serv-cta p {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin: 0;
  max-width: 30ch;
}

.serv-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 12px;
  height: 8px;
  border-left: 2px solid var(--rosso);
  border-bottom: 2px solid var(--rosso);
  transform: rotate(-45deg);
}

.metodo {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: #eef2f4;
  padding: clamp(80px, 10vw, 132px) 0;
}

.metodo > .wrap { position: relative; z-index: 1; }

.metodo .kicker { color: var(--rosso-light); }
.metodo h2 { color: #fff; }
.metodo .sec-sub { color: rgba(238, 242, 244, 0.66); }

.steps {
  list-style: none;
  counter-reset: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.step:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }

.step-n {
  font-family: "Sora", sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.4px rgba(255, 255, 255, 0.34);
  transition: color 0.5s var(--ease), -webkit-text-stroke-color 0.5s var(--ease);
}

.step:hover .step-n {
  color: var(--rosso-light);
  -webkit-text-stroke-color: transparent;
}

.step-body h3 {
  color: #fff;
  font-size: 1.65rem;
  margin-bottom: 12px;
}

.step-body p {
  color: rgba(238, 242, 244, 0.72);
  margin: 0;
  max-width: 56ch;
}

.contatti { padding: clamp(80px, 10vw, 130px) 0; }

.contatti-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.contatti-text h2 { font-size: clamp(2.1rem, 4vw, 3.1rem); }

.contatti-form {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 20px;
}

.field { display: grid; gap: 8px; }

.field label {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dark);
}

.field input,
.field textarea {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--panna);
  border: 1.5px solid var(--hair);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  width: 100%;
  resize: vertical;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder { color: #6e767e; }

.field input:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--rosso);
  box-shadow: 0 0 0 4px rgba(230, 25, 75, 0.12);
}

.site-foot {
  border-top: 1px solid var(--hair-soft);
  padding: 40px 0;
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.foot-logo { height: 28px; width: auto; display: block; }

.foot-credit {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: -6px -8px -6px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--dark);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; width: 100%; margin: 8px auto 0; }
  .preview-shell { transform: none !important; }
  .step { grid-template-columns: 64px 1fr; gap: 20px; }
}

@media (max-width: 620px) {
  .nav-toggle { display: flex; }
  .head-inner { position: relative; }
  .nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    background: rgba(250, 248, 245, 0.94);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav > a:not(.btn-area) {
    font-size: 16px;
    padding: 13px 14px;
    border-radius: var(--r-sm);
  }
  .nav > a:not(.btn-area)::after { display: none; }
  .nav > a:not(.btn-area):active { background: var(--hair-soft); }
  .btn-area { justify-content: center; margin-top: 4px; padding: 13px 18px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .head-inner, .hero-grid { padding-left: 20px; padding-right: 20px; }
  .flash { margin-left: 20px; margin-right: 20px; }
  .hero { padding-top: clamp(36px, 8vw, 56px); }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn-primary,
  .hero-cta .btn-ghost { justify-content: center; }
  .serv-grid { gap: 16px; }
  .serv-card { padding: 28px 24px 30px; }
  .term { padding: 18px; }
  .term-body { min-height: 0; font-size: 13px; }
  .servizi, .contatti { padding: clamp(56px, 12vw, 80px) 0; }
  .metodo { padding: clamp(60px, 13vw, 96px) 0; }
}

@media (max-width: 420px) {
  h1 br, h2 br { display: none; }
  .hero-text h1 { font-size: clamp(2.1rem, 8.5vw, 2.6rem); }
  .sec-head h2 { font-size: clamp(1.7rem, 7vw, 2rem); }
  .contatti-text h2 { font-size: clamp(1.8rem, 7.5vw, 2.1rem); }
}

body.auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panna);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: clamp(32px, 6vw, 48px);
  box-shadow: var(--shadow-lift);
  display: grid;
  gap: 18px;
}

.auth-card img {
  display: block;
  height: 28px;
  width: auto;
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.auth-card label {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dark);
}

.auth-card input {
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--panna);
  border: 1.5px solid var(--hair);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  width: 100%;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.auth-card input::placeholder { color: #6e767e; }

.auth-card input:focus {
  outline: none;
  background: #fff;
  border-color: var(--rosso);
  box-shadow: 0 0 0 4px rgba(230, 25, 75, 0.12);
}

.err {
  margin: 0;
  padding: 12px 16px;
  background: rgba(230, 25, 75, 0.07);
  color: var(--rosso);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--rosso);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .preview-shell { transform: none !important; }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--rosso);
  outline-offset: 3px;
}

.cine-foot a:focus-visible,
.cine-foot button:focus-visible {
  outline-color: #FAF8F5;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
