/* LL Contact Form — v1.0.5 */

.ll-form-wrapper {
  max-width: 540px;
  font-family: inherit;
}

/* ── Card container ──────────────────────── */

.ll-form {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

/* ── Fields ───────────────────────────────── */

.ll-form__group {
  margin-bottom: 16px;
}

.ll-form__group:last-of-type {
  margin-bottom: 20px;
}

.ll-form-wrapper .ll-form input,
.ll-form-wrapper .ll-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  background: #fafafa;
  color: #333;
}

.ll-form-wrapper .ll-form input::placeholder,
.ll-form-wrapper .ll-form textarea::placeholder {
  color: #999;
}

.ll-form-wrapper .ll-form input:focus,
.ll-form-wrapper .ll-form textarea:focus {
  outline: none;
  border-color: var(--ll-primary-color);
  box-shadow: 0 0 0 3px rgba(45,90,61,0.1);
  background: #fff;
}

.ll-form-wrapper .ll-form textarea {
  min-height: 90px;
  resize: vertical;
  padding: 10px 14px;
}

/* ── Hint text ───────────────────────────── */

.ll-form__hint {
  font-size: 13px;
  color: #888;
  margin: -8px 0 12px;
  padding: 0;
}

/* ── Title ────────────────────────────────── */

.ll-form__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
  text-align: center;
}

/* ── Popup (instant-quote) microcopy ──────────
   Rendered only in popup mode — inline forms never emit these selectors,
   so existing client forms are byte-for-byte unchanged. */
.ll-form__title + .ll-form__subtitle { margin-top: -12px; }
.ll-form__subtitle {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #555;
  text-align: center;
  margin-bottom: 18px;
}
.ll-form__addr-help {
  margin: 8px 2px 2px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #555;
}
.ll-form__addr-help-label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #444;
}
.ll-form__addr-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ll-form__addr-help-list li {
  position: relative;
  padding-left: 20px;
  margin: 3px 0;
}
.ll-form__addr-help-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ll-primary-color, #2d5a3d);
  font-weight: 700;
}

/* ── Button ───────────────────────────────── */

.ll-form__btn {
  background: var(--ll-primary-color);
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-top: 10px;
}

