/*
  Gated Asset v1 — refined modal styling
  Visual language aligned to the existing "Talk to a Data Center Expert" modal.
*/

.gated-asset-modal {
  width: min(820px, calc(100vw - 48px)) !important;
  max-width: 820px !important;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.30);
  overflow: auto;
}

.gated-asset-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

body.gated-asset-modal-open {
  overflow: hidden;
}

.gated-asset-modal-shell {
  position: relative;
  padding: 0;
  background: #ffffff;
  box-sizing: border-box;
}

/* Close control */
.gated-asset-close {
  position: absolute;
  z-index: 100;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff1f1;
  color: #cc0000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 29px;
  font-weight: 400;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
}

.gated-asset-close:hover,
.gated-asset-close:focus-visible {
  background: #ffe3e3;
  color: #a90000;
}

/* ActiveCampaign normalization */
.gated-asset-modal .gated-asset-ac-form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  color: #111111 !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif !important;
}

.gated-asset-modal .gated-asset-ac-form ._form-content {
  position: relative !important;
  width: 100% !important;
  min-height: 430px;
  padding: 32px 28px 30px 250px !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
}

/*
  First AC element contains the form title.
  Turn it into the red title rail used by the Data Center Expert modal.
*/
.gated-asset-modal .gated-asset-ac-form ._form-content > ._form_element:first-child {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 220px !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 28px 16px !important;
  background: #cc0000 !important;
  box-sizing: border-box !important;
}

.gated-asset-modal .gated-asset-ac-form ._form-title {
  margin: 0 !important;
  padding: 0 !important;
  width: 188px !important;
  max-width: 188px !important;
  color: #ffffff !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif !important;
  font-size: 23px !important;
  font-weight: 700 !important;
  line-height: 1.13 !important;
  letter-spacing: -0.2px !important;
  text-align: left !important;
}

