/* ------------------------------------------------------------------
   Living Serramenti - foglio di stile unico.
   Parte pubblica (vetrina) + parte privata (pannello e preventivi).
   Nessun font remoto e nessun CDN: tutto viene dal server del sito.
   ------------------------------------------------------------------ */

:root {
  --ink: #181a1b;
  --ink-soft: #2c3132;
  --muted: #676b66;
  --paper: #f3f1ec;
  --paper-2: #eae6de;
  --surface: #ffffff;
  --line: #d9d5cc;
  --line-soft: #e7e3db;

  --metal: #222626;        /* fondo delle fasce scure */
  --metal-2: #171919;      /* piede pagina */

  --orange: #dd6b32;       /* accento vivo, usato sui fondi scuri */
  --orange-light: #f2a06f;
  --accent: #bf5320;       /* riempimenti con testo bianco: contrasto AA */
  --accent-dark: #a84e25;  /* accento su carta e stati hover */

  --danger: #9b2f2f;
  --success: #2d7651;
  --shadow: 0 22px 60px rgb(24 26 27 / 12%);

  --header-h: 84px;
  --pad: clamp(20px, 5vw, 72px);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
p { text-wrap: pretty; }

h1, h2, h3 { margin: 0; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 4.6vw, 4.2rem); }
h3 { margin: 0 0 10px; font-size: 1.28rem; letter-spacing: -0.02em; }

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 100;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translate(-50%, -220%);
  transition: transform 160ms ease;
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ---------------------------------------------------------- intestazione */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 10px var(--pad);
  background: rgb(255 255 255 / 92%);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand img { width: 52px; height: 56px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; text-transform: uppercase; line-height: 1.05; }
.brand-name b { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-name small { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.22em; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 26px; font-size: 0.96rem; font-weight: 600; }
.site-nav a { color: var(--ink-soft); text-decoration: none; transition: color 140ms ease; }
.site-nav a:hover { color: var(--accent-dark); }
.site-nav .nav-private { color: var(--muted); font-weight: 600; }
.site-nav .nav-private::before { content: "▣"; margin-right: 6px; color: var(--orange); }

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--ink); transition: transform 180ms ease, opacity 140ms ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* -------------------------------------------------------------- bottoni */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); }
.button .arrow { transition: transform 180ms ease; }
.button:hover .arrow { transform: translateX(3px); }
.button-light { background: transparent; color: inherit; border-color: currentColor; }
.button-light:hover { background: rgb(255 255 255 / 12%); border-color: currentColor; color: inherit; }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #7f2626; border-color: #7f2626; }

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

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(760px, calc(100svh - var(--header-h)));
  overflow: hidden;
}
.hero-media, .hero-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media { object-fit: cover; }
.hero-overlay { background: linear-gradient(90deg, rgb(15 16 16 / 90%), rgb(15 16 16 / 55%) 46%, rgb(15 16 16 / 15%)); }
.hero-content {
  position: relative;
  width: min(760px, 100%);
  margin-left: clamp(20px, 7vw, 96px);
  padding: clamp(64px, 9vw, 110px) clamp(20px, 4vw, 0px) clamp(64px, 9vw, 110px) 0;
  color: #fff;
}
.hero h1 { font-size: clamp(3.1rem, 7vw, 6.6rem); line-height: 0.9; letter-spacing: -0.055em; margin: 22px 0 26px; }
.hero h1 em { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; color: var(--orange-light); letter-spacing: -0.03em; }
.hero p { max-width: 560px; margin: 0; font-size: clamp(1.04rem, 1.5vw, 1.18rem); color: rgb(255 255 255 / 88%); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero .eyebrow { color: var(--orange-light); }

/* -------------------------------------------------------------- sezioni */

.section { padding: clamp(64px, 8vw, 120px) var(--pad); }
.section-heading { max-width: 900px; margin-bottom: clamp(34px, 4vw, 52px); }
.section-heading p:not(.eyebrow) { margin: 18px 0 0; max-width: 68ch; color: var(--muted); font-size: 1.06rem; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Intestazione a due colonne: titolo a sinistra, testo di lancio a destra. */
.intro { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 80px); align-items: end; }
.intro h2 { margin: 14px 0 0; }
.intro > div > p { margin: 0; }
.intro > p { margin: 0; color: var(--muted); font-size: 1.08rem; }

/* ------------------------------------------------------- soluzioni (4 su) */

.services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0 var(--pad) clamp(64px, 8vw, 120px);
  background: transparent;
}
.services article {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.services article:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow); }
/* height:auto annulla l'attributo height del markup: senza, l'aspect-ratio
   viene ignorato e le foto si allungano per riempire la scheda. */
