/* =========================================================================
   BeMyHost — Landing proprietari e investitori
   Stili custom sopra Bootstrap 5.3.8
   I valori derivano dalle variabili del file Figma "LANDING BEMYHOST"
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens
   ---------------------------------------------------------------------- */
:root {
  /* --- Colore --------------------------------------------------------- */
  --bmh-navy:            #001b42; /* surface/base */
  --bmh-navy-deep:       #00122e; /* color/navy/900 */
  --bmh-navy-raised:     #05275a; /* surface/raised + surface/pattern */
  --bmh-cream:           #f0ebdf; /* text/primary + action/primary/bg */
  --bmh-slate:           #a9b6c9; /* text/secondary + border/strong */
  --bmh-red:             #b6313c; /* text/accent + color/red/500 */
  --bmh-red-light:       #e4626d; /* rosso del pittogramma: accenti ed
                                     errori su fondo navy */
  --bmh-border-subtle:   #2a4770; /* border/subtle */

  /* Testo su fondo chiaro (sezione crema) */
  --bmh-ink:             #001b42;
  --bmh-ink-muted:       #2a4770;

  /* --- Tipografia ----------------------------------------------------- */
  --bmh-font-display: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bmh-font-body:    "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bmh-type-d1:      clamp(2rem, 1.257rem + 3.05vw, 4rem);         /* 32 -> 64 */
  --bmh-type-d2:      clamp(1.875rem, 1.06rem + 3.26vw, 3rem);      /* 30 -> 48 */
  --bmh-type-h3:      clamp(1.375rem, 1.19rem + 0.72vw, 1.75rem);   /* 22 -> 28 */
  --bmh-type-lead:    clamp(1.0625rem, 0.99rem + 0.36vw, 1.25rem);  /* 17 -> 20 */
  --bmh-type-base:    1.0625rem;  /* 17 */
  --bmh-type-small:   0.9375rem;  /* 15 */
  --bmh-type-meta:    0.8125rem;  /* 13 */

  /* --- Spazio --------------------------------------------------------- */
  --bmh-space-1: 4px;
  --bmh-space-2: 8px;
  --bmh-space-3: 12px;
  --bmh-space-4: 16px;
  --bmh-space-6: 24px;
  --bmh-space-8: 32px;
  --bmh-space-10: 40px;
  --bmh-space-20: 80px;

  --bmh-section-y:  clamp(4rem, 2.00rem + 8.00vw, 7.5rem);  /* 64 -> 120 */
  --bmh-stack-gap:  clamp(2.5rem, 1.07rem + 5.71vw, 5rem);  /* 40 -> 80 */
  --bmh-block-gap:  clamp(2rem, 1.29rem + 2.86vw, 4rem);    /* 32 -> 64 */

  /* --- Forma ---------------------------------------------------------- */
  --bmh-radius-sm:   8px;
  --bmh-radius-lg:   20px;
  --bmh-radius-pill: 999px;
  --bmh-target-min:  44px;  /* layout/target/min */

  /* --- Motivo ad arco -------------------------------------------------
     Tile ufficiale esportato da Figma (132x126, #05275A). Si ripete da
     solo: nel file grande "Arch Pattern.svg" c'e' lo stesso disegno gia'
     srotolato su 1440x705, qui non serve. */
  --bmh-arch-pattern: url("../img/pattern-arco.svg");

  /* --- Override Bootstrap --------------------------------------------- */
  --bs-body-font-family: var(--bmh-font-body);
  --bs-body-font-size: var(--bmh-type-base);
  --bs-body-line-height: 1.65;
  --bs-body-bg: var(--bmh-navy);
  --bs-body-color: var(--bmh-cream);
  --bs-border-radius: var(--bmh-radius-sm);
  --bs-border-radius-lg: var(--bmh-radius-lg);
  --bs-link-color: var(--bmh-cream);
  --bs-link-hover-color: #ffffff;
  --bs-emphasis-color: var(--bmh-cream);
}

