/* =====================================================================
   MainHeroAI: hero con la ricerca che apre la chat Hubix AI.
   Caricato dalla vista del componente (Views/Shared/Components/MainHeroAI).
   ===================================================================== */

/* Sfondo della sezione che contiene il componente (es. home) */
.bg-hero-ai {
  background: #fff url("../img/hero/home/r-189.png") no-repeat center top / cover;
}

#hero-ai.main-hero-ai {
  --hai-ink: #0d1b3e;
  --hai-blue: var(--color-tertiary);
  --hai-shadow: 0 8px 28px rgba(13, 27, 62, .08);
  padding: 24px 0 5px 0;
}

/* ----- Titolo, testo, immagine ----- */

#hero-ai .hai-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "text visual";
  align-items: center;
  column-gap: 24px;
}

#hero-ai .hai-text { grid-area: text; }

/* Testi: stessi valori di #hero.main-hero in site.css (anche nei media query in fondo) */
#hero-ai .hai-text h1 {
  font-size: 46px;
  font-weight: 700;
  color: var(--color-text);
}

#hero-ai .hai-text span.blu { color: var(--color-tertiary); }
#hero-ai .hai-text span.green { color: var(--color-green-2); }

#hero-ai .hai-text p {
  font-weight: 500;
  font-size: 19px;
  line-height: 1.4;
}

#hero-ai .hai-visual {
  grid-area: visual;
  display: flex;
  align-items: center;
  gap: 8px;
}

#hero-ai .hai-robot {
  width: 330px;
  flex: 0 0 auto;
}

#hero-ai .hai-robot img {
  display: block;
  width: 100%;
  height: auto;
}

#hero-ai .hai-robot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 2px dashed rgba(0, 110, 247, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  color: var(--hai-blue);
  font-size: 96px;
}

#hero-ai .hai-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#hero-ai .hai-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 200px;
  padding: 12px 14px;
  /* border: 1px solid #e3ecfb; */
  border: 1px solid rgba(2, 77, 155, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--hai-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

/* Icone colorate (riquadri e suggerimenti) */
#hero-ai .hai-ico { flex: 0 0 auto; font-size: 22px; line-height: 1; }
#hero-ai .hai-ico--blue { color: var(--hai-blue); }
#hero-ai .hai-ico--green { color: var(--color-green-2); }
#hero-ai .hai-ico--orange { color: #f5a300; }
#hero-ai .hai-ico--dark { color: var(--hai-ink); }

/* Icone immagine (png/svg): stessa misura delle icone font, proporzioni originali */
#hero-ai .hai-ico--img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

#hero-ai .hai-features .hai-ico--img { width: 30px; height: 30px; }

/* ----- Barra di ricerca ----- */

#hero-ai .hai-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  padding: 6px 6px 6px 22px;
  /* border: 1px solid #dbe6f8; */
  /* border: 2px solid var(--border-soft-2, rgba(0, 70, 143, .15)); */
  border: 1px solid rgba(2, 77, 155, 0.18);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(0, 70, 143, .12);
  transition: border-color .2s, box-shadow .2s;
}

#hero-ai .hai-search:focus-within {
  border-color: var(--hai-blue);
  box-shadow: 0 10px 34px rgba(0, 110, 247, .2);
}

#hero-ai .hai-search-spark {
  font-size: 20px;
  line-height: 1;
  color: var(--hai-blue);
}

#hero-ai .hai-search-label {
  margin: 0;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  color: var(--hai-blue);
  cursor: text;
}

/* styleCA.css forza input e button a 16px !important su tutto il sito */
#hero-ai .hai-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px !important; /* 16px come la barra di MainHero (e niente zoom automatico su iOS) */
  color: var(--hai-ink);
}

#hero-ai .hai-search input::placeholder { color: #7a8599; opacity: 1; }
#hero-ai .hai-search input::-webkit-search-cancel-button { cursor: pointer; }

#hero-ai .hai-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 84px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hai-blue);
  color: #fff;
  transition: background-color .2s;
}

#hero-ai .hai-search-submit:hover { background: var(--color-primary); }
#hero-ai .hai-search-submit i { font-size: 27px !important; line-height: 1; }

