/*
 * Customer-detail dialogs — one layout for all of them.
 *
 *   #lendlRentOverlay  Rent Now wizard (also the cart's checkout)
 *   #lendlLeadOverlay  "Almost there" lead gate (company profile, brochures, proposals)
 *   #rcLeadOverlay     calculator "Get your branded proposal"
 *   #lendlPbOverlay    playbook download
 *   #npOverlay         newsletter / offer pop-up
 *
 * Each came from a different theme section with its own spacing, field
 * heights and label styles, and two theme rules fought them (base.css hides
 * empty divs; lendl-custom.css squares every button with !important). The
 * rules below are scoped under each dialog's id, so they win over the theme
 * without touching anything else. Brand red and radii match the calculator
 * dialog (rc-calculator.css).
 */

:root {
  --ld-red: #c8102e;
  --ld-red-dark: #a50d26;
  --ld-ink: #121212;
  --ld-muted: #5b5f66;
  --ld-line: #d9dce1;
  --ld-field: #ffffff;
  --ld-soft: #f4f5f7;
  --ld-radius: 14px;
  --ld-field-radius: 10px;
  --ld-gap: 16px;
}

/* ── Overlay + panel ────────────────────────────────────────────────────── */
#lendlRentOverlay, #lendlLeadOverlay, #rcLeadOverlay, #lendlPbOverlay {
  padding: 16px !important;
  align-items: center !important;
  justify-content: center !important;
}
#lendlRentOverlay .lendl-rent-modal,
#lendlLeadOverlay .lendl-lead-modal,
#rcLeadOverlay .rc-lead-modal,
#lendlPbOverlay .lendl-pb-modal {
  position: relative;
  width: min(480px, 100%) !important;
  max-width: 480px !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: var(--ld-radius) !important;
  background: #fff !important;
  box-shadow: 0 24px 60px rgba(15, 18, 24, .28) !important;
  box-sizing: border-box;
  color: var(--ld-ink);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Close button: its own corner, never on top of the content ──────────── */
#lendlRentOverlay .lendl-rent-close,
#lendlLeadOverlay .lendl-lead-close,
#rcLeadOverlay .rc-lead-close,
#lendlPbOverlay .lendl-pb-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--ld-soft) !important;
  color: var(--ld-ink) !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer;
  z-index: 3;
}
#lendlRentOverlay .lendl-rent-close:hover,
#lendlLeadOverlay .lendl-lead-close:hover,
#rcLeadOverlay .rc-lead-close:hover,
#lendlPbOverlay .lendl-pb-close:hover { background: #e7e9ec !important; }

/* ── Headings ───────────────────────────────────────────────────────────── */
#lendlRentOverlay .lendl-rent-head { padding: 22px 64px 18px 28px !important; border-bottom: 1px solid #eceef1; }
#lendlLeadOverlay .lendl-lead-title,
#lendlPbOverlay #lendlPbTitle,
#rcLeadOverlay #rcLeadTitle,
#lendlRentOverlay .lendl-rent-title {
  margin: 0 !important;
  font-size: 22px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: var(--ld-ink) !important;
  text-transform: none !important;
}
#lendlLeadOverlay .lendl-lead-title,
#lendlPbOverlay #lendlPbTitle { padding: 26px 64px 0 28px !important; }
#lendlLeadOverlay .lendl-lead-sub,
#lendlPbOverlay .lendl-pb-modal > p,
#rcLeadOverlay .rc-lead-sub {
  margin: 8px 0 0 !important;
  padding: 0 28px !important;
  color: var(--ld-muted) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
#rcLeadOverlay .rc-lead-sub { padding: 0 !important; margin: 0 0 4px !important; }
#rcLeadOverlay .rc-lead-header {
  display: block !important;
  padding: 24px 64px 18px 28px !important;
  border-bottom: 1px solid #eceef1;
}

/* Rent Now: step counter and progress under the title area, clear of the close button */
#lendlRentOverlay .lendl-rent-progress {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 14px !important;
}
#lendlRentOverlay .lendl-rent-progress span {
  display: block !important;
  height: 4px !important;
  border-radius: 4px;
  background: #e3e5e9 !important;
}
#lendlRentOverlay .lendl-rent-progress span.done,
#lendlRentOverlay .lendl-rent-progress span.is-active,
#lendlRentOverlay .lendl-rent-progress span.active { background: var(--ld-ink) !important; }
#lendlRentOverlay .lendl-rent-stepnum {
  margin: 0 0 4px !important;
  font-size: 12px !important;
  letter-spacing: .08em !important;
  text-transform: uppercase;
  color: var(--ld-muted) !important;
}