/* AC hidden fields occupy no visual space */
.gated-asset-modal .gated-asset-ac-form .ga-hidden-field {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.gated-asset-modal .gated-asset-ac-form ._form_element {
  margin-bottom: 15px !important;
}

.gated-asset-modal .gated-asset-ac-form ._form-label,
.gated-asset-modal .gated-asset-ac-form label,
.gated-asset-modal .gated-asset-ac-form legend {
  color: #111111 !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif !important;
}

/* Inputs */
.gated-asset-modal .gated-asset-ac-form input[type="text"],
.gated-asset-modal .gated-asset-ac-form input[type="email"],
.gated-asset-modal .gated-asset-ac-form input[type="tel"],
.gated-asset-modal .gated-asset-ac-form select,
.gated-asset-modal .gated-asset-ac-form textarea {
  width: 100% !important;
  min-height: 42px !important;
  padding: 9px 11px !important;
  border: 1px solid #aaaaaa !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: #111111 !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
}

/* Full-width email */
.gated-asset-modal .gated-asset-ac-form .ga-field-email,
.gated-asset-modal .gated-asset-ac-form .ga-field-email input {
  width: 100% !important;
}

/* Consent */
.gated-asset-modal .gated-asset-ac-form ._html-code,
.gated-asset-modal .gated-asset-ac-form ._html-code p,
.gated-asset-modal .gated-asset-ac-form ._html-code span,
.gated-asset-modal .gated-asset-ac-form ._html-code a {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.gated-asset-modal .gated-asset-ac-form ._html-code p {
  margin: 5px 0 10px !important;
  max-width: none !important;
}

.gated-asset-modal .gated-asset-ac-form ._checkbox-radio {
  width: auto !important;
  min-width: 58px !important;
  padding-right: 18px !important;
  display: inline-block !important;
}

/* Submit button — rectangular, left aligned */
.gated-asset-modal .gated-asset-ac-form ._button-wrapper {
  clear: both !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

.gated-asset-modal .gated-asset-ac-form ._submit {
  min-width: 190px !important;
  margin: 0 !important;
  padding: 12px 24px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: #cc0000 !important;
  color: #ffffff !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

.gated-asset-modal .gated-asset-ac-form ._submit:hover,
.gated-asset-modal .gated-asset-ac-form ._submit:focus-visible {
  background: #a90000 !important;
}

/* Gate owns the post-submit success state */
.gated-asset-modal .gated-asset-ac-form ._form-thank-you {
  display: none !important;
}

.gated-asset-success[hidden],
.gated-asset-form-panel[hidden] {
  display: none !important;
}

.gated-asset-success {
  padding: 54px 44px 44px;
  text-align: center;
}

.gated-asset-success-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #cc0000;
  color: #ffffff;
  font-size: 30px;
  line-height: 54px;
  text-align: center;
}

.gated-asset-success h2 {
  margin: 0 0 10px;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif;
  font-size: 28px;
  line-height: 1.2;
  color: #111111;
}

.gated-asset-success p {
  margin: 0 auto 22px;
  max-width: 470px;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333333;
}

.gated-asset-view {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 3px;
  background: #cc0000;
  color: #ffffff !important;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
}

.gated-asset-view:hover,
.gated-asset-view:focus-visible {
  background: #a90000;
}

/*
  Hitachi Group Companies tooltip.
  IMPORTANT: the JS now appends this INSIDE the native dialog so it stays
  in the browser top layer and cannot appear behind the form.
*/
.gated-asset-group-tooltip {
  position: absolute;
  z-index: 10000;
  display: none;
  width: 560px;
  max-width: calc(100% - 28px);
  max-height: min(390px, calc(100dvh - 70px));
  overflow-y: auto;
  padding: 16px 18px;
  background: #222222;
  color: #ffffff;
  font-family: "Hitachi Sans", "Noto Sans", Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  border-radius: 5px;
  box-sizing: border-box;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.gated-asset-group-tooltip.is-visible,
.gated-asset-group-tooltip.is-measuring {
  display: block;
}

.gated-asset-group-tooltip.is-measuring {
  visibility: hidden;
  pointer-events: none;
}

.gated-asset-group-tooltip ul {
  margin: 0 !important;
  padding: 0 0 0 18px !important;
  list-style: disc outside !important;
  column-count: 2;
  column-gap: 30px;
  color: #ffffff !important;
}

.gated-asset-group-tooltip li {
  margin: 0 0 5px !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  break-inside: avoid;
}

/* Mobile/tablet: red title rail becomes a top title band */
@media (max-width: 980px) {
  .gated-asset-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .gated-asset-modal .gated-asset-ac-form ._form-content {
    min-height: 0;
    padding: 0 28px 26px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._form-content > ._form_element:first-child {
    position: static !important;
    width: calc(100% + 56px) !important;
    min-height: 0 !important;
    margin: 0 -28px 24px !important;
    padding: 24px 58px 24px 28px !important;
    background: #cc0000 !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._form-title {
    font-size: 24px !important;
    line-height: 1.16 !important;
  }

  .gated-asset-modal .gated-asset-ac-form .ga-field-firstname,
  .gated-asset-modal .gated-asset-ac-form .ga-field-lastname,
  .gated-asset-modal .gated-asset-ac-form .ga-field-email {
    width: 100% !important;
    float: none !important;
  }

  .gated-asset-close {
    top: 9px;
    right: 9px;
    background: rgba(255, 255, 255, 0.95);
  }

  .gated-asset-modal .gated-asset-ac-form ._button-wrapper {
    text-align: left !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._submit {
    min-width: 0 !important;
    width: auto !important;
  }

  .gated-asset-success {
    padding: 48px 22px 34px;
  }

  .gated-asset-group-tooltip {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    max-height: calc(100dvh - 50px) !important;
    padding: 14px 16px !important;
  }

  .gated-asset-group-tooltip ul {
    column-count: 1;
    column-gap: 0;
  }
}


@media (max-width: 600px) {
  .gated-asset-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .gated-asset-modal .gated-asset-ac-form ._form-content {
    padding: 0 18px 22px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._form-content > ._form_element:first-child {
    width: calc(100% + 36px) !important;
    margin: 0 -18px 22px !important;
    padding: 22px 52px 22px 18px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._form-title {
    font-size: 22px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._html-code,
  .gated-asset-modal .gated-asset-ac-form ._html-code p,
  .gated-asset-modal .gated-asset-ac-form ._html-code span,
  .gated-asset-modal .gated-asset-ac-form ._html-code a {
    font-size: 13.5px !important;
    line-height: 1.45 !important;
  }
}


@media (min-width: 981px) {
  .gated-asset-modal .gated-asset-ac-form .ga-field-firstname,
  .gated-asset-modal .gated-asset-ac-form .ga-field-lastname {
    width: 49% !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._html-code {
    width: 100% !important;
  }
}


@media (min-width: 981px) {
  .gated-asset-modal #hitachi-group-company {
    display: inline !important;
    white-space: nowrap !important;
  }
}


@media (min-width: 981px) {
  .gated-asset-modal .gated-asset-ac-form ._form-content {
    width: 100% !important;
    max-width: none !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._html-code,
  .gated-asset-modal .gated-asset-ac-form ._html-code p {
    width: 100% !important;
    max-width: none !important;
  }
}


/* =========================================================
   MOBILE REFINEMENT
   Desktop layout above remains unchanged.
   ========================================================= */
@media (max-width: 600px) {
  .gated-asset-modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._form-content {
    min-height: 0 !important;
    padding: 0 16px 18px !important;
  }

  /* Compact full-width red header */
  .gated-asset-modal .gated-asset-ac-form ._form-content > ._form_element:first-child {
    position: static !important;
    width: calc(100% + 32px) !important;
    min-height: 0 !important;
    margin: 0 -16px 18px !important;
    padding: 17px 54px 17px 16px !important;
    background: #cc0000 !important;
  }

  /*
    IMPORTANT: reset the 188px desktop title width.
    That fixed width was making the mobile header unnecessarily tall.
  */
  .gated-asset-modal .gated-asset-ac-form ._form-title {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: 20px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.1px !important;
  }

  /* Smaller mobile close control */
  .gated-asset-close {
    top: 8px !important;
    right: 8px !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 25px !important;
    line-height: 32px !important;
    background: rgba(255, 255, 255, 0.96) !important;
  }

  /* Keep each field comfortably readable without wasting height */
  .gated-asset-modal .gated-asset-ac-form ._form_element {
    margin-bottom: 12px !important;
  }

  .gated-asset-modal .gated-asset-ac-form input[type="text"],
  .gated-asset-modal .gated-asset-ac-form input[type="email"],
  .gated-asset-modal .gated-asset-ac-form input[type="tel"],
  .gated-asset-modal .gated-asset-ac-form select,
  .gated-asset-modal .gated-asset-ac-form textarea {
    min-height: 40px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }

  /* Compact legal copy while keeping it legible */
  .gated-asset-modal .gated-asset-ac-form ._html-code,
  .gated-asset-modal .gated-asset-ac-form ._html-code p,
  .gated-asset-modal .gated-asset-ac-form ._html-code span,
  .gated-asset-modal .gated-asset-ac-form ._html-code a {
    font-size: 13px !important;
    line-height: 1.38 !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._html-code p {
    margin: 3px 0 8px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._checkbox-radio {
    min-width: 54px !important;
    padding-right: 12px !important;
  }

  /* Full-width CTA is cleaner and easier to tap on mobile */
  .gated-asset-modal .gated-asset-ac-form ._button-wrapper {
    margin-top: 8px !important;
  }

  .gated-asset-modal .gated-asset-ac-form ._submit {
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px 16px !important;
    text-align: center !important;
  }

  /* Keep tooltip usable on small screens */
  .gated-asset-group-tooltip {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    max-height: calc(100dvh - 40px) !important;
    padding: 12px 14px !important;
  }
}


/* =========================================================
   MOBILE HOTFIX
   - Extends the red title band fully behind the close control.
   - Keeps the Hitachi Group Companies tooltip touch-scrollable.
   Desktop/tablet styling is unchanged.
   ========================================================= */
@media (max-width: 600px) {
  .gated-asset-modal .gated-asset-ac-form ._form-content > ._form_element:first-child {
    /*
      The ActiveCampaign form content box is slightly narrower than the
      dialog on mobile. Extend the existing red band to the right without
      changing its dynamic height or title wrapping.
    */
    box-shadow: 64px 0 0 #cc0000 !important;
  }

  .gated-asset-group-tooltip {
    pointer-events: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}


/* =========================================================
   MOBILE: Data Center Expert-style company list overlay
   ========================================================= */
@media (max-width: 600px) {
  .gated-asset-group-tooltip {
    position: absolute !important;
    z-index: 10000 !important;

    display: none !important;

    max-width: none !important;
    max-height: 510px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;

    padding: 14px 18px 16px !important;

    background: #eeeeee !important;
    color: #222222 !important;

    border: 1px solid #cccccc !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22) !important;

    pointer-events: auto !important;
    box-sizing: border-box !important;
  }

  .gated-asset-group-tooltip.is-visible {
    display: block !important;
  }

  .gated-asset-group-tooltip.is-measuring {
    display: block !important;
    visibility: hidden !important;
  }

  .gated-asset-group-tooltip ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  .gated-asset-group-tooltip li {
    margin: 0 0 7px !important;
    padding: 0 !important;

    color: #222222 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;

    break-inside: avoid !important;
  }

  .gated-asset-group-tooltip li:last-child {
    margin-bottom: 0 !important;
  }
}


/* =========================================================
   MOBILE: company overlay dismissal refinement
   ========================================================= */
@media (max-width: 600px) {
  .gated-asset-group-tooltip {
    max-height: 420px !important;
    padding: 38px 18px 16px !important;
  }

  .gated-asset-group-tooltip-close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
    color: #cc0000 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 26px !important;
    text-align: center !important;
    cursor: pointer !important;
  }
}

@media (min-width: 601px) {
  .gated-asset-group-tooltip-close {
    display: none !important;
  }
}