.services img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; flex: 0 0 auto; }
.services .service-body { flex: 1; padding: 26px 26px 30px; }
.services b { display: block; margin-bottom: 12px; color: var(--orange); font-size: 0.86rem; font-weight: 800; letter-spacing: 0.14em; }
.services p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* ------------------------------------------------------- azienda (scura) */

.craft { display: grid; grid-template-columns: 1fr 1fr; background: var(--metal); color: #fff; }
.craft-media { min-height: 100%; }
.craft-media img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.craft-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 6vw, 96px) clamp(24px, 5vw, 88px); }
.craft-copy .eyebrow { color: var(--orange-light); }
.craft-copy h2 { font-size: clamp(2rem, 3.3vw, 3.2rem); }
.craft-copy > p { max-width: 56ch; color: rgb(255 255 255 / 78%); font-size: 1.06rem; }
.craft-copy ul { margin: 26px 0 0; padding: 0; list-style: none; }
.craft-copy li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
  font-weight: 600;
}
.craft-copy li::before { content: "✓"; color: var(--orange-light); font-weight: 800; }

/* --------------------------------------------------------------- metodo */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.steps article { padding: 30px 28px 34px 0; border-top: 2px solid var(--ink); }
.steps article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.steps span { display: block; margin-bottom: 16px; color: var(--orange); font-size: 0.86rem; font-weight: 800; letter-spacing: 0.14em; }
.steps p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* ------------------------------------------------------ showroom lavori */

