/* ==========================================================================
   Auxdromos — Design System
   Gemello PagoDesk · adattato per Consorzi stradali
   Brand: deep PA navy + orange accent · warm off-white paper
   Typography: Work Sans + Space Mono
   ========================================================================== */

:root {
  /* Brand */
  --blue: #003d7a;
  --blue-900: #002a55;
  --blue-700: #003d7a;
  --blue-500: #0b5fbf;
  --blue-100: #e6eef7;
  --blue-050: #f2f6fb;

  --orange: #ff8c00;
  --orange-600: #e87d00;
  --orange-100: #fff1de;

  /* Neutrals — warm off-white */
  --paper: #f7f5f1;
  --paper-2: #efece5;
  --card: #ffffff;
  --ink: #111418;
  --ink-2: #2b3138;
  --muted: #5e6774;
  --line: #d9d4ca;
  --line-2: #e7e2d7;

  /* Semantic */
  --ok: #3a7d44;
  --warn: #b4651a;
  --err: #a33a2a;

  /* Type */
  --font-body: 'Work Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --font-serif: 'Spectral', 'Source Serif 4', Georgia, ui-serif, serif;

  /* Radius / shadow */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-soft: 0 1px 2px rgba(0,31,63,.05), 0 8px 24px -12px rgba(0,31,63,.12);

  /* Density */
  --density: 1;
  --gutter: calc(24px * var(--density));
}

:root[data-density="compact"] { --density: 0.82; }

:root[data-accent="amber"] {
  --orange: #d98a1b;
  --orange-600: #b8720c;
  --orange-100: #f8ecd2;
}
:root[data-accent="terracotta"] {
  --orange: #c05a3a;
  --orange-600: #9e4628;
  --orange-100: #f6e2d9;
}

/* ===== Reset ============================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--blue); color: #fff; }

/* ===== Type scale ========================================================= */
h1, h2, h3, h4, h5 {
  font-family: var(--font-body);
  color: var(--blue);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}
/* Display headings use editorial serif (Spectral) — institutional/cadastral feel */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.012em;
}
h1 em { font-style: italic; font-weight: 500; }
h1 { font-size: clamp(2.4rem, 4.8vw, 3.6rem); line-height: 1.04; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.mission__quote, .pensato__quote {
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
}
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { margin: 0; color: var(--ink-2); text-wrap: pretty; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-600);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--orange);
  display: inline-block;
}

/* ===== Containers ========================================================= */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.section { padding: clamp(64px, 8vw, 112px) 0; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }
.section--alt { background: var(--paper-2); }
.section--blue { background: var(--blue); color: #fff; }
.section--blue h1, .section--blue h2, .section--blue h3, .section--blue h4 { color: #fff; }
.section--blue p { color: rgba(255,255,255,.82); }

.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ===== Header ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,245,241,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
}
.brand__mark {
  width: 30px; height: 30px;
  background: var(--blue);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}
.brand__mark svg { width: 18px; height: 18px; }
.brand__mark::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 9px; height: 9px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid var(--paper);
}
.brand span.brand__accent { color: var(--orange); }

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  font-size: 0.94rem;
  color: var(--ink-2);
  padding: 6px 0;
  position: relative;
  transition: color .15s;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a.is-active { color: var(--blue); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -19px;
  height: 2px; background: var(--orange);
}

/* ===== Buttons =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn--primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover { background: var(--orange-600); }
.btn--ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--blue); }
.btn--dark {
  background: var(--blue);
  color: #fff;
}
.btn--dark:hover { background: var(--blue-900); }
.btn--sm { padding: 9px 16px; font-size: 0.88rem; }
.btn svg { width: 14px; height: 14px; }

/* ===== Tags / badges ====================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue-100);
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 12%, transparent);
}
.tag--orange { background: var(--orange-100); color: var(--orange-600); border-color: color-mix(in oklab, var(--orange) 25%, transparent); }
.tag--ok { background: #e6f1e8; color: var(--ok); border-color: color-mix(in oklab, var(--ok) 20%, transparent); }
.tag--ghost { background: transparent; color: var(--muted); border-color: var(--line); }

.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.status-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 18%, transparent);
}
.status-badge--soon {
  background: color-mix(in oklab, var(--blue) 6%, var(--card));
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 24%, transparent);
}
.status-badge--ga {
  background: color-mix(in oklab, var(--ok) 8%, var(--card));
  color: var(--ok);
  border: 1px solid color-mix(in oklab, var(--ok) 24%, transparent);
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===== Footer ============================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 64px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .container { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 48px; }
.site-footer h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--blue); }
.site-footer__bottom {
  max-width: 1240px; margin: 40px auto 0; padding: 20px 32px 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 0.76rem;
  color: var(--muted); letter-spacing: 0.02em;
}

/* ===== Layout utilities =================================================== */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }

.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 28px;
}

