/* Autolettura portals. Look taken from the company sites (read on 27/10/2026):
   092 lirabo.com (Inter, blu/arancio palette, sticky white header, pill nav),
   094 silcabologna.com (Rubik, light blue #29aae2, orange #eb811e).
   Fonts are self-hosted: nothing is loaded from third parties. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/static/inter-latin-variable.woff2) format("woff2");
}
@font-face {
  font-family: "Rubik Variable";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/static/rubik-latin-variable.woff2) format("woff2");
}

:root {
  --font: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --primary: #0e6091;
  --primary-hover: #0a3d5c;
  --primary-soft: #e1eff7;
  --primary-tint: #f2f8fc;
  --accent: #f1801f;
  --hero-from: #0a3d5c;
  --hero-to: #1273ad;
  --ink: #16232d;
  --ink-2: #3a4b58;
  --ink-3: #56707f;
  --bg: #fafcfd;
  --surface: #fff;
  --line: #dce6ec;
  --cold: #1273ad;
  --cold-soft: #e1eff7;
  --hot: #dd6410;
  --hot-soft: #fdebd9;
  --error: #b54708;
  --error-soft: #fef6ee;
  --ok: #18794e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px #062a400f, 0 8px 28px #062a4014;
}

body.ditta-094 {
  --font: "Rubik Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --primary: #1a8bbd;
  --primary-hover: #13709a;
  --primary-soft: #dff2fb;
  --primary-tint: #f2fafc;
  --accent: #eb811e;
  --hero-from: #1a8bbd;
  --hero-to: #29aae2;
  --ink: #1a1a1a;
  --ink-2: #3d4144;
  --ink-3: #5f6366;
  --bg: #f2fafc;
  --line: #d6e6ec;
  --cold: #29aae2;
  --cold-soft: #dff2fb;
  --hot: #eb811e;
  --hot-soft: #fdeedd;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--primary); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.container.narrow { width: min(100% - 2rem, 46rem); }

/* --- header, as on the company sites ------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffffeb;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; position: relative; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand .logo { height: 44px; width: auto; display: block; }
.ditta-094 .brand .logo { height: 52px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; color: #062a40; }
.brand-tag { font-size: .72rem; font-weight: 550; letter-spacing: .02em; color: var(--ink-3); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem .9rem;
  border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 1rem; text-decoration: none;
  white-space: nowrap; transition: background .18s, color .18s;
}
.site-nav a:hover { background: var(--primary-tint); color: var(--primary-hover); }
.site-nav .nav-cta { margin-inline-start: .4rem; }
.site-nav a.btn-ghost { border: 2px solid currentColor; color: var(--primary); }
.site-nav a.btn-solid { background: var(--accent); color: #fff; }
.site-nav a.btn-solid:hover { background: var(--accent); filter: brightness(.95); color: #fff; }
.ditta-094 .site-nav a { text-transform: none; font-weight: 500; }

.nav-toggle {
  display: none; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; content: "";
}
.nav-toggle .bars::before { position: absolute; top: -7px; }
.nav-toggle .bars::after { position: absolute; top: 7px; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: -1rem; right: -1rem;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 1rem 1.25rem 1.5rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { width: 100%; min-height: 3rem; }
  .site-nav .nav-cta { margin: .5rem 0 0; }
  .no-js .nav-toggle { display: none; }
  .no-js .site-nav { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 .75rem; }
  .no-js .header-inner { flex-wrap: wrap; }
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 2.5rem 0 4.5rem;
}
.hero .container { width: min(100% - 2rem, 46rem); }
.eyebrow { margin: 0 0 .4rem; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; opacity: .85; }
.hero h1 { margin: 0; font-size: clamp(1.7rem, 1.3rem + 2vw, 2.5rem); line-height: 1.15; letter-spacing: -.01em; }
.lead { margin: .6rem 0 0; font-size: 1.1rem; opacity: .95; }
.lead a { color: #fff; }

/* --- cards and forms ----------------------------------------------------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  margin: -3rem 0 2.5rem;
  position: relative;
}
.card h2, .step-title { margin: 0 0 .35rem; font-size: 1.35rem; line-height: 1.25; color: var(--ink); }
.muted { color: var(--ink-3); font-size: .97rem; margin: 0 0 1rem; }

label { display: block; font-weight: 600; font-size: .95rem; margin: 0 0 .35rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input:not([type]) {
  display: block; width: 100%; padding: .8rem .95rem; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input.invalid, input:user-invalid { border-color: var(--error); }

.code { display: flex; gap: .75rem; margin: 1.25rem 0; }
.code .box {
  width: 100%; max-width: 7rem; text-align: center; font-size: 1.6rem; font-weight: 700;
  letter-spacing: .12em; padding: .7rem .5rem; font-variant-numeric: tabular-nums;
}
.cartolina { margin: 0 0 1.25rem; }
.cartolina img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.6rem; border: 2px solid transparent; border-radius: 999px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: background .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn-ghost { background: transparent; color: var(--primary); border-color: currentColor; }
.btn-ghost:hover { background: var(--primary-tint); color: var(--primary-hover); }
.btn-block { width: 100%; }

/* --- wizard -------------------------------------------------------------- */