/* -------------------------------------------------------------------------
   2. Base
   ---------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

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

body {
  background-color: var(--bmh-navy);
  color: var(--bmh-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Spazio per la barra CTA fissa su mobile: si attiva da solo se in
   index.html viene ripristinato il markup di .bmh-cta-bar */
@media (max-width: 767.98px) {
  body:has(.bmh-cta-bar) { padding-bottom: 84px; }
}

:focus-visible {
  outline: 3px solid var(--bmh-cream);
  outline-offset: 3px;
  border-radius: var(--bmh-radius-sm);
}

.bmh-section--light :focus-visible { outline-color: var(--bmh-red); }

/* -------------------------------------------------------------------------
   3. Layout
   ---------------------------------------------------------------------- */
/* Contenitore: 1200px di contenuto con 120px di gutter a 1440px, come Figma.
   Il padding assorbe i margini negativi di .row, cosi' le colonne Bootstrap
   restano allineate al bordo del contenuto. */
.bmh-container {
  --bmh-gutter: 48px; /* distanza fra le colonne */
  --bmh-edge: 0px;    /* margine aggiuntivo verso i bordi viewport */
  width: 100%;
  max-width: calc(1200px + var(--bmh-gutter) + var(--bmh-edge) * 2);
  margin-inline: auto;
  padding-inline: calc(var(--bmh-gutter) * .5 + var(--bmh-edge));
}

@media (min-width: 768px)  { .bmh-container { --bmh-edge: 16px; } }
@media (min-width: 992px)  { .bmh-container { --bmh-edge: 40px; } }
@media (min-width: 1280px) { .bmh-container { --bmh-edge: 96px; } }

/* .row ridichiara --bs-gutter-x su se stesso: va riscritto qui */
.bmh-container .row { --bs-gutter-x: var(--bmh-gutter); }

.bmh-section {
  position: relative;
  padding-block: var(--bmh-section-y);
}

.bmh-section--light {
  background-color: var(--bmh-cream);
  color: var(--bmh-ink);
}

/* Fondo navy con motivo ad arco */
.bmh-section--pattern {
  background-color: var(--bmh-navy);
  background-image: var(--bmh-arch-pattern);
  background-size: 132px 126px;
  background-position: center top;
  background-repeat: repeat;
}

/* -------------------------------------------------------------------------
   4. Tipografia
   ---------------------------------------------------------------------- */
.bmh-d1,
.bmh-d2,
.bmh-h3 {
  font-family: var(--bmh-font-display);
  margin: 0;
}

.bmh-d1 {
  font-size: var(--bmh-type-d1);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.031em;
  text-transform: uppercase;
}

.bmh-d2 {
  font-size: var(--bmh-type-d2);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.031em;
  text-transform: uppercase;
}