/* ----- Prova a chiedere ----- */

#hero-ai .hai-suggestions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

#hero-ai .hai-suggestions-title {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
}

#hero-ai .hai-suggestions ul {
  display: flex;
  flex: 1 1 auto;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#hero-ai .hai-suggestions li { flex: 1 1 0; min-width: 0; }

#hero-ai .hai-suggestions a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 10px 14px;
  /* border: 1px solid #e3ecfb; */
  border: 1px solid rgba(2, 77, 155, 0.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(13, 27, 62, .05);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--hai-ink);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

#hero-ai .hai-suggestions a:hover,
#hero-ai .hai-suggestions a:focus-visible {
  border-color: var(--hai-blue);
  box-shadow: var(--hai-shadow);
  color: var(--hai-ink);
  transform: translateY(-1px);
}

/* ----- Responsive (titolo e testo seguono #hero.main-hero in site.css) ----- */

@media (max-width: 1399.98px) {
  #hero-ai .hai-robot { width: 280px; }
}

/* Solo tra xl e xxl: icone immagine un po' più grandi */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  #hero-ai .hai-ico--img { width: 36px; height: 36px; }
}

/* Sotto xl i suggerimenti vanno a capo */
@media (max-width: 1199.98px) {
  #hero-ai .hai-suggestions { align-items: flex-start; flex-direction: column; gap: 10px; }
  #hero-ai .hai-suggestions ul { flex-wrap: wrap; }
  #hero-ai .hai-suggestions li { flex: 0 0 auto; }
}

/* Titolo tra 991 e 1200px come #hero.main-hero */
@media (min-width: 991px) and (max-width: 1200px) {
  #hero-ai .hai-text h1 { font-size: 38px; }
}

/* Sotto lg niente riquadri accanto al robot; testi come #hero.main-hero */
@media (max-width: 991px) {
  #hero-ai .hai-features { display: none; }
  #hero-ai .hai-text h1 { font-size: 34px; }
  #hero-ai .hai-text p { font-size: 15px; line-height: 1.6; }
  #hero-ai .hai-robot { width: 200px; }
}

/* Mobile: robot accanto al titolo, paragrafi sotto a tutta larghezza; suggerimenti in colonna */
@media (max-width: 767.98px) {
  #hero-ai.main-hero-ai { padding: 24px 0 28px; }

  /* .hai-text sparisce dalla griglia: titolo e paragrafi diventano elementi della griglia */
  #hero-ai .hai-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: none;
    align-items: start;
    column-gap: 8px;
  }

  #hero-ai .hai-text { display: contents; }
  #hero-ai .hai-text h1 { grid-column: 1; grid-row: 1; align-self: center; }
  #hero-ai .hai-text p { grid-column: 1 / -1; }

  #hero-ai .hai-visual { grid-area: auto; grid-column: 2; grid-row: 1; margin-top: 0; }
  #hero-ai .hai-robot { width: 150px; }
  #hero-ai .hai-robot-placeholder { font-size: 56px; }

  #hero-ai .hai-search { margin-top: 20px; padding-left: 16px; }
  #hero-ai .hai-search-label { display: none; }
  #hero-ai .hai-search-submit { width: 60px; }
  #hero-ai .hai-search-submit i { font-size: 18px !important; line-height: 1;}
  #hero-ai .hai-ico--img { width: 28px; height: 32px; }

  #hero-ai .hai-suggestions { margin-top: 18px; }
  #hero-ai .hai-suggestions ul { flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; }
  #hero-ai .hai-suggestions li { max-width: 100%; }
  #hero-ai .hai-suggestions li:nth-child(n+5) { display: none; }
  #hero-ai .hai-suggestions a { padding: 8px 16px; border-radius: 999px; }
  #hero-ai .hai-suggestions a br { display: none; }
}

/* Telefoni stretti: titolo più piccolo e robot meno ingombrante */
@media (max-width: 385px) {
  #hero-ai .hai-text h1 { font-size: 25px; }
  #hero-ai .hai-robot { width: 115px; }
  #hero-ai .hai-robot-placeholder { font-size: 44px; }
}