.progress { height: 6px; background: var(--primary-soft); border-radius: 999px; overflow: hidden; display: none; }
.progress-bar { height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .3s; }
.step-count { display: none; margin: .6rem 0 1rem; color: var(--ink-3); font-size: .9rem; font-weight: 600; }
.js .wizard .progress, .js .wizard .step-count { display: block; }
.js .wizard .step { display: none; }
.js .wizard .step.active { display: block; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.no-js .step + .step { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.no-js .step-nav button[type=button] { display: none; }

.meters { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 720px) { .meters { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); } }

.meter {
  margin: 0; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem;
  background: linear-gradient(180deg, var(--cold-soft), #fff 4.5rem);
}
.meter.hot { background: linear-gradient(180deg, var(--hot-soft), #fff 4.5rem); }
.meter legend { float: left; width: 100%; padding: 0; margin: 0 0 .9rem; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.meter legend + * { clear: both; }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--cold); flex: none; }
.dot.hot { background: var(--hot); }
.reading { font-size: 1.6rem !important; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.hint { margin: .35rem 0 .9rem; color: var(--ink-3); font-size: .85rem; }

.photo { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 0; cursor: pointer; font-weight: 500; }
.photo input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.no-js .photo input[type=file] { position: static; width: auto; height: auto; opacity: 1; }
.photo-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px;
  border: 1.5px dashed var(--ink-3); color: var(--ink-2); font-size: .92rem; font-weight: 600; background: #fff;
}
.photo-btn::before { content: "📷"; }
.photo:hover .photo-btn, .photo input:focus-visible + .photo-btn { border-color: var(--primary); color: var(--primary); }
.photo-name { color: var(--ink-3); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; white-space: nowrap; }
.photo-remove {
  margin: .5rem 0 0; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--error); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: underline;
}
.photo-preview { display: block; width: 100%; max-height: 10rem; object-fit: cover; border-radius: var(--radius-sm); margin-top: .75rem; }
.no-js .photo-btn, .no-js .photo-name { display: none; }

.grid { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } .grid .full { grid-column: 1 / -1; } }

.check { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; margin: 1.5rem 0 0; color: var(--ink-2); }
.check input { width: 1.3rem; height: 1.3rem; margin-top: .15rem; flex: none; accent-color: var(--primary); }

.step-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.75rem; }
.step-nav .btn { flex: 1; max-width: 14rem; }
.step-nav .btn:only-child, .step-nav .btn:last-child { margin-inline-start: auto; }
.js .step:first-of-type [data-prev] { visibility: hidden; }

.step-error {
  margin: 1rem 0 0; padding: .75rem 1rem; border-radius: var(--radius-sm);
  background: var(--error-soft); color: var(--error); font-weight: 600; font-size: .95rem;
}
.errors {
  background: var(--error-soft); border: 1px solid var(--error); color: var(--error);
  border-radius: var(--radius-sm); padding: .75rem 1rem; margin: -3rem 0 1rem; position: relative;
}
.errors + .card { margin-top: 0; }
.card .errors { margin: 0 0 1rem; }
.errors ul { margin: 0; padding-left: 1.1rem; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- receipt ------------------------------------------------------------- */

.done { text-align: center; }
.done-mark {
  width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
  background: #e6f4ec; color: var(--ok); font-size: 2rem; font-weight: 800;
}
.summary { width: 100%; border-collapse: collapse; margin: 1rem 0 1.25rem; text-align: left; }
.summary th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: .5rem .75rem; }
.summary td { padding: .75rem; border-top: 1px solid var(--line); }
.summary td .dot { margin-right: .5rem; vertical-align: middle; }
.summary .num { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .05em; }

/* --- footer -------------------------------------------------------------- */

.site-footer { background: #062a40; color: #ffffffcc; font-size: .9rem; }
.ditta-094 .site-footer { background: #1a1a1a; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 1.5rem 0; }
.site-footer a { color: #fff; }

@media print {
  .site-header, .site-footer, .hero .eyebrow, .btn { display: none !important; }
  .hero { background: none; color: var(--ink); padding: 0; }
  .card { box-shadow: none; margin: 1rem 0; }
}
