/*
 * DG Customer Chat v1.3.5 — Final Hero Spacing
 * Homepage presentation only. Search/chat business logic stays in dgcustomerchat.js + backend classes.
 */

/* The legacy IQIT banner is reused by this module as a CSS background. */
body#index img[alt="fon fitrado"] {
  display: none !important;
}

.dg-home-v2,
.dg-home-v2 * {
  box-sizing: border-box;
}

.dgchat-home-cta-slot {
  margin-bottom: 0 !important;
}

.dg-home-v2 {
  --dg-home-primary: var(--dgchat-primary, #0b3a78);
  --dg-home-accent: var(--dgchat-accent, #1b7fce);
  --dg-home-text: #ffffff;
  --dg-home-muted: rgba(255, 255, 255, .84);
  width: 100%;
  max-width: 1320px;
  margin: 6px auto 8px;
  border: 1px solid rgba(11, 58, 120, .13);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(12, 30, 55, .10);
  overflow: hidden;
  isolation: isolate;
}

.dg-home-v2__inner {
  position: relative;
  min-height: 252px;
  overflow: hidden;
  background: #0a2f62;
}

/* The source image is a wide banner, so the lower hero height now matches its natural aspect much better. */
.dg-home-v2__visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: right center;
  transform: scale(1.006);
  transform-origin: right center;
  filter: saturate(1.02) contrast(1.04) brightness(1.08);
}

/* Strong contrast under text, rapidly fading into a visible vehicle on the right. */
.dg-home-v2__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 11% 3%, rgba(55, 139, 224, .18), transparent 34%),
    linear-gradient(90deg,
      rgba(4, 26, 55, .99) 0%,
      rgba(6, 37, 75, .98) 36%,
      rgba(7, 44, 86, .92) 53%,
      rgba(6, 37, 73, .62) 66%,
      rgba(4, 25, 51, .28) 80%,
      rgba(3, 18, 38, .08) 100%);
}

.dg-home-v2__content {
  position: relative;
  z-index: 2;
  width: min(84%, 930px);
  padding: 21px 30px 17px;
}

.dg-home-v2__eyebrow {
  margin: 0 0 6px;
  color: #a9d7ff;
  font-size: 9.5px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.dg-home-v2__title {
  max-width: 760px;
  margin: 0;
  color: var(--dg-home-text) !important;
  font-size: clamp(31px, 2.65vw, 40px);
  line-height: 1.04;
  font-weight: 750;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.dg-home-v2__description {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--dg-home-muted);
  font-size: 13.25px;
  line-height: 1.42;
}

.dg-home-v2__search {
  width: 100%;
  max-width: 830px;
  margin: 12px 0 0;
}

.dg-home-v2__searchbox {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 50px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .27);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 19px rgba(0, 0, 0, .16);
}

.dg-home-v2__input,
.dg-home-v2 .dgchat-home-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 0 !important;
  border-radius: 7px !important;
  outline: 0 !important;
  background: #fff !important;
  color: #1f2937 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}

.dg-home-v2__input::placeholder {
  color: #8a94a3;
  opacity: 1;
}

.dg-home-v2__input:focus {
  box-shadow: inset 0 0 0 2px rgba(27, 127, 206, .20) !important;
}

.dg-home-v2__submit,
.dg-home-v2 .dg-home-v2__submit {
  position: relative;
  flex: 0 0 auto;
  min-width: 148px;
  height: 40px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: var(--dg-home-accent) !important;
  color: #fff !important;
  box-shadow: 0 5px 12px rgba(4, 43, 84, .18) !important;
  cursor: pointer;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.dg-home-v2__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 7px 15px rgba(4, 43, 84, .24) !important;
}

.dg-home-v2__submit:focus-visible,
.dg-home-v2__assistant-btn:focus-visible {
  outline: 3px solid rgba(158, 209, 255, .82) !important;
  outline-offset: 3px;
}

