/*
 * Hero — [iw_hero].
 *
 * Markup template-agnostic; submit button shape qua modifier
 * `iw-hero__submit--gradient` (T1 default) | `iw-hero__submit--pill` (T2).
 * Color theming via var(--iw-accent) cascade theo color scheme.
 *
 * Design source: Figma 407:41614 (T1 desktop) + 240:6292 area (T2 button).
 */

.iw-hero {
  position: relative;
  overflow: hidden;
  /* Fullwidth breakout — spans viewport even when placed inside a
     constrained Flatsome container (page-wrapper / .row etc.). */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: #0a1d7a;
  background-image: linear-gradient(110deg, #0a1d7a 0%, #142fbf 50%, #2a5ee6 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

/* Editor-picked image bg replaces the gradient; transparent base color so
   PNGs with alpha don't show blue underneath, and the ::before glow is
   suppressed so it doesn't tint the uploaded artwork. */
.iw-hero--bg-image {
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.iw-hero--bg-image::before { display: none; }

/* Flat-color mode: drop the gradient + glow entirely, inline style sets color. */
.iw-hero--bg-color {
  background-image: none;
}
.iw-hero--bg-color::before { display: none; }

.iw-hero::before {
  content: "";
  position: absolute;
  top: -500px;
  left: -450px;
  width: 1074px;
  height: 1074px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 60%);
  pointer-events: none;
}

.iw-hero .iw-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--iw-container-max);
  margin: 0 auto;
  padding: 0 var(--iw-container-pad-x);
  height: 740px;
  display: grid;
  grid-template-columns: minmax(0, 562px) 1fr;
  gap: 80px;
  align-items: center;
  box-sizing: border-box;
}

.iw-hero__left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 562px;
}

.iw-hero__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.iw-hero__title {
  font-family: "Lexend", "SF Pro", -apple-system, sans-serif;
  font-weight: 700;
  font-size: 72px;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(249.49deg, #fbc8ff 16.9%, #a1c1ff 59.1%, #fffdc2 98.9%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.iw-hero__subtitle {
  font-size: 20px;
  line-height: 1.4;
  color: #ffffff;
  margin: 0;
  font-weight: 400;
}

.iw-hero__form {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 24px 32px;
  max-width: 464px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.iw-hero__form-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.iw-hero__form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Flatsome áp `input[type=text]/select { margin/bg/border/height... }` (spec 0,1,1)
   đè class đơn của mình (0,1,0). Scope `.iw-hero__form` đầu rule → spec 0,2,1 để win. */
.iw-hero__form input.iw-hero__input,
.iw-hero__form select.iw-hero__input,
.iw-hero__form input.iw-hero__input[type] {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 48px;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  box-shadow: none;
  -webkit-box-shadow: none;
  font-size: 16px;
  line-height: 1.2;
  color: #ffffff;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  vertical-align: middle;
}

.iw-hero__field {
  margin: 0;
}

/* Error <p> mặc định không tạo gap khi rỗng — chỉ hiện khi có message. */
.iw-hero__form .iw-lead-form__error {
  margin: 4px 0 0;
  min-height: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #ffd6d6;
}
.iw-hero__form .iw-lead-form__error:empty {
  display: none;
}

.iw-hero__form .iw-lead-form__feedback {
  margin: 0;
  font-size: 13px;
  color: #ffffff;
}
.iw-hero__form .iw-lead-form__feedback:empty {
  display: none;
}
.iw-hero__form .iw-lead-form__feedback--error {
  color: #ffd6d6;
}

.iw-hero__form .iw-hero__input::placeholder { color: #d1d1d1; }
.iw-hero__form .iw-hero__input:focus        { border-color: #ffffff; }

.iw-hero__form select.iw-hero__input--select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("../../img/arrow-down.svg"), linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1));
  background-repeat: no-repeat;
  background-position: right 12px center, 0 0;
  background-size: 12px 6px, auto;
  padding-right: 40px;
  color: #d1d1d1;
}

.iw-hero__form .iw-hero__input--select option {
  color: #3d3d3d;
  background: #ffffff;
}

/* Select2 override — match hero T1 design (transparent dark input). */
.iw-hero__form .select2-container {
  width: 100% !important;
  display: block;
}
.iw-hero__form .select2-container .select2-selection--single {
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  outline: none;
}
.iw-hero__form .select2-container--default .select2-selection--single .select2-selection__rendered {
  height: 48px;
  line-height: 48px;
  padding: 0;
  margin: 0;
  color: #ffffff;
  font-size: 16px;
}
.iw-hero__form .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #d1d1d1;
}