/* ── Bodies ─────────────────────────────────────────────────────────────── */
#lendlRentOverlay .lendl-rent-body { padding: 22px 28px 4px !important; }
#lendlLeadOverlay .lendl-lead-form { padding: 20px 28px 26px !important; display: flex !important; flex-direction: column; gap: var(--ld-gap); }
#rcLeadOverlay .rc-lead-body { padding: 20px 28px 24px !important; display: flex !important; flex-direction: column; gap: var(--ld-gap); }
#lendlPbOverlay .lendl-pb-modal { padding-bottom: 26px !important; }
#lendlPbOverlay .lendl-pb-modal > input { display: block; width: calc(100% - 56px) !important; margin: 12px 28px 0 !important; }
#lendlPbOverlay .lendl-pb-modal > input:first-of-type { margin-top: 20px !important; }

/* Field blocks: label, control, help text — each on its own line, never overlapping */
#lendlRentOverlay .lendl-rent-field,
#lendlLeadOverlay .lendl-lead-form > label:not(.lendl-lead-checkbox),
#rcLeadOverlay .rc-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
  min-width: 0;
}
#lendlRentOverlay .lendl-rent-step { display: none; }
#lendlRentOverlay .lendl-rent-step.is-active { display: flex !important; flex-direction: column; gap: var(--ld-gap); }
#lendlRentOverlay .lendl-rent-row { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px !important; }

#lendlRentOverlay .lendl-rent-field > label,
#lendlLeadOverlay .lendl-lead-form > label:not(.lendl-lead-checkbox) > span:first-child,
#rcLeadOverlay .rc-field > label {
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #2b2f36 !important;
  line-height: 1.3 !important;
}
#lendlRentOverlay .req { color: var(--ld-red); margin-left: 2px; }

/* Controls */
#lendlRentOverlay input[type="text"], #lendlRentOverlay input[type="email"], #lendlRentOverlay input[type="tel"],
#lendlRentOverlay select, #lendlRentOverlay textarea,
#lendlLeadOverlay input[type="text"], #lendlLeadOverlay input[type="email"], #lendlLeadOverlay input[type="tel"], #lendlLeadOverlay select,
#rcLeadOverlay input[type="text"], #rcLeadOverlay input[type="email"], #rcLeadOverlay input[type="tel"],
#lendlPbOverlay input {
  width: 100% !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 11px 14px !important;
  box-sizing: border-box !important;
  border: 1px solid var(--ld-line) !important;
  border-radius: var(--ld-field-radius) !important;
  background: var(--ld-field) !important;
  color: var(--ld-ink) !important;
  font: inherit !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color .15s, box-shadow .15s;
}
#lendlRentOverlay textarea { min-height: 96px !important; resize: vertical; }
#lendlRentOverlay select, #lendlLeadOverlay select { padding-right: 34px !important; appearance: auto; }
#lendlRentOverlay input:focus, #lendlRentOverlay select:focus, #lendlRentOverlay textarea:focus,
#lendlLeadOverlay input:focus, #lendlLeadOverlay select:focus,
#rcLeadOverlay input:focus,
#lendlPbOverlay input:focus {
  border-color: var(--ld-ink) !important;
  box-shadow: 0 0 0 3px rgba(18, 18, 18, .12) !important;
}
#lendlRentOverlay input::placeholder, #lendlLeadOverlay input::placeholder, #rcLeadOverlay input::placeholder, #lendlPbOverlay input::placeholder { color: #9aa0a8; }
#lendlLeadOverlay input.is-invalid, #lendlRentOverlay input.is-invalid { border-color: var(--ld-red) !important; }

/* Phone: country code and number side by side, same height */
#lendlRentOverlay .lendl-rent-phone-row,
#lendlLeadOverlay .lendl-cc-row {
  display: grid !important;
  grid-template-columns: minmax(148px, 40%) 1fr !important;
  gap: 10px !important;
  width: 100%;
}
#lendlRentOverlay .lendl-rent-phone-row > *, #lendlLeadOverlay .lendl-cc-row > * { width: 100% !important; min-width: 0; }

