/* /assets/css/lead-form.css */
:root {
  --lf-brand: #681fa8;
  --lf-bg: #ffffff;
  --lf-text: #0f172a;
  --lf-muted: #64748b;
  --lf-border: #e5e7eb;
  --lf-soft: #f8fafc;
  --lf-shadow: 0 22px 60px rgba(2, 6, 23, 0.2);
  --lf-radius: 20px;
}

/* ===============================
   MODAL + DYNAMIC HEIGHT (FIXED)
   Paste at END of lead-form.css
================================ */

/* safety reset */
.leadform,
.leadform * {
  box-sizing: border-box;
}
.leadform button,
.leadform input,
.leadform label {
  font-family: inherit;
}
.leadform button {
  appearance: none;
  -webkit-appearance: none;
}
.leadform a {
  color: inherit;
}

/* modal wrapper: real modal behavior */
.leadformModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;

  /* allow scrolling when content exceeds screen */
  overflow-y: auto;

  padding: 32px 18px;
  background: rgba(2, 6, 23, 0.6);
  z-index: 9999999 !important;
}

.leadformModal.is-open {
  display: flex !important;
}

/* panel width container */
.leadformModal__panel {
  width: min(820px, 100%);
}

/* leadform card: grow naturally up to viewport */
.leadform {
  width: 100%;
  max-width: 760px;

  /* key: card can grow but not exceed viewport */
  max-height: calc(100vh - 64px);

  display: flex;
  flex-direction: column;

  background: var(--lf-bg, #fff);
  color: var(--lf-text, #0f172a);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--lf-radius, 20px);
  box-shadow: var(--lf-shadow, 0 22px 60px rgba(2, 6, 23, 0.2));
  overflow: hidden; /* important to clip inner scroll */
}

/* header stays natural height */
.leadform__header {
  flex: 0 0 auto;
}

/* progress stays natural height */
.leadform__progressWrap {
  flex: 0 0 auto;
}

/* body takes remaining height and scrolls only when needed */
.leadform__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* CRITICAL for flex scroll to work properly */
}

/* optional: smoother scrollbars */
.leadform__body {
  scrollbar-width: thin;
}
.leadform__body::-webkit-scrollbar {
  width: 8px;
}
.leadform__body::-webkit-scrollbar-thumb {
  background: rgba(104, 31, 168, 0.25);
  border-radius: 999px;
}

/* ===== Header ===== */
.leadform__header {
  position: relative;
  padding: 30px 25px;
  min-height: 150px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.633), rgba(104, 31, 168, 0.55)),
    url("../images/banner/popup-banner.webp");
  border-top-left-radius: var(--lf-radius);
  border-top-right-radius: var(--lf-radius);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.leadform__headerOverlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.28);
}
.leadform__headerContent {
  position: relative;
  z-index: 1;
  padding-right: 52px;
}
.leadform__title {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
}
.leadform__subtitle {
  margin: 0;
  font-size: 13.5px;
  opacity: 0.92;
  max-width: 560px;
}

.leadform__close {
  position: absolute;
  z-index: 2;
  top: 30px;
  right: 25px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(2, 6, 23, 0.28);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.leadform__close:hover {
  transform: translateY(-1px);
  background: rgba(2, 6, 23, 0.4);
}

/* ===== Progress ===== */
.leadform__progressWrap {
  padding: 12px 22px;
  background: #fff;
  border-bottom: 1px solid rgba(229, 231, 235, 0.75);
}
.leadform__progressBar {
  height: 8px;
  background: rgba(104, 31, 168, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.leadform__progressFill {
  height: 100%;
  width: 33%;
  background: linear-gradient(90deg, var(--lf-brand), rgba(104, 31, 168, 0.55));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ===== Body ===== */
.leadform__body {
  padding: 18px 22px 22px 22px;
  overflow: auto; /* key: no ugly huge blank space */
}

/* section card */
.leadform__section {
  margin-bottom: 14px;
  background: var(--lf-soft);
  border: 1px solid rgba(229, 231, 235, 0.75);
  border-radius: 16px;
  padding: 14px;
}
.leadform__sectionHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.leadform__sectionTitle {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.leadform__sectionHint {
  margin: 0;
  font-size: 12px;
  color: var(--lf-muted);
}

/* ===== Property Segmented ===== */
.leadform__segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) {
  .leadform__segmented {
    grid-template-columns: 1fr;
  }
}
.leadform__segItem {
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  padding: 12px 12px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #111827;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  width: auto !important; /* protects from theme CSS */
}
.leadform__segItem input {
  display: none;
}
.leadform__segItem.is-active {
  border-color: rgba(104, 31, 168, 0.55);
  background: rgba(104, 31, 168, 0.08);
  transform: translateY(-1px);
}

/* ===== Products Grid (Premium) ===== */
.leadform__chipGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 900px) {
  .leadform__chipGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .leadform__chipGrid {
    grid-template-columns: 1fr;
  }
}

.leadform__chip {
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 16px;
  padding: 12px 12px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  text-align: left;
}
.leadform__chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(2, 6, 23, 0.1);
}

.leadform__chipLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.leadform__chipIcon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(104, 31, 168, 0.1);
  border: 1px solid rgba(104, 31, 168, 0.18);
  color: var(--lf-brand);
  font-size: 16px;
  flex: 0 0 auto;
}
.leadform__chipLabel {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leadform__chipMark {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229, 231, 235, 0.95);
  color: var(--lf-muted);
  flex: 0 0 auto;
}

.leadform__chip.is-active {
  border-color: rgba(104, 31, 168, 0.55);
  background: rgba(104, 31, 168, 0.06);
  box-shadow: 0 14px 35px rgba(104, 31, 168, 0.14);
}
.leadform__chip.is-active .leadform__chipMark {
  border-color: rgba(104, 31, 168, 0.55);
  color: var(--lf-brand);
  background: rgba(104, 31, 168, 0.1);
}

/* ===== Inputs ===== */
.leadform__grid {
  display: flex;
  flex-direction: column;
  gap: 0ßpx;
}
.leadform__row2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .leadform__row2 {
    grid-template-columns: 1fr 1fr;
  }
}