/* Replace native arrow (Flatsome đè border:transparent) bằng SVG trắng — match
   pattern location modal (chỉ đổi color stroke #ffffff). */
.iw-hero__form .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 12px;
  top: 0;
  width: 16px;
}
.iw-hero__form .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.iw-hero__form .select2-container--default.select2-container--focus .select2-selection--single,
.iw-hero__form .select2-container--default.select2-container--open .select2-selection--single {
  border-color: #ffffff;
}


/* ----- Submit button — base + 2 modifiers (gradient / pill) -----------
   Editor chọn shape qua option `submit_style`. Color tự follow var(--iw-accent)
   theo color scheme — đổi scheme T2 → T3 → button đổi màu, không cần code. */
.iw-hero .iw-hero__submit {
  display: block;
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.12s, transform 0.12s, box-shadow 0.12s;
  margin: 0;
}

/* Modifier — gradient: viền gradient pastel, nền trắng, chữ accent. T1 default. */
.iw-hero .iw-hero__submit--gradient {
  padding: 12px 40px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #fffdc2 0%, #a1c1ff 50%, #fbc8ff 100%) border-box;
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--iw-accent, #4564ed);
  font-weight: 500;
}
.iw-hero .iw-hero__submit--gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(165, 193, 255, 0.55);
}

/* Modifier — pill: solid bg accent, chữ trắng, bo tròn. T2 style. */
.iw-hero .iw-hero__submit--pill {
  padding: 13px 24px;
  background: var(--iw-accent, #ff2881);
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 700;
}
.iw-hero .iw-hero__submit--pill:hover {
  background: var(--iw-accent-strong, #d6196e);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(255, 40, 129, 0.45);
}

.iw-hero__privacy {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #ffffff;
}

.iw-hero__privacy-link {
  color: inherit; /* white from .iw-hero__privacy */
  font-weight: 700;
  text-decoration: none;
  transition: color 0.12s;
}

.iw-hero__privacy-link:hover {
  color: var(--iw-accent, #ffffff);
  text-decoration: underline;
}

.iw-hero__right {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.iw-hero__picture {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.iw-hero__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 1199px) {
  .iw-hero .iw-hero__inner { grid-template-columns: minmax(0, 500px) 1fr; gap: 40px; }
  .iw-hero__left { max-width: 500px; }
  .iw-hero__title { font-size: 55px; }
}

@media (max-width: 992px) {
  .iw-hero { background-image: radial-gradient(ellipse at 50% 110%, #2e6fff 0%, #1d45d5 40%, #142fbf 70%, #0b1aaa 100%); }
  .iw-hero::before { display: none; }
  .iw-hero .iw-hero__inner { grid-template-columns: minmax(0, 400px) 1fr; }
  
  /* Modifier: ẩn cột ảnh trên mobile — section co theo content form. */
  .iw-hero--hide-image-mobile .iw-hero__right { display: none; }
  .iw-hero--hide-image-mobile .iw-hero__inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .iw-hero__image { max-height: none; width: 100%; }
  .iw-hero__title { font-size: 42px; }
  .iw-hero__subtitle { font-size: 18px; }
  .iw-hero__form {
    padding: 24px;
    border-radius: 16px;
    max-width: none;
  }
  .iw-hero__form-title { font-size: 20px; }
  .iw-hero__privacy { font-size: 12px; }
  .iw-hero__form input.iw-hero__input,
  .iw-hero__form select.iw-hero__input {
    height: 44px;
    font-size: 14px;
  }
  .iw-hero__submit {
    height: 44px;
    padding: 10px 24px;
  }
  .iw-hero__left { max-width: 400px; }
  .iw-hero__right { margin-top: 16px; }
  .iw-hero__image {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .iw-hero .iw-hero__inner {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 32px var(--iw-container-pad-x) 16px;
    max-width: none;
    height: auto;
  }
  .iw-hero__title { font-size: 36px; }
  .iw-hero__privacy { font-size: 10px; }
}
