/* Sbrighino — fondamenta visive condivise da sito e web app.
   Riferimento: il blocchetto prestampato dei preventivi (carta bianca, stampa blu,
   numero rosso) e il giallo del metro pieghevole per l'azione principale. */

:root {
  --carta: #ffffff;
  --fondo: #e9eef8;
  --velina: #f2f5fc;
  --blu: #1f3fa6;
  --blu-scuro: #17307f;
  --inchiostro: #0e1b3d;
  --tenue: #55618a;
  --righe: #c9d4ee;
  --rosso: #d92d20;
  --giallo: #ffcf1a;
  --giallo-scuro: #f2bc00;
  --verde: #0f7a43;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --testo: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --raggio: 8px;
  --ombra-foglio: 0 1px 0 var(--righe), 0 22px 44px -26px rgba(14, 27, 61, 0.45);
}

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

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

body {
  margin: 0;
  background: var(--fondo);
  color: var(--inchiostro);
  font: 400 17px/1.5 var(--testo);
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: 1.55rem; line-height: 1.1; }
p { margin: 0; }
a { color: var(--blu); text-underline-offset: 3px; }
a:hover { color: var(--blu-scuro); }
img, svg { max-width: 100%; }

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

.solo-lettori { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px;
  font: 700 1.06rem/1.1 var(--testo); text-decoration: none; text-align: center;
  color: var(--inchiostro); background: var(--carta);
  border: 1.5px solid var(--inchiostro); border-radius: var(--raggio);
  cursor: pointer; transition: background-color 0.12s, transform 0.08s;
}
.btn:hover { background: var(--velina); color: var(--inchiostro); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 22px; height: 22px; flex: none; }

.btn-giallo { background: var(--giallo); }
.btn-giallo:hover { background: var(--giallo-scuro); }
.btn-blu { background: var(--blu); border-color: var(--blu); color: #fff; }
.btn-blu:hover { background: var(--blu-scuro); border-color: var(--blu-scuro); color: #fff; }
.btn-rosso { color: var(--rosso); border-color: var(--rosso); }
.btn-rosso:hover { background: #fdf0ee; color: var(--rosso); }
.btn-piano { border-color: transparent; background: none; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; padding-inline: 10px; }
.btn-piano:hover { background: none; color: var(--blu); }
.btn-piccolo { min-height: 42px; padding: 8px 14px; font-size: 0.97rem; }
.btn-largo { width: 100%; }

/* ---------- Campi ---------- */

.campo { display: block; margin-bottom: 16px; }
.campo > span, .etichetta { display: block; font-size: 0.94rem; color: var(--blu); margin-bottom: 5px; }
.campo small { display: block; color: var(--tenue); font-size: 0.88rem; margin-top: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="time"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: 50px; padding: 11px 13px;
  font: inherit; color: var(--inchiostro); background: var(--carta);
  border: 1.5px solid var(--tenue); border-radius: var(--raggio);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--blu); outline: 3px solid rgba(31, 63, 166, 0.25); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: #8a94b5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--inchiostro) 50%), linear-gradient(135deg, var(--inchiostro) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }

.spunta { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; cursor: pointer; }
.spunta input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--blu); }

/* ---------- Il foglio del blocchetto ---------- */

.foglio { background: var(--carta); box-shadow: var(--ombra-foglio); border-radius: 3px; }
.foglio-strappo {
  height: 22px; border-radius: 3px 3px 0 0;
  background:
    radial-gradient(circle at 11px 11px, var(--fondo) 4.2px, transparent 4.7px) 0 0 / 22px 22px repeat-x,
    var(--blu);
}

.numero-rosso { font-family: var(--display); font-weight: 700; color: var(--rosso); font-variant-numeric: tabular-nums; }
.cifre { font-variant-numeric: tabular-nums; }

/* ---------- Marchio ---------- */

.marchio { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--inchiostro); font: 700 1.9rem/1 var(--display); letter-spacing: 0.01em; }
.marchio:hover { color: var(--inchiostro); }
.marchio svg { width: 34px; height: 34px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