.showroom-carousel { background: var(--paper-2); overflow: hidden; }
.carousel-shell { position: relative; width: min(1180px, 100%); margin: 0 auto; }
.carousel-track { position: relative; min-height: 520px; }
.carousel-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 500px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px) scale(0.985);
  transition: opacity 260ms ease, transform 380ms ease;
}
.carousel-card[data-active] { opacity: 1; pointer-events: auto; transform: none; }
.carousel-card img { width: 100%; height: 100%; min-height: 500px; object-fit: cover; }
.carousel-card > div { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 52px); }
.carousel-card h3 { font-size: clamp(1.8rem, 3vw, 2.9rem); margin-bottom: 14px; }
.carousel-card p { margin: 0; color: var(--muted); font-size: 1.04rem; }
.carousel-card small { margin-top: 14px; color: var(--muted); font-weight: 700; }
.work-meta { margin: 0 0 10px; color: var(--accent-dark); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 54px;
  height: 54px;
  border: 0;
  background: rgb(24 26 27 / 78%);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 150ms ease;
}
.carousel-button:hover { background: var(--accent); }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.carousel-dots button { width: 34px; height: 4px; padding: 0; border: 0; background: var(--line); cursor: pointer; transition: background 150ms ease; }
.carousel-dots button[data-active] { background: var(--accent); }
.carousel-empty { margin: 0; padding: 48px; background: var(--surface); border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.text-link { color: var(--accent-dark); font-weight: 800; }

/* ------------------------------------------------------- contatti (scura) */

.contact { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(32px, 5vw, 80px); align-items: start; background: var(--metal); color: #fff; }
.contact .eyebrow { color: var(--orange-light); }
.contact > div > p { max-width: 52ch; color: rgb(255 255 255 / 78%); font-size: 1.06rem; }
.contact h2 { margin-bottom: 20px; }
.contact-direct { margin-top: 38px; padding-top: 28px; border-top: 1px solid rgb(255 255 255 / 14%); line-height: 2; }
.contact-direct a { color: #fff; font-size: 1.2rem; font-weight: 800; text-decoration: none; }
.contact-direct a:hover { color: var(--orange-light); }

.contact-form, .admin-panel { display: grid; gap: 18px; padding: clamp(24px, 3vw, 38px); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.contact-form { color: var(--ink); }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 0.84rem; font-weight: 700; }
input, textarea, select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 0; background: #fbfaf7; color: var(--ink); font: inherit; transition: border-color 140ms ease, background 140ms ease; }
input:focus, textarea:focus, select:focus { background: #fff; border-color: var(--accent); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: auto; }
.contact-form small { color: var(--muted); font-weight: 600; }
.contact-form .check a { color: var(--accent-dark); font-weight: 700; }
/* Campo esca del modulo contatti: nascosto alle persone, visibile ai bot. */
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------------------------------- dove trovarci */

.location { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 4vw, 64px); align-items: start; background: var(--surface); }
.contact-details { display: grid; gap: 14px; margin-top: 30px; }
.contact-details article { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line-soft); }
.contact-details span { display: block; margin-bottom: 4px; color: var(--accent-dark); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.contact-details a { display: inline-block; color: var(--ink); font-weight: 800; text-decoration: none; }
.contact-details a:hover { color: var(--accent-dark); }
.contact-details small { display: block; margin-top: 5px; color: var(--muted); font-weight: 500; }

.map-card { background: var(--paper); border: 1px solid var(--line-soft); overflow: hidden; }
.map-card iframe { display: block; width: 100%; height: 520px; border: 0; }

/* ---------------------------------------------------------- piede pagina */

.site-footer { position: relative; overflow: hidden; padding: clamp(44px, 6vw, 70px) var(--pad) 26px; background: var(--metal-2); color: #fff; }
/* Il logo e' un tracciato nero: sul fondo scuro va reso bianco. */
.footer-watermark { position: absolute; right: 3%; bottom: -60px; width: 240px; opacity: 0.06; filter: brightness(0) invert(1); pointer-events: none; }
.footer-main { position: relative; display: grid; grid-template-columns: 1.2fr 0.9fr 1fr; gap: 34px; align-items: start; }
.footer-brand { display: grid; gap: 14px; }
.footer-brand .brand img { filter: brightness(0) invert(1); }
.footer-brand .brand-name b { color: #fff; }
.footer-brand .brand-name small { color: rgb(255 255 255 / 60%); }
.footer-brand p { margin: 0; max-width: 40ch; color: rgb(255 255 255 / 70%); }
.site-footer nav { display: flex; flex-direction: column; gap: 12px; }
.site-footer nav a { color: rgb(255 255 255 / 78%); text-decoration: none; font-weight: 600; }
.site-footer nav a:hover { color: var(--orange-light); }
.footer-contact { display: grid; gap: 10px; color: rgb(255 255 255 / 78%); }
.footer-contact a { color: #fff; font-weight: 700; text-decoration: none; }
.footer-contact a:hover { color: var(--orange-light); }
.site-footer > small { position: relative; display: block; margin-top: 38px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / 14%); color: rgb(255 255 255 / 55%); }
.site-footer > small a { color: rgb(255 255 255 / 78%); }

/* ------------------------------------------------------------ errore 404 */

.error-page { display: grid; align-content: center; min-height: 58vh; max-width: 720px; }
.error-page h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.error-page > p { margin: 20px 0 0; color: var(--muted); font-size: 1.08rem; }
.error-page .button-light { border-color: var(--line); }

/* --------------------------------------------------------------- cookie */

.cookie-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(560px, calc(100% - 36px));
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow);
}
.cookie-panel strong { font-size: 1.05rem; }
.cookie-panel p { margin: 8px 0 0; color: var(--muted); font-size: 0.94rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.cookie-actions .button { min-height: 42px; padding: 10px 18px; }
.cookie-actions a { color: var(--accent-dark); font-weight: 700; }

/* =================================================================
   Area privata: pannello, preventivi, messaggi.
   ================================================================= */

.legal-page, .admin-page { width: min(1100px, calc(100% - 36px)); margin: 0 auto; padding: 70px 0 96px; }
.legal-page h1, .admin-page h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); margin: 0 0 28px; }
.legal-page h2 { margin-top: 34px; font-size: 1.5rem; }
.legal-page p { max-width: 78ch; }
.admin-login { min-height: 70vh; display: grid; place-items: center; }
.admin-login .admin-panel { width: min(460px, 100%); }
.admin-top { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 24px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.admin-nav a { padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); text-decoration: none; font-weight: 800; }
.admin-nav a[aria-current="page"] { background: var(--metal); border-color: var(--metal); color: #fff; }
.quote-section-nav { position: sticky; top: calc(var(--header-h) + 1px); z-index: 10; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; padding: 10px 0; background: var(--paper); }
.quote-section-nav a { padding: 9px 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); text-decoration: none; font-weight: 800; }
.quote-section-nav a[aria-current="page"] { background: var(--metal); border-color: var(--metal); color: #fff; }
.admin-grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 34px; }
.admin-grid-form .wide { grid-column: 1 / -1; }
.admin-list { display: grid; gap: 14px; }
.admin-list article { display: grid; grid-template-columns: 160px 1fr auto; gap: 18px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); }
.admin-list img { width: 160px; aspect-ratio: 4 / 3; object-fit: cover; }
.admin-list h2 { font-size: 1.2rem; margin: 0 0 6px; }
.alert, .success { padding: 12px 14px; font-weight: 700; }
.alert { background: #f7dddd; color: var(--danger); }
.success { background: #dbf1e5; color: var(--success); }
.admin-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.admin-choice-card { display: grid; gap: 12px; min-height: 220px; padding: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.admin-choice-card span { color: var(--accent-dark); font-size: 0.78rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-choice-card strong { font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.05; letter-spacing: -0.03em; }
.admin-choice-card small { align-self: end; color: var(--muted); font-weight: 750; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.quote-form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.quote-section { scroll-margin-top: 140px; }
.quote-note-form { margin: -12px 0 34px; }
.quote-dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.quote-dashboard-grid article { display: grid; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 rgb(22 32 36 / 5%); }
.quote-dashboard-grid span { color: var(--accent-dark); font-weight: 850; text-transform: uppercase; letter-spacing: 0.06em; }
.quote-dashboard-grid strong { font-size: 2.6rem; line-height: 1; }
.quote-dashboard-grid small { color: var(--muted); font-weight: 700; }
.quote-dashboard-grid .is-expired { border-color: rgb(155 47 47 / 34%); }
.quote-dashboard-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.quote-dashboard-columns section { display: grid; align-content: start; gap: 10px; min-height: 230px; padding: 16px; background: #fff; border: 1px solid var(--line); }
.quote-dashboard-columns h3 { font-size: 1.05rem; color: var(--ink-soft); }
.quote-dashboard-columns p { margin: 0; color: var(--muted); }
.quote-dashboard-columns a { display: grid; gap: 2px; padding: 10px; background: var(--paper); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.quote-dashboard-columns a span, .quote-dashboard-columns a small { color: var(--muted); }
.quote-document {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 14px 28px;
  width: 186mm;
  min-height: 273mm;
  padding: 54mm 20mm 34mm;
  margin: 0 0 34px;
  background: #fff url("/assets/images/brand/carta-intestata-1.png") center top / 186mm 273mm no-repeat;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.quote-doc-head { grid-column: 1 / -1; display: grid; justify-items: center; gap: 4px; padding-bottom: 10px; text-align: center; }
.quote-doc-head img { display: none; }
.quote-doc-head strong, .quote-doc-head span, .quote-doc-head small { display: block; }
.quote-doc-head strong, .quote-doc-head span, .quote-doc-head small,
.quote-document section h3,
.quote-client-box p,
.quote-work-box p,
.quote-total-box span,
.quote-total-box strong,
.quote-note-box p {
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}
.quote-doc-head strong, .quote-document section h3, .quote-total-box span { text-transform: none; }
.quote-document section { padding: 12px 0; }
.quote-document section h3 { margin-bottom: 6px; }
.quote-client-box { grid-column: 2; text-align: right; }
.quote-client-box p { margin: 0; }
.quote-work-box { grid-column: 1 / -1; text-align: left; }
.quote-work-box p { width: 100%; margin: 0; }
.quote-total-box { grid-column: 1 / -1; align-self: start; display: grid; justify-items: start; gap: 4px; text-align: left; padding-top: 0 !important; }
.quote-note-box { grid-column: 1; align-self: start; padding: 12px 0 !important; background: transparent; border: 0; }
.quote-note-box p { margin: 0; }
.quote-stamp { grid-column: 2; justify-self: end; align-self: end; width: min(120px, 38%); max-height: 80px; object-fit: contain; margin-top: 16px; }
.quote-doc-footer { display: none; grid-column: 1 / -1; align-self: end; justify-content: center; gap: 16px; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.92rem; }
.quote-doc-footer img { width: 44px; height: 48px; object-fit: contain; }
.quote-doc-footer p { margin: 0; }
.quote-history-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin: 34px 0 16px; }
.quote-history-head h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.quote-history-head p { margin: 0; color: var(--muted); font-weight: 800; }
.quote-list article { grid-template-columns: minmax(0, 1fr) minmax(270px, 0.75fr) auto; align-items: start; }
.quote-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.quote-row-actions form { margin: 0; }
.quote-schedule-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.quote-schedule-form label:nth-of-type(3), .quote-schedule-form button { grid-column: 1 / -1; }
.quote-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quote-table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.quote-table th, .quote-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.quote-table th { color: var(--accent-dark); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; background: var(--paper-2); }
.quote-table td strong, .quote-table td small { display: block; }
.quote-table td small { color: var(--muted); }
.quote-table-form { display: grid; grid-template-columns: 150px 150px 150px auto; gap: 8px; align-items: center; }
.quote-table-form input, .quote-table-form select { padding: 9px 10px; }
.quote-table-form .button, .quote-table-actions .button { min-height: 40px; padding: 8px 11px; }
.quote-table-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.quote-table-actions form { margin: 0; }
.scheduler { display: grid; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-x: auto; }
.scheduler-scale { display: flex; justify-content: space-between; min-width: 620px; color: var(--muted); font-weight: 800; }
.scheduler-empty { margin: 0; color: var(--muted); }
.scheduler-row { display: grid; grid-template-columns: 220px minmax(400px, 1fr); gap: 18px; align-items: center; min-width: 620px; }
.scheduler-row > div:first-child { display: grid; gap: 2px; }
.scheduler-row strong { line-height: 1.1; }
.scheduler-row span { color: var(--muted); }
.scheduler-track { position: relative; min-height: 42px; background: var(--paper-2); border: 1px solid var(--line); }
.scheduler-bar {
  position: absolute;
  left: var(--bar-left);
  width: var(--bar-width);
  top: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 850;
  white-space: nowrap;
}

/* Archivio messaggi in area privata */
.message-counter { align-self: center; color: var(--muted); font-weight: 750; }
.message-list { display: grid; gap: 16px; }
.message-card { display: grid; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.message-card.is-unread { border-left: 4px solid var(--accent); }
.message-card header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.message-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.message-meta { margin: 0; color: var(--muted); font-size: 0.92rem; }
.message-warn { color: var(--danger); font-weight: 700; }
.message-badge { padding: 4px 10px; background: var(--accent); color: #fff; font-size: 0.78rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.message-contacts { margin: 0; font-weight: 750; }
.message-contacts a { color: var(--accent-dark); text-decoration: none; }
.message-text { margin: 0; padding: 14px; background: var(--paper); border: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
.message-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.message-actions .button { min-height: 40px; padding: 8px 14px; }

/* ------------------------------------------------------------- adattivo */

@media (max-width: 1080px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps article:nth-child(3) { border-left: 0; padding-left: 0; }
  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    inset: var(--header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--pad) 26px;
    background: rgb(255 255 255 / 98%);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .site-nav[data-open] { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 1.02rem; }
  .site-nav .nav-cta { margin-top: 18px; border-bottom: 0; }

  .intro, .craft, .contact, .location, .admin-grid-form, .admin-choice-grid,
  .quote-dashboard-grid, .quote-dashboard-columns, .quote-document, .quote-list article { grid-template-columns: 1fr; }
  .quote-client-box, .quote-work-box, .quote-total-box, .quote-note-box, .quote-stamp, .quote-doc-footer { grid-column: 1; }
  .quote-client-box, .quote-total-box { text-align: left; justify-items: start; }
  .quote-document { width: 100%; min-height: auto; padding: 160px 28px 110px; background-size: cover; }

  .craft-media img { min-height: 340px; }
  .carousel-track { min-height: 700px; }
  .carousel-card { grid-template-columns: 1fr; min-height: 680px; }
  .carousel-card img { height: auto; min-height: 0; aspect-ratio: 4 / 3; }
  .carousel-button { width: 46px; height: 46px; }
  .map-card iframe { height: 380px; }
  .hero { min-height: 640px; }
  .hero-overlay { background: linear-gradient(180deg, rgb(15 16 16 / 78%), rgb(15 16 16 / 45%)); }
  .hero-content { margin: 0; padding-left: var(--pad); padding-right: var(--pad); }
  .admin-list article { grid-template-columns: 1fr; }
  .admin-list img { width: 100%; }
}

@media (max-width: 620px) {
  .services, .steps, .footer-main { grid-template-columns: 1fr; }
  .steps article { padding-left: 0 !important; border-left: 0 !important; }
  .hero h1 { font-size: clamp(2.7rem, 12vw, 3.6rem); }
  .hero-actions .button { width: 100%; }
  .site-footer nav { flex-direction: column; align-items: start; }
  .brand-name b { font-size: 1rem; }
  .cookie-panel { right: 0; bottom: 0; width: 100%; }
}

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

@media print {
  @page { size: A4; margin: 12mm; }
  .site-header, .site-footer, .cookie-panel, .admin-top, .admin-nav, .quote-section-nav, .admin-panel, .quote-actions, .quote-list, .quote-table-wrap, .quote-history-head, #dashboard-preventivi, #gestione-preventivi { display: none !important; }
  html, body { width: 210mm; min-height: 297mm; background: #fff; }
  .admin-page { width: 100%; padding: 0; }
  .quote-section { display: block; }
  .quote-document { box-shadow: none; border: 0; margin: 0 auto; break-inside: avoid; }
}