/* Help and error text sit below their control with breathing room */
#lendlRentOverlay .lendl-rent-hint { margin: 2px 0 0 !important; font-size: 12.5px !important; color: var(--ld-muted) !important; line-height: 1.4 !important; }
#lendlLeadOverlay .lendl-field-err { font-size: 12.5px; color: var(--ld-red); min-height: 0; }
#lendlLeadOverlay .lendl-field-err:empty { display: none; }
#lendlRentOverlay .lendl-rent-err,
#rcLeadOverlay .rc-lead-err,
#lendlPbOverlay .lendl-pb-err {
  margin: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  color: var(--ld-red) !important;
}
#lendlRentOverlay .lendl-rent-err:empty, #rcLeadOverlay .rc-lead-err:empty, #lendlPbOverlay .lendl-pb-err:empty { display: none !important; }
#lendlPbOverlay .lendl-pb-err { padding: 10px 28px 0 !important; }

/* Review card and consent */
#lendlRentOverlay .lendl-rent-review {
  margin: 0 !important;
  padding: 14px 16px !important;
  border-radius: var(--ld-field-radius);
  background: var(--ld-soft) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  overflow-wrap: anywhere;
}
#lendlRentOverlay .lendl-rent-consent,
#lendlLeadOverlay .lendl-lead-checkbox {
  display: grid !important;
  grid-template-columns: 18px 1fr;
  gap: 10px !important;
  align-items: start;
  margin: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: #3d424a !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
#lendlRentOverlay .lendl-rent-consent input, #lendlLeadOverlay .lendl-lead-checkbox input {
  width: 18px !important; height: 18px !important; min-height: 0 !important; margin: 2px 0 0 !important; padding: 0 !important; accent-color: var(--ld-ink);
}

/* ── Footers and buttons ────────────────────────────────────────────────── */
#lendlRentOverlay .lendl-rent-foot {
  display: flex !important;
  gap: 12px !important;
  padding: 20px 28px 24px !important;
  border-top: 0 !important;
}
#lendlRentOverlay .lendl-rent-btn,
#lendlLeadOverlay .lendl-lead-form button[type="submit"], #lendlLeadOverlay #lendlLeadSubmit,
#rcLeadOverlay .rc-lead-submit,
#lendlPbOverlay .lendl-pb-download {
  min-height: 48px !important;
  margin: 0 !important;
  padding: 12px 20px !important;
  border-radius: var(--ld-field-radius) !important;
  font: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer;
}
#lendlRentOverlay .lendl-rent-btn--next, #lendlRentOverlay .lendl-rent-btn--submit,
#lendlLeadOverlay .lendl-lead-form button[type="submit"], #lendlLeadOverlay #lendlLeadSubmit,
#rcLeadOverlay .rc-lead-submit,
#lendlPbOverlay .lendl-pb-download {
  border: 0 !important;
  background: var(--ld-red) !important;
  color: #fff !important;
}
#lendlRentOverlay .lendl-rent-btn--next:hover, #lendlRentOverlay .lendl-rent-btn--submit:hover,
#lendlLeadOverlay #lendlLeadSubmit:hover, #rcLeadOverlay .rc-lead-submit:hover, #lendlPbOverlay .lendl-pb-download:hover { background: var(--ld-red-dark) !important; }
#lendlRentOverlay .lendl-rent-btn--next, #lendlRentOverlay .lendl-rent-btn--submit { flex: 1 1 auto !important; }
#lendlRentOverlay .lendl-rent-btn--back {
  flex: 0 0 108px !important;
  border: 1px solid var(--ld-line) !important;
  background: #fff !important;
  color: var(--ld-ink) !important;
}
#lendlLeadOverlay .is-disabled, #lendlLeadOverlay button:disabled { opacity: .5; cursor: not-allowed; }
#lendlPbOverlay .lendl-pb-download { display: block; width: calc(100% - 56px) !important; margin: 18px 28px 0 !important; }
#rcLeadOverlay .rc-lead-privacy { margin: 0 !important; font-size: 12.5px !important; color: var(--ld-muted) !important; text-align: center; }

