/* ==========================================================================
   OBI Elettrica, pagina coming soon
   Colori campionati dalla brochure 2024, font self-hosted (nessuna chiamata
   a Google Fonts: niente trasferimento di IP verso terzi, niente banner).
   ========================================================================== */

@font-face {
  font-family: "Michroma";
  src: url("../fonts/michroma-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #19325b;       /* fondo pagine brochure */
  --navy-deep: #112447;  /* fasce secondarie */
  --yellow: #fecd3a;     /* blocchi gialli brochure */
  --white: #ffffff;
  --mist: #c5cfe0;       /* testo secondario su navy */
  --line: #c3cbd9;       /* bordi campi su bianco */
  --paper: #f4f6f9;
  --error: #b3261e;

  --display: "Michroma", "Eurostile", "Microgramma", "Arial Black", sans-serif;
  --body: "Roboto", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --maxw: 76rem;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--navy);
  background: var(--white);
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--yellow); }

.nw { white-space: nowrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--yellow); color: var(--navy);
  padding: 0.6rem 1rem; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Tipografia display ---------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0;
}

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

.btn {
  display: inline-flex; align-items: center; gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--body); font-size: 1rem; font-weight: 700;
  line-height: 1.2; text-decoration: none;
  border: 2px solid transparent; border-radius: 0;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { flex: none; width: 1.15rem; height: 1.15rem; }
.btn small { font-weight: 400; font-size: 0.85rem; opacity: 0.8; }

.btn--yellow { background: var(--yellow); color: var(--navy); }
.btn--yellow:hover { background: var(--white); }

.btn--ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.55); }
.btn--ghost:hover { border-color: var(--yellow); color: var(--yellow); }

.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-deep); color: var(--yellow); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: auto 1fr auto;
  min-height: min(56rem, 100svh);
  background: var(--navy);
  color: var(--white);
}

.hero__brand {
  grid-column: 1; grid-row: 1;
  padding: clamp(1.5rem, 3.5vw, 2.75rem) var(--gutter) 0;
}
.hero__brand img { width: clamp(15rem, 26vw, 21rem); }

.hero__copy {
  grid-column: 1; grid-row: 2;
  align-self: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 4rem) clamp(3rem, 6vw, 4rem) var(--gutter);
  max-width: 44rem;
}

.hero__title {
  font-size: clamp(1.9rem, 3.6vw, 3.15rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.hero__lead {
  margin: 1.75rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  color: var(--mist);
}

.hero__actions {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  margin-top: 2.5rem;
}

.hero__media {
  grid-column: 2; grid-row: 1 / 4;
  margin: 0;
  position: relative;
  min-height: 22rem;
}
.hero__media picture,
.hero__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero__media img { object-fit: cover; object-position: 86% 40%; }

/* Il blocco giallo che scavalca la foto: citazione diretta della brochure */
.hero__cert {
  grid-column: 2; grid-row: 3;
  position: relative; z-index: 1;
  justify-self: start;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem) calc(-1 * clamp(4rem, 9vw, 9rem));
  padding: 1.35rem clamp(1.5rem, 3vw, 2.25rem);
  background: var(--yellow);
  color: var(--navy);
  transform-origin: left center;
  animation: cert-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
}
.hero__cert p {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  letter-spacing: 0.06em;
  line-height: 1.7;
  white-space: nowrap;
}

@keyframes cert-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* ==========================================================================
   Ambiti
   ========================================================================== */

.ambiti {
  background: var(--navy-deep);
  color: var(--white);
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter);
}
.ambiti__inner { max-width: var(--maxw); margin: 0 auto; }

.ambiti__title {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--yellow);
}

.ambiti__list {
  list-style: none; margin: 2.25rem 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem clamp(1.25rem, 2.5vw, 2.5rem);
}
.ambiti__list li {
  border-top: 2px solid var(--yellow);
  padding-top: 1.1rem;
}
.ambiti__list h3 {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: 0.86rem; line-height: 1.5; letter-spacing: 0.03em;
}
.ambiti__list p {
  margin: 0.6rem 0 0;
  font-size: 0.95rem; line-height: 1.5;
  color: var(--mist);
}

