/* Listino PrimeSystemAI
   Carta calda, inchiostro, un solo timbro rosso.
   Serif per le voci, sans per il testo. */

:root {
  --paper: #F8F6F1;
  --paper-deep: #F0EDE5;
  --card: #FFFFFF;
  --ink: #1A1713;
  --slate: #5D584F;
  --hairline: rgba(26, 23, 19, .16);
  --hairline-soft: rgba(26, 23, 19, .09);
  --line-strong: rgba(26, 23, 19, .38);
  --accent: #1B3FA0;
  --stamp: #B3261E;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gx: clamp(20px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.015em;
  text-wrap: balance;
}
p { text-wrap: pretty; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(var(--gx), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gx), env(safe-area-inset-right, 0px));
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 12px; }
.opt { font-weight: 400; color: var(--slate); }

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

/* ——— Pulsanti ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.2;
  border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #34302A; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--ink); background: rgba(26, 23, 19, .04); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-full { width: 100%; }

/* ——— Barra in alto ——— */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: rgba(248, 246, 241, .93);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-in { display: flex; align-items: center; gap: 28px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; font-weight: 600; }
.brand small { display: block; font-size: 12px; line-height: 1.3; color: var(--slate); }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--slate); text-decoration: none;
  padding-block: 6px; border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--ink); }
.topbar-in .short { display: none; }

/* ——— Apertura ——— */
.hero { padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 84px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 210px;
  gap: 24px clamp(28px, 5vw, 64px); align-items: start;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.03; letter-spacing: -.028em;
}
.hero h1 em {
  display: block; margin-top: .12em;
  font-style: italic; font-weight: 400; letter-spacing: -.02em;
}
.hero-lede { max-width: 56ch; margin-top: 30px; font-size: 18px; color: var(--slate); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding-top: 10px; }
.hero-caption {
  font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.45; color: var(--slate);
  max-width: 22ch;
}

/* Il timbro, l'unico accento rosso della pagina */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 20px 11px;
  color: var(--stamp);
  border: 2px solid var(--stamp); border-radius: 4px;
  outline: 1px solid var(--stamp); outline-offset: 3px;
  transform: rotate(-5deg); transform-origin: 30% 50%;
  opacity: .96;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.75' /%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0.86'/%3E%3C/filter%3E%3Crect width='160' height='90' fill='white' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.75' /%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0.86'/%3E%3C/filter%3E%3Crect width='160' height='90' fill='white' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-size: cover; mask-size: cover;
}
.stamp-top { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.stamp-main { font-family: var(--serif); font-size: 31px; font-weight: 600; font-style: italic; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: thump .55s cubic-bezier(.2, .9, .3, 1.15) .35s both; }
  @keyframes thump {
    from { opacity: 0; transform: rotate(-13deg) scale(1.7); }
    to   { opacity: .96; transform: rotate(-5deg) scale(1); }
  }
}

/* ——— Sezioni ——— */
.rule { border: none; border-top: 1px solid var(--hairline); }
.block {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px; padding-block: clamp(52px, 7vw, 84px);
}
.block-side { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.block-side h2 { font-size: 30px; }
.side-note { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.4; color: var(--slate); }
.block-body { min-width: 0; max-width: 760px; }
.block-body > p { color: var(--slate); margin-bottom: 16px; max-width: 62ch; }
.block-body > p strong { color: var(--ink); font-weight: 600; }
.h3-lead { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 14px; max-width: 24ch; }

/* ——— Indice dei temi ——— */
.index { margin-top: 30px; border-top: 2px solid var(--ink); }
.topic {
  display: grid; grid-template-columns: 26px minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 6px 22px; align-items: start;
  width: 100%; padding: 22px 0;
  text-align: left; background: transparent; border: none;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background-color .15s ease;
}
.topic:hover { background: rgba(26, 23, 19, .035); box-shadow: -16px 0 0 rgba(26, 23, 19, .035), 16px 0 0 rgba(26, 23, 19, .035); }
.topic[aria-pressed="true"] { background: var(--paper-deep); box-shadow: -16px 0 0 var(--paper-deep), 16px 0 0 var(--paper-deep); }
.tick {
  width: 24px; height: 24px; margin-top: 4px;
  border: 1.5px solid var(--ink); border-radius: 3px;
  display: grid; place-items: center;
  transition: background-color .15s ease;
}
.tick svg { width: 14px; height: 14px; }
.tick path {
  fill: none; stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 18; stroke-dashoffset: 18;
}
.topic[aria-pressed="true"] .tick { background: var(--ink); }
.topic[aria-pressed="true"] .tick path { stroke-dashoffset: 0; transition: stroke-dashoffset .22s ease .05s; }
.topic-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topic-name { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 28px); font-weight: 500; line-height: 1.15; letter-spacing: -.012em; }
.topic-tools { font-family: var(--serif); font-style: italic; font-size: 16.5px; color: var(--slate); }
.topic-desc { font-size: 15px; line-height: 1.55; color: var(--slate); padding-top: 5px; }
.index-note { margin-top: 20px; font-size: 15px; color: var(--slate); }