/* ===== Sample-data notice (riusato in pi\u00f9 pagine) ===================== */
.sample-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 6px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
}
.sample-note::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange); display: inline-block;
}

/* ===== Cadastral map SVG pattern (utility) =============================== */
.cadastral-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='600' viewBox='0 0 800 600' fill='none' stroke='%23003d7a' stroke-width='0.6' stroke-linejoin='round'%3E%3Cpath d='M0 120 L320 100 L420 180 L580 160 L800 220'/%3E%3Cpath d='M0 280 L160 270 L280 340 L460 320 L640 380 L800 360'/%3E%3Cpath d='M0 440 L200 430 L380 480 L560 460 L800 510'/%3E%3Cpath d='M180 0 L200 200 L160 360 L210 540 L190 600'/%3E%3Cpath d='M420 0 L440 180 L480 360 L450 540 L470 600'/%3E%3Cpath d='M620 0 L640 220 L600 400 L630 600'/%3E%3Cg font-family='Spectral, serif' font-size='10' fill='%23003d7a' stroke='none' font-style='italic'%3E%3Ctext x='60' y='200'%3EFg. 012%3C/text%3E%3Ctext x='250' y='240'%3EP.lla 284%3C/text%3E%3Ctext x='380' y='260'%3EFg. 014%3C/text%3E%3Ctext x='520' y='420'%3EP.lla 091%3C/text%3E%3Ctext x='680' y='340'%3EFg. 018%3C/text%3E%3Ctext x='90' y='400'%3EFg. 015%3C/text%3E%3Ctext x='300' y='480'%3EP.lla 092%3C/text%3E%3C/g%3E%3Cg fill='%23ff8c00' stroke='none'%3E%3Ccircle cx='270' cy='180' r='1.6'/%3E%3Ccircle cx='450' cy='320' r='1.6'/%3E%3Ccircle cx='580' cy='160' r='1.6'/%3E%3Ccircle cx='200' cy='430' r='1.6'/%3E%3Ccircle cx='640' cy='380' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 800px 600px;
  background-position: center;
  background-repeat: no-repeat;
  opacity: .06;
  mix-blend-mode: multiply;
}

/* ===== Compliance strip =================================================== */
.compliance {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.compliance__cell {
  padding: 24px 28px;
  border-right: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
}
.compliance__cell:last-child { border-right: 0; }
.compliance__badge {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--blue);
  display: grid; place-items: center;
  color: var(--blue);
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  flex-shrink: 0;
}
.compliance__text strong { display: block; font-size: 0.96rem; color: var(--ink); }
.compliance__text span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* ===== Checklist (riusato in moduli) ====================================== */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line-2);
  align-items: start;
}
.checklist li:first-child { border-top: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 1px solid var(--line); }
.checklist .ico {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700;
  margin-top: 2px;
}
.checklist li > div > strong:first-child { display: block; color: var(--ink); font-size: 0.98rem; }
.checklist p { font-size: 0.9rem; margin-top: 2px; color: var(--muted); }
.checklist p strong { color: var(--ink); font-weight: 600; }

/* ===== Generic preview card =============================================== */
.preview {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.preview__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.preview__body { padding: 20px; }

/* ===== Final CTA block ==================================================== */
.cta-final {
  padding: clamp(72px, 8vw, 112px) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}
.cta-final__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center;
}
.cta-final h2 { max-width: 16ch; }

/* ===== Forms ============================================================== */
.form-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-field label {
  display: block; font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); font-family: inherit; font-size: 0.94rem;
  color: var(--ink); transition: border-color .15s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--blue);
}
.form-field { margin-bottom: 14px; }

/* ===== Responsive ========================================================= */
@media (max-width: 960px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .compliance { grid-template-columns: 1fr 1fr; }
  .compliance__cell:nth-child(2) { border-right: 0; }
  .compliance__cell:nth-child(1), .compliance__cell:nth-child(2) { border-bottom: 1px solid var(--line); }
  .cta-final__grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .site-footer .container { grid-template-columns: 1fr; gap: 32px; }
  h1 { font-size: 2.2rem; }
}

/* ===== Tweaks panel ======================================================= */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  z-index: 100;
  display: none;
  width: 260px;
  font-size: 0.88rem;
}
.tweaks[data-open="1"] { display: block; }
.tweaks h6 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks__row { margin-bottom: 14px; }
.tweaks__row:last-child { margin-bottom: 0; }
.tweaks__label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
}
.tweaks__swatch[aria-pressed="true"] { border-color: var(--ink); }
.tweaks__segment {
  display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.tweaks__segment button {
  flex: 1; padding: 7px 10px; background: transparent; border: 0; cursor: pointer;
  font-size: 0.82rem; color: var(--muted);
}
.tweaks__segment button[aria-pressed="true"] {
  background: var(--blue); color: #fff;
}
