/* ============================================================================
 * Lead-Capture Popup — banner + quick form + floating WhatsApp button
 * Pairs with lead-popup.js. All colors/sizes are CSS variables (rebrand below).
 * ========================================================================== */

:root {
  /* Brand */
  --lcp-accent:         #ff6b35;
  --lcp-accent-hover:   #e85a26;
  --lcp-accent-text:    #ffffff;

  /* Surfaces / text */
  --lcp-bg:             #ffffff;
  --lcp-heading-color:  #16181d;
  --lcp-text-color:     #5b6069;
  --lcp-overlay:        rgba(17, 17, 17, 0.58);
  --lcp-border:         #e3e6ea;
  --lcp-field-bg:       #f7f8fa;
  --lcp-error:          #d93025;

  /* WhatsApp / Call */
  --lcp-whatsapp:       #25d366;
  --lcp-whatsapp-hover: #1ebe5b;

  /* Shape / motion */
  --lcp-maxw:           430px;
  --lcp-banner-h:       150px;
  --lcp-radius:         18px;
  --lcp-shadow:         0 24px 70px rgba(0, 0, 0, 0.30);
  --lcp-zindex:         2147483000;
  --lcp-anim:           0.34s cubic-bezier(0.16, 0.84, 0.44, 1);
}

/* Scroll lock (JS adds the class; padding-right set inline -> no layout shift) */
body.lcp-noscroll { overflow: hidden !important; }

/* ---- Overlay ------------------------------------------------------------- */
.lcp-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--lcp-overlay);
  z-index: var(--lcp-zindex);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--lcp-anim), visibility var(--lcp-anim);
  -webkit-tap-highlight-color: transparent;
}
.lcp-overlay.lcp-open { opacity: 1; visibility: visible; }

/* ---- Dialog (fade + slide-up; flex column so the body scrolls if tall) --- */
.lcp-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--lcp-maxw);
  max-height: 92vh;
  overflow: hidden;                          /* clips banner to the rounded corners */
  background: var(--lcp-bg);
  border-radius: var(--lcp-radius);
  box-shadow: var(--lcp-shadow);
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity var(--lcp-anim), transform var(--lcp-anim);
}
.lcp-overlay.lcp-open .lcp-dialog { opacity: 1; transform: translateY(0) scale(1); }
.lcp-dialog:focus { outline: none; }

/* ---- Close (X) over the banner ------------------------------------------ */
.lcp-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 24px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.lcp-close:hover,
.lcp-close:focus-visible { background: rgba(0, 0, 0, 0.66); outline: none; transform: rotate(90deg); }

/* ---- Banner -------------------------------------------------------------- */
.lcp-banner {
  position: relative;
  flex: 0 0 auto;
  height: var(--lcp-banner-h);
  background: #f0f1f3;
}
.lcp-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lcp-banner::after {                          /* subtle bottom fade for legibility */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.18), rgba(0,0,0,0));
  pointer-events: none;
}

/* ---- Body (scrolls if content is tall) ----------------------------------- */
.lcp-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px 22px;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}
.lcp-heading {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.28;
  font-weight: 700;
  color: var(--lcp-heading-color);
}
.lcp-subtext {
  margin: 0 0 16px;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--lcp-text-color);
}

/* ---- Form ---------------------------------------------------------------- */
.lcp-form { display: flex; flex-direction: column; gap: 11px; }
.lcp-field { display: flex; flex-direction: column; gap: 4px; }
.lcp-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--lcp-heading-color);
  letter-spacing: 0.01em;
}
.lcp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--lcp-heading-color);
  background: var(--lcp-field-bg);
  border: 1.5px solid var(--lcp-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.lcp-input::placeholder { color: #9aa0a6; }
.lcp-input:focus {
  background: #fff;
  border-color: var(--lcp-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}
textarea.lcp-input { resize: vertical; min-height: 44px; }

.lcp-field--error .lcp-input { border-color: var(--lcp-error); background: #fdf3f2; }
.lcp-error { min-height: 0; font-size: 0.76rem; color: var(--lcp-error); }
.lcp-field--error .lcp-error { min-height: 1em; }

/* Honeypot — visually hidden, off-screen (bots fill it, humans don't) */
.lcp-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Submit -------------------------------------------------------------- */
.lcp-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 13px 18px;
  border: 0;
  border-radius: 11px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--lcp-accent-text);
  background: var(--lcp-accent);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.28);
}
.lcp-submit:hover { background: var(--lcp-accent-hover); }
.lcp-submit:active { transform: translateY(1px); }
.lcp-submit:focus-visible { outline: 3px solid rgba(255, 107, 53, 0.45); outline-offset: 2px; }
.lcp-submit[disabled] { opacity: 0.7; cursor: default; }
.lcp-submit--wa { background: var(--lcp-whatsapp); box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3); }
.lcp-submit--wa:hover { background: var(--lcp-whatsapp-hover); }
.lcp-submit svg { width: 20px; height: 20px; fill: currentColor; }

.lcp-form-msg { margin: 6px 0 0; font-size: 0.85rem; color: var(--lcp-text-color); }

/* ---- Secondary quick-contact row ----------------------------------------- */
.lcp-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--lcp-border);
  flex-wrap: wrap;
}
.lcp-quick-intro { font-size: 0.85rem; color: var(--lcp-text-color); margin-right: auto; }
.lcp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s, filter 0.15s;
}
.lcp-chip:active { transform: translateY(1px); }
.lcp-chip svg { width: 16px; height: 16px; fill: currentColor; }
.lcp-chip--whatsapp { background: rgba(37, 211, 102, 0.12); color: #128c4a; }
.lcp-chip--whatsapp:hover { filter: brightness(0.96); }
.lcp-chip--call { background: #eef0f3; color: var(--lcp-heading-color); }
.lcp-chip--call:hover { filter: brightness(0.97); }

/* ---- Success state ------------------------------------------------------- */
.lcp-success { text-align: center; padding: 8px 4px 4px; }
.lcp-success:focus { outline: none; }
.lcp-success-title { margin: 4px 0 8px; font-size: 1.3rem; font-weight: 700; color: var(--lcp-heading-color); }
.lcp-success-text { margin: 0 0 16px; font-size: 0.95rem; line-height: 1.55; color: var(--lcp-text-color); }

/* ---- Mobile floating WhatsApp button ------------------------------------- */
.lcp-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--lcp-whatsapp);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  z-index: calc(var(--lcp-zindex) - 10);      /* below the popup overlay */
  opacity: 0;
  transform: translateY(20px) scale(0.6);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.lcp-float svg { width: 30px; height: 30px; fill: currentColor; }
.lcp-float--visible { opacity: 1; transform: translateY(0) scale(1); }
.lcp-float--hidden { opacity: 0 !important; visibility: hidden; pointer-events: none; }
@media (min-width: 768px) { .lcp-float { display: none !important; } }

/* ---- Mobile dialog sizing ------------------------------------------------ */
@media (max-width: 767px) {
  .lcp-overlay { padding: 12px; align-items: flex-end; }   /* sheet-style on phones */
  .lcp-dialog { max-width: none; width: 100%; max-height: 94vh; border-radius: 16px; }
  :root { --lcp-banner-h: 120px; }
  .lcp-heading { font-size: 1.18rem; }
  .lcp-body { padding: 18px 18px 20px; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .lcp-overlay, .lcp-dialog, .lcp-float, .lcp-submit, .lcp-chip, .lcp-close, .lcp-input {
    transition: none !important;
    animation: none !important;
  }
  .lcp-dialog { transform: none; }
}