.ll-form__btn:hover {
  background: var(--ll-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ll-form__btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.ll-form__btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  transform: none;
}

/* ── Spinner ──────────────────────────────── */

.ll-form__spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ll-spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes ll-spin {
  to { transform: rotate(360deg); }
}

/* ── Submitting state ─────────────────────── */

.ll-form--submitting .ll-form__fields {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ll-form--submitting .ll-form__btn {
  pointer-events: none;
}

/* ── Success state ────────────────────────── */

.ll-form__success {
  display: none;
  text-align: center;
  padding: 40px 20px;
  animation: ll-fade-in 0.4s ease;
}

.ll-form__success svg {
  stroke: var(--ll-primary-color);
  margin-bottom: 12px;
}

.ll-form__success p {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ll-primary-color);
  margin: 0;
}

.ll-form--success .ll-form__fields {
  display: none;
}

.ll-form--success .ll-form__btn {
  display: none;
}

.ll-form--success .ll-form__success {
  display: block;
}

@keyframes ll-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Error message ────────────────────────── */

.ll-form__error {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
}

.ll-form__error.ll-form__error--visible {
  display: block;
}

/* ── Google Places Autocomplete ───────────── */
/* The .pac-container is appended to <body> by Google.
   Divi's global resets can break its layout. Override aggressively. */

/* Prevent Google error icon from tiling across the input */
.ll-form-wrapper .ll-form input.gm-err-autocomplete {
  background-image: none !important;
}

.pac-container {
  z-index: 2147483610 !important;
  display: block !important;
  position: absolute !important;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
  border: 1px solid #e0e0e0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background: #fff !important;
  overflow: hidden !important;
  min-width: 300px;
  margin-top: 4px;
}

.pac-container .pac-item {
  display: block !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  border-top: 1px solid #f0f0f0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333 !important;
}

.pac-container .pac-item:first-child {
  border-top: none !important;
}

.pac-container .pac-item:hover,
.pac-container .pac-item.pac-item-selected {
  background: #f5f5f5 !important;
}

.pac-container .pac-item .pac-icon {
  display: inline-block !important;
  margin-right: 8px !important;
  vertical-align: middle;
}

.pac-container .pac-item .pac-item-query {
  font-weight: 600 !important;
  color: #333 !important;
}

.pac-container .pac-item .pac-matched {
  font-weight: 700 !important;
}

/* Hide "powered by Google" logo — allowed for legacy Autocomplete widget */
.pac-container.pac-logo::after {
  display: none !important;
}

/* ── Address verification modal ─────────────────── */
.ll-form__modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483620;
  padding: 16px;
  animation: ll-fade-in 0.15s ease-out;
}
@keyframes ll-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ll-form__modal {
  background: #fff;
  border-radius: 10px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.ll-form__modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #222;
  margin: 0 0 12px;
  line-height: 1.3;
}
.ll-form__modal-address {
  font-size: 16px;
  color: #2d5a3d;
  background: #f5f9f6;
  border: 1px solid #d8e7dc;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 0 0 16px;
  line-height: 1.4;
}
.ll-form__modal-help {
  font-size: 13px;
  color: #666;
  margin: 0 0 18px;
  line-height: 1.4;
}
.ll-form__modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ll-form__modal-btn {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  word-wrap: break-word;
}
.ll-form__modal-btn:hover {
  opacity: 0.88;
}
.ll-form__modal-btn--primary {
  background: var(--ll-primary-color, #2d5a3d);
  color: #fff;
}
.ll-form__modal-btn--secondary {
  background: #f0f0f0;
  color: #333;
}
.ll-form__modal-btn--link {
  background: transparent;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  padding: 6px;
}
@media (max-width: 480px) {
  .ll-form__modal { padding: 20px; }
  .ll-form__modal-title { font-size: 16px; }
}

/* ── LawnBot popup modal (display="popup") ─────────────────────────────
   Plugin-owned floating modal. Hidden by default (no layout shift, inert
   until a trigger opens it). Strictly additive — none of the selectors
   above are touched, so inline forms are unaffected.
   z-index layering (low → high): overlay 2147483600 < Places dropdown
   2147483610 < address-confirm modal 2147483620, so both still stack above
   the popup. All three are body-level (overlay is portaled to <body> in
   setupModal — see ll-contact-form.js), so z-index is authoritative and no
   transformed Divi ancestor can trap the fixed overlay behind page images. */

.ll-lawnbot-overlay {
  display: none;                 /* shown via --open; [hidden] attr is belt-and-suspenders */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2147483600;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ll-lawnbot-overlay--open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  animation: ll-lawnbot-fade 0.15s ease-out;
}

@keyframes ll-lawnbot-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Lock background scroll while the popup is open */
body.ll-lawnbot-lock {
  overflow: hidden;
}

.ll-lawnbot-dialog {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 480px;
}

/* Close (✕) control */
.ll-lawnbot-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: transform 0.12s, background 0.12s;
}

.ll-lawnbot-close:hover {
  transform: scale(1.08);
  background: #f3f3f3;
}

/* The inner form fills the dialog cleanly (no card-in-card max-width clamp) */
.ll-lawnbot-overlay .ll-form-wrapper {
  max-width: 100%;
}

/* Keep the popup usable on short viewports */
@media (max-height: 640px) {
  .ll-lawnbot-overlay { padding: 8px; }
  .ll-lawnbot-overlay .ll-form { padding: 20px 20px 18px; }
}

@media (max-width: 480px) {
  .ll-lawnbot-close { top: -10px; right: -2px; }
}

/* ── Bot-page embed (display="botpage") ── */
/* In-content iframe so the site header/nav/footer wrap it (our domain, our
   branding) — not a full-screen takeover. Tall enough for the bot's flow. */
.ll-botpage {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}
.ll-botpage__frame {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: 0;
}
@media (max-width: 480px) {
  .ll-botpage__frame { height: 88vh; min-height: 520px; }
}