.bmh-h3 {
  font-size: var(--bmh-type-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.bmh-eyebrow {
  display: block;
  margin: 0 0 var(--bmh-space-4);
  font-family: var(--bmh-font-display);
  font-size: var(--bmh-type-meta);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bmh-red);
}

.bmh-section--pattern .bmh-eyebrow { color: var(--bmh-red-light); }

.bmh-lead  { margin: 0; font-size: var(--bmh-type-lead); line-height: 1.6; }
.bmh-body  { margin: 0; font-size: var(--bmh-type-base); line-height: 1.65; }
.bmh-small { margin: 0; font-size: var(--bmh-type-small); line-height: 1.6; }

.bmh-text-secondary { color: var(--bmh-slate); }
.bmh-section--light .bmh-text-secondary { color: var(--bmh-ink-muted); }

/* Gruppi di paragrafi */
.bmh-prose > * + * { margin-top: var(--bmh-space-6); }

/* Utility di spaziatura sulla scala del design system */
.bmh-mt-4 { margin-top: var(--bmh-space-4); }
.bmh-mt-6 { margin-top: var(--bmh-space-6); }
.bmh-mt-8 { margin-top: var(--bmh-space-8); }

/* -------------------------------------------------------------------------
   5. Logo e pittogramma
   ---------------------------------------------------------------------- */
/* SVG ufficiali esportati da Figma:
   header 196x46 · footer (lockup) 410x96 · pittogramma 72x69 */
/* Header: 140px su mobile, 196px (misura Figma) da tablet in su */
.bmh-header__logo {
  display: block;
  flex: 0 0 auto;
  width: 140px;
  height: auto;
}

@media (min-width: 768px) { .bmh-header__logo { width: 196px; } }

/* Footer: il lockup arriva ai 410px dell'artboard desktop ma non supera
   mai la colonna che lo contiene, altrimenti alle risoluzioni intermedie
   (~992-1200px, dove la colonna scende sotto i 410) sborda sul testo. */
.bmh-footer__logo {
  display: block;
  width: min(100%, 300px);
  height: auto;
}

@media (min-width: 768px) { .bmh-footer__logo { width: min(100%, 410px); } }

/* Pittogramma decorativo */
.bmh-mark { display: block; width: 72px; height: auto; }

/* -------------------------------------------------------------------------
   6. Bottoni
   ---------------------------------------------------------------------- */
.bmh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  padding: var(--bmh-space-3) var(--bmh-space-8);
  border: 1px solid transparent;
  border-radius: var(--bmh-radius-pill);
  font-family: var(--bmh-font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease,
              transform .18s ease, box-shadow .18s ease;
}

.bmh-btn:focus-visible { outline: 3px solid var(--bmh-red-light); outline-offset: 3px; }

.bmh-btn--primary {
  background-color: var(--bmh-cream);
  color: var(--bmh-navy);
}

.bmh-btn--primary:hover {
  background-color: #ffffff;
  color: var(--bmh-navy);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.bmh-btn--primary:active { transform: translateY(0); box-shadow: none; }

.bmh-btn--ghost {
  background-color: transparent;
  border-color: var(--bmh-slate);
  color: var(--bmh-cream);
}

.bmh-btn--ghost:hover { background-color: rgba(240, 235, 223, .1); color: var(--bmh-cream); }

/* -------------------------------------------------------------------------
   7. Header
   ---------------------------------------------------------------------- */
.bmh-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--bmh-navy);
  transition: box-shadow .2s ease, background-color .2s ease;
}

.bmh-header.is-stuck {
  background-color: rgba(0, 18, 46, .94);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.bmh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bmh-space-6);
  min-height: 83px;
}

/* Skip link: visibile solo al focus da tastiera */
.bmh-skip {
  position: absolute;
  top: var(--bmh-space-2);
  left: var(--bmh-space-4);
  z-index: 1040;
  padding: var(--bmh-space-2) var(--bmh-space-4);
  border-radius: var(--bmh-radius-sm);
  background-color: var(--bmh-cream);
  color: var(--bmh-navy);
  font-family: var(--bmh-font-display);
  font-size: var(--bmh-type-small);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .15s ease;
}

.bmh-skip:focus { transform: translateY(0); color: var(--bmh-navy); }

/* -------------------------------------------------------------------------
   8. Immagini ad arco
   ---------------------------------------------------------------------- */
/* Le foto arrivano da Figma gia' ritagliate ad arco, con la trasparenza
   negli angoli: la maschera non va rifatta in CSS, e allo spazio riservato
   durante il caricamento pensano gli attributi width/height della <img>.
   <picture> serve solo a proporre WebP e PNG: display:contents lo toglie
   di mezzo, cosi' a impaginarsi e' direttamente la <img>. */
picture { display: contents; }

.bmh-hero__media,
.bmh-about__media {
  display: block;
  width: 100%;
  height: auto;
}

/* -------------------------------------------------------------------------
   9. Hero
   ---------------------------------------------------------------------- */
.bmh-hero {
  padding-block: clamp(2.5rem, 1.07rem + 5.71vw, 4.25rem)
                 clamp(3rem, 1.29rem + 6.86vw, 6.6875rem);
}

.bmh-hero__text  { max-width: 640px; }
.bmh-hero__lead  { max-width: 560px; }
.bmh-hero__media { max-width: 480px; }

@media (max-width: 991.98px) {
  .bmh-hero__media { max-width: 400px; margin-inline: auto; }
}

/* -------------------------------------------------------------------------
   10. Chi siamo
   ---------------------------------------------------------------------- */