.dg-home-v2__submit:disabled {
  cursor: wait;
  opacity: .78;
}

.dg-home-v2__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dg-home-v2-spin .7s linear infinite;
}

.dg-home-v2__submit.is-loading .dg-home-v2__submit-icon {
  display: none;
}

.dg-home-v2__submit.is-loading .dg-home-v2__spinner {
  display: inline-block;
}

@keyframes dg-home-v2-spin {
  to { transform: rotate(360deg); }
}

.dg-home-v2__utility-row {
  width: 100%;
  max-width: 830px;
  min-height: 29px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.dg-home-v2__search-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.80);
  font-size: 9.75px;
  line-height: 1.25;
}

.dg-home-v2__ai-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dg-home-v2__ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(158, 209, 255, .30);
  border-radius: 999px;
  background: rgba(158, 209, 255, .10);
  color: #c4e4ff;
  font-size: 7.8px;
  font-weight: 900;
  letter-spacing: .045em;
}

.dg-home-v2__status {
  color: #d7eaff;
  font-weight: 700;
  white-space: nowrap;
}

.dg-home-v2__status:empty {
  display: none;
}

.dg-home-v2__status.is-error {
  color: #ffd0d0;
}

.dg-home-v2__assistant-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: rgba(255,255,255,.76);
  font-size: 9.75px;
  line-height: 1.2;
  white-space: nowrap;
}

.dg-home-v2 .dg-home-v2__assistant-btn,
.dg-home-v2 .dgchat-open.dg-home-v2__assistant-btn {
  flex: 0 0 auto;
  min-height: 29px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 7px;
  background: rgba(255,255,255,.075);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  font-size: 8.5px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease;
}

.dg-home-v2 .dg-home-v2__assistant-btn:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.43);
}

.dg-home-v2__trust {
  min-height: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  background: #fff;
  color: #344054;
  border-top: 1px solid #edf1f4;
}

.dg-home-v2__trust > span {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 10.25px;
  font-weight: 700;
  text-align: center;
}

.dg-home-v2__trust i {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eaf4fd;
  color: var(--dg-home-primary);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

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

/*
 * v1.3.5 — Final hero spacing fix.
 * Confirmed in DevTools on the production IQIT/Elementor wrapper:
 * .elementor-element-h1v4gms > .elementor-element-populated
 * The original 8em bottom padding (~112px) caused the oversized gap below the hero.
 * Keep Elementor's existing top padding and only reduce the bottom padding to 2em (~28px).
 */
body#index .elementor-element.elementor-element-h1v4gms > .elementor-element-populated {
  padding-bottom: 2em !important;
}

@media (max-width: 1199px) {
  .dg-home-v2 {
    margin-top: 5px;
    border-radius: 15px;
  }

  .dg-home-v2__inner {
    min-height: 248px;
  }

  .dg-home-v2__content {
    width: min(88%, 870px);
    padding: 20px 27px 16px;
  }

  .dg-home-v2__title {
    max-width: 720px;
    font-size: clamp(30px, 3.15vw, 37px);
  }

  .dg-home-v2__description {
    max-width: 700px;
    font-size: 12.9px;
  }

  .dg-home-v2__search,
  .dg-home-v2__utility-row {
    max-width: 780px;
  }
}

@media (max-width: 959px) {
  .dg-home-v2__inner {
    min-height: 0;
  }

  .dg-home-v2__visual {
    background-position: 70% center;
    filter: saturate(1) contrast(1.03) brightness(1.03);
  }

  .dg-home-v2__overlay {
    background: linear-gradient(90deg,
      rgba(5, 27, 57, .99) 0%,
      rgba(7, 39, 79, .97) 50%,
      rgba(8, 48, 94, .82) 73%,
      rgba(5, 25, 52, .42) 100%);
  }

  .dg-home-v2__content {
    width: min(94%, 780px);
    padding: 20px 24px 17px;
  }

  .dg-home-v2__title {
    font-size: clamp(29px, 4vw, 35px);
  }

  .dg-home-v2__search,
  .dg-home-v2__utility-row {
    max-width: 700px;
  }

  .dg-home-v2__assistant-inline > span {
    display: none;
  }
}