/* ── Phones: full-width sheet from the bottom, larger touch targets ─────── */
@media (max-width: 560px) {
  #lendlRentOverlay, #lendlLeadOverlay, #rcLeadOverlay, #lendlPbOverlay { padding: 0 !important; align-items: flex-end !important; }
  #lendlRentOverlay .lendl-rent-modal, #lendlLeadOverlay .lendl-lead-modal, #rcLeadOverlay .rc-lead-modal, #lendlPbOverlay .lendl-pb-modal {
    width: 100% !important; max-width: none !important; max-height: 92dvh !important; border-radius: 18px 18px 0 0 !important;
  }
  #lendlRentOverlay .lendl-rent-head, #rcLeadOverlay .rc-lead-header { padding: 20px 60px 16px 20px !important; }
  #lendlLeadOverlay .lendl-lead-title, #lendlPbOverlay #lendlPbTitle { padding: 22px 60px 0 20px !important; }
  #lendlLeadOverlay .lendl-lead-sub, #lendlPbOverlay .lendl-pb-modal > p { padding: 0 20px !important; }
  #lendlRentOverlay .lendl-rent-body { padding: 18px 20px 4px !important; }
  #lendlLeadOverlay .lendl-lead-form, #rcLeadOverlay .rc-lead-body { padding: 18px 20px 22px !important; }
  #lendlPbOverlay .lendl-pb-modal > input, #lendlPbOverlay .lendl-pb-download { width: calc(100% - 40px) !important; margin-left: 20px !important; margin-right: 20px !important; }
  #lendlRentOverlay .lendl-rent-foot { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)) !important; position: sticky; bottom: 0; background: #fff; }
  #lendlRentOverlay .lendl-rent-row { grid-template-columns: 1fr; }
  #lendlRentOverlay .lendl-rent-phone-row, #lendlLeadOverlay .lendl-cc-row { grid-template-columns: minmax(148px, 44%) 1fr !important; }
  #lendlRentOverlay .lendl-rent-title, #lendlLeadOverlay .lendl-lead-title, #lendlPbOverlay #lendlPbTitle, #rcLeadOverlay #rcLeadTitle { font-size: 20px !important; }
  #lendlRentOverlay input, #lendlRentOverlay select, #lendlRentOverlay textarea, #lendlLeadOverlay input, #lendlLeadOverlay select, #rcLeadOverlay input, #lendlPbOverlay input { font-size: 16px !important; }
}

/* ── Smooth open and close ──────────────────────────────────────────────
 * The theme shows these by toggling .is-open between display:none and
 * display:flex, which cannot animate. They stay laid out but invisible and
 * fade in (backdrop) and rise in (panel) on .is-open, and reverse on close.
 * visibility is delayed on the way out so the fade finishes before the
 * dialog stops taking clicks and focus.
 */
#lendlRentOverlay, #lendlLeadOverlay, #lendlPbOverlay, #npOverlay {
  display: flex !important;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .26s ease, visibility 0s linear .26s;
}
#cdOverlay { display: block !important; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s ease, visibility 0s linear .3s; }
#lendlRentOverlay.is-open, #lendlLeadOverlay.is-open, #lendlPbOverlay.is-open, #npOverlay.is-open, #cdOverlay.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .26s ease, visibility 0s linear 0s;
}
#lendlRentOverlay .lendl-rent-modal, #lendlLeadOverlay .lendl-lead-modal, #lendlPbOverlay .lendl-pb-modal, #npOverlay .np-modal {
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .26s ease, transform .32s cubic-bezier(.2, .8, .2, 1);
}
#lendlRentOverlay.is-open .lendl-rent-modal, #lendlLeadOverlay.is-open .lendl-lead-modal, #lendlPbOverlay.is-open .lendl-pb-modal, #npOverlay.is-open .np-modal {
  opacity: 1; transform: none;
}
@media (max-width: 560px) {
  #lendlRentOverlay .lendl-rent-modal, #lendlLeadOverlay .lendl-lead-modal, #lendlPbOverlay .lendl-pb-modal { transform: translateY(40px); }
}
@media (prefers-reduced-motion: reduce) {
  #lendlRentOverlay, #lendlLeadOverlay, #lendlPbOverlay, #npOverlay, #cdOverlay,
  #lendlRentOverlay .lendl-rent-modal, #lendlLeadOverlay .lendl-lead-modal, #lendlPbOverlay .lendl-pb-modal, #npOverlay .np-modal { transition: none; }
}

/* Rent Now wizard: each step slides in instead of snapping, and the progress bar fills smoothly. */
@keyframes ld-step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
#lendlRentOverlay .lendl-rent-step.is-active { animation: ld-step-in .32s cubic-bezier(.2, .8, .2, 1) both; }
#lendlRentOverlay .lendl-rent-progress span { transition: background-color .35s ease, transform .35s ease; transform-origin: left center; }
#lendlRentOverlay .lendl-rent-title, #lendlRentOverlay .lendl-rent-stepnum { transition: opacity .2s ease; }
@media (prefers-reduced-motion: reduce) { #lendlRentOverlay .lendl-rent-step.is-active { animation: none; } }
/* Phone row: the dialling code box is as wide as "+91" needs, the number takes the rest. */
#lendlRentOverlay .lendl-rent-phone-row { grid-template-columns: 104px 1fr !important; }
#lendlRentOverlay .lendl-rent-phone-row .lsel__btn, .lendl-cc-row .lsel__btn { width: 100% !important; max-width: none !important; }