/* ——— Come lavoro ——— */
.steps { margin-top: 30px; border-top: 2px solid var(--ink); counter-reset: s; }
.step {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px;
  padding: 22px 0; border-bottom: 1px solid var(--hairline);
}
.step::before {
  counter-increment: s; content: counter(s);
  grid-row: span 2;
  font-family: var(--serif); font-style: italic; font-size: 38px; line-height: 1; color: var(--slate);
}
.step h3 { font-size: 24px; }
.step p { color: var(--slate); font-size: 15.5px; max-width: 56ch; }

.rules { margin-top: 44px; }
.rules h3 { font-size: 24px; margin-bottom: 18px; }
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.rules-grid p { font-size: 15px; color: var(--slate); line-height: 1.6; }
.rules-grid strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ——— Formati ——— */
.scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 30px; border-top: 2px solid var(--ink); }
.scope { padding: 22px 28px 8px 0; }
.scope + .scope { padding: 22px 0 8px 28px; border-left: 1px solid var(--hairline); }
.scope h3 { font-size: 25px; }
.scope .sub { font-family: var(--serif); font-style: italic; font-size: 16.5px; color: var(--slate); margin: 2px 0 14px; }
.scope li { position: relative; padding: 7px 0 7px 22px; font-size: 15px; line-height: 1.55; color: var(--slate); }
.scope li::before { content: ""; position: absolute; left: 0; top: 1.1em; width: 10px; height: 2px; background: var(--ink); opacity: .5; }
.extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--hairline); }
.extras p { font-size: 15px; line-height: 1.6; color: var(--slate); }
.extras strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }

