/* ========================================
   MARKETO FORM CUSTOMIZATION - LP HR Inframodernization 2025
   ======================================== */

/* Marketo Form Base */
.mktoForm {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--font-family-primary) !important;
  }
  
  /* Form Rows */
  .mktoForm .mktoFormRow {
    margin-bottom: 0 !important;
    width: 100% !important;
  }
  
  /* Hide hidden fields completely - no space taken */
  .mktoForm .mktoFormRow:has(input[type="hidden"]) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    line-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
  }
  
  .mktoForm input[type="hidden"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -99999px !important;
  }
  
  /* Force hidden rows to not take space */
  .mktoForm .mktoFormRow[style*="margin-bottom"]:has(input[type="hidden"]) {
    margin-bottom: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
  }
  
  /* Remove offset and gutter */
  .mktoForm .mktoOffset {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .mktoForm .mktoOffset[style] {
    display: none !important;
    width: 0 !important;
  }
  
  .mktoForm .mktoGutter {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .mktoForm .mktoGutter[style] {
    display: none !important;
    width: 0 !important;
  }
  
  .mktoForm .mktoAsterix {
    display: none !important;
  }
  
  /* Field wrap */
  .mktoForm .mktoFieldWrap {
    width: 100% !important;
  }
  
  .mktoForm .mktoFormCol {
    width: 100% !important;
    margin: 0 0 12px 0 !important;
  }
  
  .mktoForm .mktoFormCol[style*="margin-bottom"] {
    margin-bottom: 12px !important;
  }
  
  /* Hide labels but keep for accessibility */
  .mktoForm .mktoLabel {
    font-family: var(--font-family-primary);
    color: var(--color-text-black);
    line-height: 1.5;
    letter-spacing: 0.29px;
    font-size: 12px;
    display: none !important;
  }
  
  /* Input and Select Styling - Estilo Infraestrutura TI */
  .mktoForm input[type='date'],
  .mktoForm input[type='email'],
  .mktoForm input[type='number'],
  .mktoForm input[type='tel'],
  .mktoForm input[type='text'],
  .mktoForm input[type='url'],
  .mktoForm select.mktoField,
  .mktoForm textarea.mktoField {
    width: 100% !important;
    height: 40px !important;
    border: solid 1px #c7c7c7 !important;
    font-family: var(--font-family-primary) !important;
    color: var(--color-text-black) !important;
    font-size: 14px !important;
    padding-left: 16px !important;
    font-weight: 500 !important;
    line-height: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
    background-color: var(--color-bg-white) !important;
  }
  
  /* Placeholder styling */
  .mktoForm input[type='date']::-webkit-input-placeholder,
  .mktoForm input[type='email']::-webkit-input-placeholder,
  .mktoForm input[type='number']::-webkit-input-placeholder,
  .mktoForm input[type='tel']::-webkit-input-placeholder,
  .mktoForm input[type='text']::-webkit-input-placeholder,
  .mktoForm input[type='url']::-webkit-input-placeholder,
  .mktoForm select.mktoField::-webkit-input-placeholder,
  .mktoForm textarea.mktoField::-webkit-input-placeholder {
    color: #7a7a7a !important;
  }
  
  .mktoForm input[type='date']:-ms-input-placeholder,
  .mktoForm input[type='email']:-ms-input-placeholder,
  .mktoForm input[type='number']:-ms-input-placeholder,
  .mktoForm input[type='tel']:-ms-input-placeholder,
  .mktoForm input[type='text']:-ms-input-placeholder,
  .mktoForm input[type='url']:-ms-input-placeholder,
  .mktoForm select.mktoField:-ms-input-placeholder,
  .mktoForm textarea.mktoField:-ms-input-placeholder {
    color: #7a7a7a !important;
  }
  
  .mktoForm input[type='date']::-ms-input-placeholder,
  .mktoForm input[type='email']::-ms-input-placeholder,
  .mktoForm input[type='number']::-ms-input-placeholder,
  .mktoForm input[type='tel']::-ms-input-placeholder,
  .mktoForm input[type='text']::-ms-input-placeholder,
  .mktoForm input[type='url']::-ms-input-placeholder,
  .mktoForm select.mktoField::-ms-input-placeholder,
  .mktoForm textarea.mktoField::-ms-input-placeholder {
    color: #7a7a7a !important;
  }
  
  .mktoForm input[type='date']::placeholder,
  .mktoForm input[type='email']::placeholder,
  .mktoForm input[type='number']::placeholder,
  .mktoForm input[type='tel']::placeholder,
  .mktoForm input[type='text']::placeholder,
  .mktoForm input[type='url']::placeholder,
  .mktoForm select.mktoField::placeholder,
  .mktoForm textarea.mktoField::placeholder {
    color: #7a7a7a !important;
  }
  
  /* Select Styling - Estilo Infraestrutura TI */
  .mktoForm select.mktoField {
    background: var(--color-bg-white) url(https://pages.lenovo.com/rs/183-WCT-620/images/lpthinkmarketo_seta-select.svg) top 50% right 16px no-repeat !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 40px !important;
    cursor: pointer !important;
  }
  
  /* Textarea */
  .mktoForm textarea.mktoField {
    padding-top: 15px !important;
    min-height: 100px !important;
    resize: vertical !important;
    height: auto !important;
  }
  
  /* Focus State */
  .mktoForm input[type='date']:focus,
  .mktoForm input[type='email']:focus,
  .mktoForm input[type='number']:focus,
  .mktoForm input[type='tel']:focus,
  .mktoForm input[type='text']:focus,
  .mktoForm input[type='url']:focus,
  .mktoForm select.mktoField:focus,
  .mktoForm textarea.mktoField:focus {
    outline: none !important;
    border-color: var(--color-primary-blue) !important;
  }
  
  /* Button Row */
  .mktoForm .mktoButtonRow {
    width: 100% !important;
    margin: 0 !important;
  }
  
  .mktoForm .mktoButtonWrap {
    width: 100% !important;
    margin: 0 !important;
  }
  
  .mktoForm .mktoButtonWrap[style*="margin-left"] {
    margin-left: 0 !important;
  }
  
  .mktoForm .mktoButtonWrap .mktoButton {
    background: var(--color-cta-red) !important;
    font-family: var(--font-family-primary) !important;
    border: none !important;
    width: 100% !important;
    font-size: 20px !important;
    color: var(--color-text-white) !important;
    font-weight: 900 !important;
    text-align: center !important;
    height: 64px !important;
    text-transform: uppercase !important;
    line-height: 2 !important;
    margin: 2px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    box-sizing: border-box !important;
  }
  
  .mktoForm .mktoButtonWrap .mktoButton:hover {
    background: var(--color-primary-blue) !important;
    opacity: 0.9 !important;
  }
  
  .mktoForm .mktoButtonWrap .mktoButton:active {
    opacity: 0.8 !important;
  }
  
  .mktoForm .mktoButtonWrap .mktoButton:focus-visible {
    outline: 2px solid var(--color-primary-blue) !important;
    outline-offset: 2px !important;
  }
  
  /* Checkbox and Privacy Policy */
  .mktoCheckboxList {
    position: absolute;
    left: 0;
    top: 2px;
  }
  
  .mktoForm input[type="checkbox"] {
    width: auto !important;
    margin-right: 0.5rem !important;
    vertical-align: middle !important;
  }
  
  .mktoForm .mktoLogicalField {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
  
  .mktoForm .mktoLogicalField input[type="checkbox"] {
    flex-shrink: 0 !important;
    margin-top: 4px !important;
  }
  
  .mktoForm .mktoLogicalField .mktoLabel {
    display: block !important;
    font-family: var(--font-family-primary) !important;
    color: var(--color-text-black) !important;
    line-height: 1.5 !important;
    letter-spacing: 0.29px !important;
    font-size: 12px !important;
    text-align: justify !important;
    width: 100% !important;
    text-indent: 23px !important;
    margin-bottom: 0 !important;
  }
  
  #LblemailPermissionStatus {
    font-family: var(--font-family-primary) !important;
    color: var(--color-text-black) !important;
    line-height: 1.5 !important;
    letter-spacing: 0.29px !important;
    font-size: 12px !important;
    text-align: justify !important;
    width: 100% !important;
    text-indent: 23px !important;
  }
  
  .mktoForm .mktoLogicalField a {
    color: var(--color-primary-blue) !important;
    text-decoration: underline !important;
  }
  
  .mktoForm .mktoLogicalField a:hover {
    opacity: 0.8 !important;
  }
  
  /* Error Messages */
  .mktoForm .mktoError {
    font-size: 12px !important;
    color: #dc2626 !important;
    margin-top: 4px !important;
    display: block !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
  }
  
  .mktoForm .mktoError[style] {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
  }
  
  .mktoForm .mktoError .mktoErrorArrowWrap {
    display: none !important;
  }
  
  .mktoForm .mktoError .mktoErrorMsg {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .mktoForm .mktoInvalid {
    border-color: #dc2626 !important;
  }
  
  .mktoForm .mktoInvalid:focus {
    border-color: #dc2626 !important;
  }
  
  /* Success Message */
  .mktoForm .mktoSuccessMessage {
    padding: 1rem !important;
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
    text-align: center !important;
  }
  
  /* Loading State */
  .mktoForm.mktoLoading {
    opacity: 0.6 !important;
    pointer-events: none !important;
  }
  
  .mktoForm.mktoFormSubmitting .mktoButton {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }
  
  /* reCAPTCHA disclaimer */
  .mktoForm .mktoCaptchaDisclaimer {
    font-size: 12px !important;
    color: #666 !important;
    margin: 0.5rem 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }
  
  .mktoForm .mktoCaptchaDisclaimer a {
    color: var(--color-primary-blue) !important;
    text-decoration: underline !important;
  }
  
  /* HTML Text (Privacy Policy) */
  .mktoForm .mktoHtmlText {
    font-size: 12px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin: 0.5rem 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
  }
  
  .mktoForm .mktoHtmlText[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .mktoForm .mktoHtmlText a {
    color: var(--color-primary-blue) !important;
    text-decoration: underline !important;
  }
  
  /* Ajustes para layout da LP */
  .hero__form-wrapper .mktoForm {
    max-width: 100% !important;
  }
  
  /* Responsive */
  @media screen and (max-width: 1024px) {
    .mktoForm .mktoFormCol {
      width: 100% !important;
      margin: 0 0 22px 0 !important;
    }
  
    .mktoForm .mktoFormCol[style*="margin-bottom"] {
      margin-bottom: 22px !important;
    }
  
    .mktoForm .mktoLabel {
      word-wrap: break-word !important;
      white-space: pre-line !important;
      width: 100% !important;
    }
  }
  
  @media (max-width: 768px) {
    .mktoForm input[type='date'],
    .mktoForm input[type='email'],
    .mktoForm input[type='number'],
    .mktoForm input[type='tel'],
    .mktoForm input[type='text'],
    .mktoForm input[type='url'],
    .mktoForm select.mktoField {
      font-size: 16px !important; /* Evita zoom no iOS */
      height: 48px !important;
      padding-left: 16px !important;
    }
  
    .mktoForm textarea.mktoField {
      font-size: 16px !important;
      padding-top: 15px !important;
      padding-left: 16px !important;
    }
  
    .mktoForm .mktoButtonWrap .mktoButton {
      font-size: 18px !important;
      height: 56px !important;
    }
  
    .mktoForm .mktoFormCol {
      margin-bottom: 22px !important;
    }
  
    .mktoForm .mktoFormCol[style*="margin-bottom"] {
      margin-bottom: 22px !important;
    }
  }
  
  @media (max-width: 480px) {
    .mktoForm {
      width: 100% !important;
    }
  
    .mktoForm input[type='date'],
    .mktoForm input[type='email'],
    .mktoForm input[type='number'],
    .mktoForm input[type='tel'],
    .mktoForm input[type='text'],
    .mktoForm input[type='url'],
    .mktoForm select.mktoField {
      font-size: 16px !important;
      height: 48px !important;
    }
  
    .mktoForm textarea.mktoField {
      font-size: 16px !important;
    }
  
    .mktoForm .mktoButtonWrap .mktoButton {
      font-size: 16px !important;
      height: 52px !important;
    }
  }

/* Fallback static form styles (mirror Mkto styling so local preview matches) */
.form-fallback { display: block; width: 100%; }
.form-fallback .input { margin-bottom: 12px; }
.form-fallback .input input[type="text"],
.form-fallback .input input[type="email"],
.form-fallback .input input[type="tel"] {
  width: 100%;
  height: 40px;
  border: 1px solid #c7c7c7;
  padding-left: 16px;
  font-size: 14px;
  box-sizing: border-box;
  border-radius: 4px;
}
.form-fallback .input input::placeholder {
  color: #7a7a7a;
}
.form-fallback .form-cta {
  display: inline-block;
  width: 100%;
  height: 64px;
  background: var(--color-cta-red);
  color: var(--color-text-white);
  font-weight: 900;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  font-size: 20px;
  border-radius: 6px;
}
.form-fallback .form-cta:hover { opacity: 0.95; }
/* Hide fallback when a Mkto form is present (Mkto will render .mktoForm inside wrapper) */
.hero__form-wrapper .mktoForm + .form-fallback,
.hero__form-wrapper .mktoForm ~ .form-fallback {
  display: none !important;
}

/* Desktop: form emphasis when CTA is clicked */
@keyframes formSlideUp {
  0% {
    opacity: 0.72;
    transform: translateY(34px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (min-width: 901px) {
  .hero__form-wrapper.form-slide-up {
    animation: formSlideUp 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
  
/* MOBILE: hide hero form by default and show as centered modal when mobile CTA is clicked */
@media screen and (max-width: 1200px) {
  /* keep original wrapper in DOM but hidden in layout */
  .hero__form-wrapper { display: none !important; }
  /* show close button inside modal when visible (will be toggled by body.mobile-form-open) */
  .hero__form-close { display: block !important; }

  body.mobile-form-open .hero__form-wrapper {
    display: block !important;
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 480px !important;
    max-height: 90vh !important;
    overflow: auto !important;
    z-index: 10000 !important;
    box-shadow: 0 28px 64px rgba(0,0,0,0.36) !important;
    border-radius: 8px !important;
    background: var(--color-bg-white) !important;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.985) !important;
    transition: opacity 0.28s ease, transform 0.28s ease;
  }
  body.mobile-form-open .hero__form-wrapper.visible {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }

  /* Add a semi-transparent overlay using a pseudo element on body when modal open */
  body.mobile-form-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.48);
    z-index: 9998;
  }

  /* prevent body scroll while modal open */
  body.mobile-form-open { overflow: hidden !important; }
}

/* Strong overrides to neutralize inline widths injected by Marketo */
.hero__form-wrapper .mktoForm,
.hero__form-wrapper .mktoForm[style] {
  width: 100% !important;
  max-width: 430px !important;
  box-sizing: border-box !important;
}

/* Ensure any element inside the Marketo form that has inline width is constrained */
.hero__form-wrapper .mktoForm *[style] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Specifically target inputs/selects/textareas with inline width */
.hero__form-wrapper .mktoForm input[style],
.hero__form-wrapper .mktoForm select[style],
.hero__form-wrapper .mktoForm textarea[style],
.hero__form-wrapper .mktoForm .mktoFieldWrap[style] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Force button to fill wrapper and remove inline margin-left */
.hero__form-wrapper .mktoForm .mktoButtonWrap,
.hero__form-wrapper .mktoForm .mktoButtonWrap[style] {
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.hero__form-wrapper .mktoForm .mktoButtonWrap .mktoButton {
  width: 100% !important;
  display: inline-block !important;
  box-sizing: border-box !important;
}

/* Accessibility: keep labels visually hidden but available for screen readers */
.hero__form-wrapper .mktoForm .mktoLabel {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