@media (max-width: 767px) {
  body#index img[alt="fon fitrado"] {
    display: none !important;
  }

  .dg-home-v2 {
    width: calc(100% - 24px);
    margin: 7px auto 12px;
    border-radius: 14px;
    box-shadow: 0 9px 25px rgba(12, 30, 55, .11);
  }

  .dg-home-v2__visual {
    opacity: .40;
    background-position: 70% center;
  }

  .dg-home-v2__overlay {
    background: linear-gradient(90deg,
      rgba(5, 27, 57, .99) 0%,
      rgba(7, 39, 79, .96) 63%,
      rgba(7, 39, 79, .78) 100%);
  }

  .dg-home-v2__content {
    width: 100%;
    padding: 21px 17px 17px;
  }

  .dg-home-v2__eyebrow {
    margin-bottom: 6px;
    font-size: 8.8px;
    letter-spacing: .08em;
  }

  .dg-home-v2__title {
    max-width: 520px;
    font-size: 28px;
    line-height: 1.055;
  }

  .dg-home-v2__description {
    margin-top: 8px;
    font-size: 13.2px;
    line-height: 1.42;
  }

  .dg-home-v2__search {
    margin-top: 13px;
  }

  .dg-home-v2__searchbox {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    flex-direction: column;
    gap: 8px;
  }

  .dg-home-v2__input,
  .dg-home-v2 .dgchat-home-input {
    height: 49px !important;
    padding: 0 13px !important;
    border: 1px solid rgba(255,255,255,.28) !important;
    border-radius: 10px !important;
    box-shadow: 0 7px 18px rgba(0,0,0,.13) !important;
    font-size: 15px !important;
  }

  .dg-home-v2__submit,
  .dg-home-v2 .dg-home-v2__submit {
    width: 100%;
    min-width: 0;
    height: 47px !important;
    border-radius: 10px !important;
    font-size: 10.5px !important;
  }

  .dg-home-v2__utility-row {
    min-height: 0;
    margin-top: 8px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .dg-home-v2__search-meta {
    min-height: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .dg-home-v2__ai-note,
  .dg-home-v2__status {
    white-space: normal;
  }

  .dg-home-v2__assistant-inline {
    width: 100%;
    justify-content: flex-start;
  }

  .dg-home-v2__assistant-inline > span {
    display: inline;
    white-space: normal;
  }

  .dg-home-v2 .dg-home-v2__assistant-btn,
  .dg-home-v2 .dgchat-open.dg-home-v2__assistant-btn {
    min-height: 38px;
    margin-left: auto;
    padding: 0 10px;
  }

  .dg-home-v2__trust {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dg-home-v2__trust > span {
    min-height: 40px;
    padding: 6px 8px;
    border-bottom: 1px solid #f0f2f4;
    font-size: 10.25px;
  }

  .dg-home-v2__trust > span:nth-last-child(-n+2) {
    border-bottom: 0;
  }

}

@media (max-width: 430px) {
  .dg-home-v2 {
    width: calc(100% - 16px);
  }

  .dg-home-v2__content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dg-home-v2__title {
    font-size: 26.5px;
  }

  .dg-home-v2__description {
    font-size: 13px;
  }

  .dg-home-v2__assistant-inline {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .dg-home-v2 .dg-home-v2__assistant-btn,
  .dg-home-v2 .dgchat-open.dg-home-v2__assistant-btn {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dg-home-v2__submit,
  .dg-home-v2__assistant-btn {
    transition: none !important;
  }

  .dg-home-v2__spinner {
    animation-duration: 1.2s;
  }
}