/* ——— Listino ——— */
.legend { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 14.5px; color: var(--slate); }
.legend .blocks { margin: 0; }
.ledger { margin-top: 36px; }
.ledger-title { font-family: var(--serif); font-style: italic; font-size: 24px; font-weight: 400; padding-top: 14px; border-top: 2px solid var(--ink); }
.rates { margin-top: 10px; }
.rate {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--hairline-soft);
}
.rate:last-child { border-bottom-color: var(--hairline); }
.rate-name strong { display: block; font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.rate-name small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--slate); max-width: 52ch; }
.blocks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.blocks .b { width: 11px; height: 11px; border-radius: 2px; background: var(--ink); }
.blocks .b.open { background: transparent; border: 1.5px dashed var(--ink); }
.rate-price { text-align: right; white-space: nowrap; }
.amount { display: block; font-family: var(--serif); font-size: 32px; line-height: 1.1; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.amount sup { font-size: .5em; vertical-align: top; position: relative; top: .1em; margin-left: 1px; }
.amount.text { font-style: italic; font-weight: 400; font-size: 24px; }
.rate-price small { display: block; margin-top: 2px; font-size: 13px; color: var(--slate); }

.fiscal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 36px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.fiscal p { font-size: 14px; line-height: 1.6; color: var(--slate); }
.fiscal strong { color: var(--ink); font-weight: 600; }

/* ——— Chiusura e piè di pagina ——— */
.closing { padding-block: clamp(64px, 9vw, 110px); text-align: center; }
.closing h2 { font-size: clamp(34px, 5.2vw, 58px); letter-spacing: -.022em; }
.closing h2 em { display: block; font-style: italic; font-weight: 400; }
.closing p { max-width: 54ch; margin: 24px auto 32px; color: var(--slate); font-size: 17px; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.foot { background: var(--paper-deep); border-top: 1px solid var(--hairline); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; padding-block: 34px; }
.foot-brand { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 300px; min-width: 0; font-size: 14px; color: var(--slate); }
.foot-brand img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.foot-meta { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; text-align: right; flex: 1 1 260px; min-width: 0; font-size: 13px; color: var(--slate); }
.foot-meta a, .foot-meta span { overflow-wrap: anywhere; }
.foot-meta a { color: var(--ink); }

/* ——— Barra in basso ——— */
.stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(248, 246, 241, .96);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); visibility: hidden;
  transition: transform .24s ease, visibility 0s linear .24s;
}
.stickybar.visible { transform: none; visibility: visible; transition-delay: 0s; }
.sb-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 11px; }
.sb-text { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--slate); }
.sb-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ——— Finestre ——— */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(26, 23, 19, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px));
}
.overlay[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 6px;
  padding: 36px; box-shadow: 0 24px 64px rgba(26, 23, 19, .2);
}
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px;
  background: none; border: none; font-size: 26px; line-height: 1; color: var(--slate); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal h3 { font-size: 30px; margin-bottom: 8px; padding-right: 36px; }
.modal-sub { font-size: 15px; color: var(--slate); margin-bottom: 24px; }

.field { margin-bottom: 18px; border: none; min-width: 0; }
.field > label, .field > legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 12px 13px; font-family: var(--sans); font-size: 16px; color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.choice-group { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 4px; cursor: pointer; font-size: 15px;
}
.choice input { accent-color: var(--ink); flex-shrink: 0; width: 17px; height: 17px; }
.choice.active { border-color: var(--ink); background: var(--paper-deep); }
.choice-tag { margin-left: auto; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--slate); white-space: nowrap; }
.choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: 11px 14px; font-size: 14px; line-height: 1.3;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--card);
  transition: background-color .15s ease, color .15s ease;
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-sent h3 { outline: none; }
.modal-sent p { font-size: 15px; color: var(--slate); margin-bottom: 16px; }
.modal-sent .addr { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.mail-preview {
  width: 100%; margin-bottom: 16px; padding: 14px; resize: vertical;
  font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--ink);
  background: var(--card); border: 1px solid var(--hairline); border-radius: 4px;
}
.sent-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ——— Schermi medi e piccoli ——— */
@media (max-width: 980px) {
  .nav { display: none; }
  .topbar-in { justify-content: space-between; }
  .block { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .block-side { position: static; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
  .block-body { max-width: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-side { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 20px 28px; padding-top: 6px; }
  .hero-grid { gap: 28px; }
}
@media (max-width: 720px) {
  .brand small { display: none; }
  .topbar-in .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
  .topbar-in .long { display: none; }
  .topbar-in .short { display: inline; }
  .hero-lede { font-size: 17px; }
  .hero-side { order: -1; }
  .hero-caption { display: none; }
  .stamp { padding: 9px 16px 8px; }
  .stamp-main { font-size: 25px; }
  .topic { grid-template-columns: 26px minmax(0, 1fr); }
  .topic-desc { grid-column: 2; padding-top: 2px; }
  .scopes, .extras, .fiscal, .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .scope, .scope + .scope { padding: 22px 0 8px; border-left: none; }
  .scope + .scope { border-top: 1px solid var(--hairline); }
  .rules-grid { gap: 20px; }
  .step { grid-template-columns: 40px minmax(0, 1fr); }
  .step::before { font-size: 32px; }
  .amount { font-size: 27px; }
  .amount.text { font-size: 21px; }
  .sb-text { display: none; }
  .sb-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .foot-meta { align-items: flex-start; text-align: left; }
  .modal { padding: 28px 20px; }
  .choice-tag { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