.bmh-about__media { max-width: 500px; }
.bmh-about__text  { max-width: 620px; }

@media (max-width: 991.98px) {
  .bmh-about__media { margin-inline: auto; }
}

/* -------------------------------------------------------------------------
   11. Contatti e form
   ---------------------------------------------------------------------- */
.bmh-invite { max-width: 560px; }

.bmh-form-card {
  max-width: 560px;
  padding: var(--bmh-space-10);
  border-radius: var(--bmh-radius-lg);
  background-color: var(--bmh-navy-raised);
}

@media (max-width: 575.98px) {
  .bmh-form-card { padding: var(--bmh-space-6); }
}

.bmh-field + .bmh-field { margin-top: var(--bmh-space-6); }

.bmh-label {
  display: block;
  margin-bottom: var(--bmh-space-2);
  font-family: var(--bmh-font-body);
  font-size: var(--bmh-type-meta);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bmh-cream);
}

.bmh-required { color: var(--bmh-red-light); }

.bmh-input {
  width: 100%;
  min-height: 51px;
  padding: var(--bmh-space-3) var(--bmh-space-4);
  border: 1px solid var(--bmh-slate);
  border-radius: var(--bmh-radius-sm);
  background-color: transparent;
  color: var(--bmh-cream);
  font-family: var(--bmh-font-body);
  font-size: var(--bmh-type-base);
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.bmh-input::placeholder { color: rgba(240, 235, 223, .55); }
.bmh-input:hover { border-color: var(--bmh-cream); }

.bmh-input:focus {
  outline: none;
  border-color: var(--bmh-cream);
  background-color: rgba(240, 235, 223, .06);
  box-shadow: 0 0 0 3px rgba(240, 235, 223, .25);
  color: var(--bmh-cream);
}

/* Neutralizza il fondo bianco dell'autofill */
.bmh-input:-webkit-autofill,
.bmh-input:-webkit-autofill:hover,
.bmh-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--bmh-cream);
  -webkit-box-shadow: 0 0 0 1000px var(--bmh-navy-raised) inset;
  caret-color: var(--bmh-cream);
}

.bmh-help {
  margin: var(--bmh-space-2) 0 0;
  font-size: var(--bmh-type-small);
  line-height: 1.6;
  color: var(--bmh-slate);
}

/* Campo trappola anti-spam (honeypot): fuori dallo schermo, invisibile
   per persone e screen reader, ma raggiungibile dai bot che compilano
   automaticamente tutti i campi del form. */
.bmh-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  left: -9999px;
}

/* Consenso privacy */
.bmh-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--bmh-space-3);
  margin-top: var(--bmh-space-6);
}