.leadform__label {
  display: block;
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 800;
  color: #111827;
}
.leadform__input {
  width: 100%;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.leadform__input:focus {
  border-color: rgba(104, 31, 168, 0.55);
  box-shadow: 0 0 0 4px rgba(104, 31, 168, 0.12);
}

.leadform__phoneWrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  padding: 6px 10px;
  background: #fff;
}
.leadform__phonePrefix {
  font-size: 13px;
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
}
.leadform__phoneInput {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 6px 2px;
  background: transparent;
}

/* ===== City radios ===== */
.leadform__radioGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) {
  .leadform__radioGrid {
    grid-template-columns: 1fr 1fr;
  }
}
.leadform__radioItem {
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  padding: 12px 12px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  width: auto !important;
}
.leadform__radioItem input {
  accent-color: var(--lf-brand);
}
.leadform__radioItem.is-active {
  border-color: rgba(104, 31, 168, 0.55);
  background: rgba(104, 31, 168, 0.06);
  box-shadow: 0 12px 28px rgba(104, 31, 168, 0.12);
  transform: translateY(-1px);
}

.leadform__error {
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: #b91c1c;
  padding-left: 4px;
}

/* ===== Buttons ===== */
.leadform__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.leadform__actionsRight {
  display: flex;
  gap: 10px;
  align-items: center;
}

.leadform__btn {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid rgba(229, 231, 235, 0.95);
  background: #fff;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}
.leadform__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.1);
}
.leadform__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.leadform__btnPrimary {
  border-color: rgba(104, 31, 168, 0.35);
  background: var(--lf-brand);
  color: #fff;
}
.leadform__btnGhost {
  background: #fff;
  color: #111827;
}

.leadform__privacy {
  margin: 14px 0 0 0;
  color: var(--lf-muted);
  font-size: 12px;
  line-height: 1.45;
}
.leadform__privacy a {
  color: var(--lf-brand);
  text-decoration: none;
  font-weight: 900;
}
.leadform__privacy a:hover {
  text-decoration: underline;
}

/* ===== Stage slider ===== */
/* ===== Stage slider (no 300% width) ===== */
.leadform__viewport {
  width: 100%;
  overflow: hidden;
}

.leadform__stages {
  display: flex;
  transform: translateX(0);
  transition: transform 0.3s ease;
  will-change: transform;
}

.leadform__stage {
  flex: 0 0 100%;
  width: 100%;
}

/* ===== Thank you ===== */
.leadform__thank {
  padding: 10px 6px 6px 6px;
  text-align: center;
}
.leadform__thankIcon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 0 auto 12px auto;
  display: grid;
  place-items: center;
  background: rgba(104, 31, 168, 0.12);
  color: var(--lf-brand);
  font-size: 28px;
  font-weight: 900;
  border: 1px solid rgba(104, 31, 168, 0.22);
}
.leadform__thankTitle {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 900;
}
.leadform__thankText {
  margin: 0 0 16px 0;
  color: var(--lf-muted);
}

/* ===== Popup wrapper ===== */
.leadformModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.6);
  z-index: 9999999 !important;
}
.leadformModal.is-open {
  display: flex !important;
}

.leadformModal__panel {
  width: min(820px, 100%);
}