/* ==========================================================================
   Contatti + modulo
   ========================================================================== */

.contatti {
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
  scroll-margin-top: 0;
}
.contatti__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(3rem, 7vw, 7rem);
}

.contatti h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  margin-bottom: 2.25rem;
}

.recapito + .recapito { margin-top: 2.25rem; }
.recapito h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem; font-weight: 700;
}
.recapito p { margin: 0; }
.recapito address { font-style: normal; }

.persona {
  margin-top: 1.1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--yellow);
}
.persona__nome { font-weight: 700; }
.persona__titoli { font-size: 0.95rem; color: #3f5478; }
.persona__recapiti { margin-top: 0.35rem !important; }

.contatti__lista { list-style: none; margin: 0; padding: 0; }
.contatti__lista li + li { margin-top: 0.15rem; }

/* ---------- Modulo ---------- */

.form-panel {
  background: var(--paper);
  padding: clamp(1.75rem, 4vw, 3rem);
}
.form-panel__intro { margin: -1.25rem 0 2rem; color: #3f5478; max-width: 36rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }

.field label { font-weight: 500; font-size: 0.95rem; }
.field .req { color: var(--navy); font-weight: 700; }

.field input,
.field textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--line); border-radius: 0;
  padding: 0.75rem 0.85rem;
  transition: border-color 0.15s;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:hover,
.field textarea:hover { border-color: #8f9bb3; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.field input:user-invalid,
.field textarea:user-invalid { border-color: var(--error); }

.field-hint { font-size: 0.85rem; color: var(--error); min-height: 0; }

.consenso {
  grid-column: 1 / -1;
  display: flex; gap: 0.7rem; align-items: flex-start;
  font-size: 0.95rem;
}
.consenso input {
  flex: none; width: 1.15rem; height: 1.15rem; margin: 0.18rem 0 0;
  accent-color: var(--navy);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
  margin-top: 0.5rem;
}
.form-note { font-size: 0.85rem; color: #3f5478; margin: 0; }

.form-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.9rem 1rem;
  font-weight: 500;
}
.form-status:empty { display: none; }
.form-status[data-state="ok"] { background: var(--white); border-left: 4px solid var(--yellow); }
.form-status[data-state="error"] { background: #fdeceb; border-left: 4px solid var(--error); color: var(--error); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--navy);
  color: var(--mist);
  padding: 2rem var(--gutter);
  font-size: 0.9rem;
}
.footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem;
}
.footer p { margin: 0; }
.footer a { color: var(--white); }

/* ==========================================================================
   Pagine di testo (privacy, esito invio senza JS)
   ========================================================================== */

.page-header {
  background: var(--navy); color: var(--white);
  padding: 1.75rem var(--gutter);
}
.page-header img { width: 15rem; }

.page-body {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}
.page-body h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin-bottom: 1.5rem; }
.page-body h2 { font-size: 1.15rem; margin: 2.25rem 0 0.5rem; }
.page-body p, .page-body li { max-width: 68ch; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 72rem) {
  .ambiti__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    min-height: 0;
  }
  .hero__brand { grid-column: 1; grid-row: 1; }
  .hero__copy { grid-column: 1; grid-row: 2; padding-right: var(--gutter); }
  .hero__media { grid-column: 1; grid-row: 3; aspect-ratio: 4 / 3; min-height: 0; }
  .hero__cert {
    grid-column: 1; grid-row: 4;
    margin: calc(-1 * clamp(2rem, 8vw, 3.5rem)) var(--gutter) 2.5rem;
    justify-self: stretch;
  }
  .hero__cert p { white-space: normal; }

  .contatti__inner { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
  .ambiti__list { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__cert { animation: none; }
  .btn { transition: none; }
}