.bmh-checkbox {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--bmh-slate);
  border-radius: var(--bmh-space-1);
  background-color: transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.bmh-checkbox:checked {
  border-color: var(--bmh-cream);
  background-color: var(--bmh-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23001b42' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.4 3 3 6-6.4'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

.bmh-consent__label {
  /* base 0: con flex-wrap attivo l'etichetta deve restare accanto alla
     casella e mandare a capo il proprio testo, non se stessa */
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--bmh-type-small);
  line-height: 1.6;
  color: var(--bmh-slate);
  cursor: pointer;
}

.bmh-consent__label a { color: var(--bmh-cream); text-underline-offset: 3px; }

.bmh-form-card .bmh-btn { width: 100%; margin-top: var(--bmh-space-8); }

/* --- Validazione ------------------------------------------------------
   Pattern .needs-validation / .was-validated di Bootstrap: e' il JS ad
   aggiungere .was-validated al submit. Bootstrap mostra da solo i
   .invalid-feedback (regola `.was-validated :invalid ~ .invalid-feedback`),
   qui si rifanno solo i colori sui token del brand. */
.bmh-form-card { --bs-form-invalid-color: var(--bmh-red-light); }

.invalid-feedback {
  margin-top: var(--bmh-space-2);
  font-size: var(--bmh-type-small);
  line-height: 1.6;
}

.was-validated .bmh-input:invalid,
.was-validated .bmh-checkbox:invalid {
  border-color: var(--bmh-red-light);
}

.was-validated .bmh-input:invalid:focus {
  border-color: var(--bmh-red-light);
  box-shadow: 0 0 0 3px rgba(228, 98, 109, .3);
}

.was-validated .bmh-checkbox:invalid:focus-visible { outline-color: var(--bmh-red-light); }

/* Nel consenso il messaggio va a capo sotto casella ed etichetta */
.bmh-consent { flex-wrap: wrap; }
.bmh-consent .invalid-feedback { flex: 0 0 100%; }

/* -------------------------------------------------------------------------
   12. Footer
   ---------------------------------------------------------------------- */
.bmh-footer {
  padding-block: clamp(3rem, 1.86rem + 4.57vw, 5.5rem) var(--bmh-space-10);
  background-color: var(--bmh-navy-deep);
}

.bmh-footer__list { margin: 0; padding: 0; list-style: none; }
.bmh-footer__list li + li { margin-top: var(--bmh-space-1); }
.bmh-footer__list a { color: var(--bmh-cream); text-decoration: none; text-underline-offset: 3px; }
.bmh-footer__list a:hover { text-decoration: underline; }

.bmh-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--bmh-space-4) var(--bmh-space-8);
  margin-top: clamp(2rem, 1.14rem + 3.43vw, 3.875rem);
  padding-top: var(--bmh-space-6);
  border-top: 1px solid rgba(240, 235, 223, .14);
}

.bmh-legal__links { display: flex; flex-wrap: wrap; gap: var(--bmh-space-4) var(--bmh-space-8); }

.bmh-legal a,
.bmh-legal button {
  display: inline-flex;
  align-items: center;
  min-height: var(--bmh-target-min);
  padding: 0;
  border: 0;
  background: none;
  color: var(--bmh-cream);
  font-family: var(--bmh-font-body);
  font-size: var(--bmh-type-small);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.bmh-legal a:hover,
.bmh-legal button:hover { color: #ffffff; }

/* -------------------------------------------------------------------------
   13. Mobile (< 768px)
   Nell'artboard 390 tutti i blocchi di testo sono centrati e in
   "Chi siamo" la foto sta sotto al testo (gestito in HTML con
   .order-lg-first). Da tablet in su si torna all'allineamento a sinistra.
   ---------------------------------------------------------------------- */
@media (max-width: 767.98px) {

  /* I blocchi hanno un max-width: centrarli richiede anche i margini auto */
  .bmh-hero__text,
  .bmh-hero__lead,
  .bmh-hero__media,
  .bmh-about__text,
  .bmh-about__media,
  .bmh-invite,
  .bmh-mark {
    margin-inline: auto;
  }

  /* Le foto occupano tutta la colonna */
  .bmh-hero__media,
  .bmh-about__media { max-width: 100%; }

  /* In testata il logo prende piu' spazio e la CTA si stringe: va a capo
     su due righe come nell'artboard 390, ma senza dominare la barra. */
  .bmh-header__logo { width: 170px; }

  .bmh-header .bmh-btn {
    padding: var(--bmh-space-2) var(--bmh-space-3);
    min-height: var(--bmh-target-min);
    font-size: var(--bmh-type-small);
    letter-spacing: 0.02em;
    text-align: center;
  }

  .bmh-footer__logo { margin-inline: auto; }

  .bmh-legal {
    flex-direction: column;
    text-align: center;
  }

  .bmh-legal__links {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
}

/* -------------------------------------------------------------------------
   14. Barra CTA fissa (mobile) — markup attualmente commentato in index.html
   ---------------------------------------------------------------------- */
.bmh-cta-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1035;
  display: none;
  padding: var(--bmh-space-3) var(--bmh-space-4)
           calc(var(--bmh-space-3) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--bmh-border-subtle);
  background-color: rgba(0, 18, 46, .96);
  backdrop-filter: blur(8px);
}

.bmh-cta-bar .bmh-btn { width: 100%; }

@media (max-width: 767.98px) {
  .bmh-cta-bar { display: block; }
}
