/*
 * LP core — formulário de pedido e barra fixa de CTA.
 * Usa os tokens definidos pela página: --bg, --surface, --ink, --muted, --line,
 * --primary, --on-primary, --accent, --error, --focus, --radius, --font-head, --font-body.
 */
[hidden] { display: none !important; }
html.lp-lock { overflow: hidden; }

.lp-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.lp-dialog::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(3px); }
.lp-dialog[open] { display: flex; animation: lp-in .22s ease-out; }
@keyframes lp-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lp-dialog[open] { animation: none; } }

.lp-form { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 24px); font-family: var(--font-body); }
.lp-form__head { position: relative; padding: 24px 56px 0 28px; }
.lp-form__kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lp-form__title { margin: 0; font-family: var(--font-head); font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.lp-form__close {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer;
}
.lp-form__close span, .lp-form__close span::after {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: var(--ink); border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg); content: "";
}
.lp-form__close span::after { transform: translate(-50%, -50%) rotate(90deg); }
.lp-form__close:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.lp-progress { height: 4px; margin: 18px 0 0; border-radius: 4px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.lp-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s ease; }

.lp-form__body { padding: 20px 28px 8px; overflow-y: auto; overscroll-behavior: contain; }
.lp-step__title { margin: 0 0 4px; font-family: var(--font-head); font-size: 18px; line-height: 1.3; }
.lp-step__intro { margin: 0 0 16px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.lp-fields { display: grid; gap: 16px; }

.lp-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.lp-label { font-size: 14px; font-weight: 600; line-height: 1.35; padding: 0; }
.lp-label em { font-style: normal; font-weight: 400; color: var(--muted); }
.lp-field input[type="text"], .lp-field input[type="email"], .lp-field input[type="tel"],
.lp-field select, .lp-field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.lp-field textarea { min-height: 92px; resize: vertical; }
.lp-field select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.lp-field input:focus, .lp-field select:focus, .lp-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.lp-help { color: var(--muted); font-size: 13px; line-height: 1.4; }
.lp-error { color: var(--error); font-size: 13px; font-weight: 600; min-height: 0; }
.lp-error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }

.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chip { position: relative; }
.lp-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lp-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--bg);
  transition: background .15s, border-color .15s, color .15s;
}
.lp-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.lp-chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.has-error .lp-chip span { border-color: color-mix(in srgb, var(--error) 60%, var(--line)); }

.lp-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.lp-consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }

.lp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lp-form__foot { padding: 12px 28px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.lp-form__status { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.lp-form__status:empty { display: none; }
.lp-form__status.is-error { color: var(--error); font-weight: 600; }
.lp-form__status.is-busy { color: var(--muted); }
.lp-form__actions { display: flex; gap: 10px; justify-content: flex-end; }
.lp-form__privacy, .lp-form__demo { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.lp-form__demo { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }

.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .15s, filter .15s;
}
.lp-btn svg { width: 18px; height: 18px; }
.lp-btn--primary { background: var(--primary); color: var(--on-primary); flex: 1; }
.lp-btn--primary:hover { filter: brightness(1.06); }
.lp-btn--primary:disabled { opacity: .6; cursor: progress; }
.lp-btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.lp-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.lp-done { text-align: left; outline: none; padding-bottom: 8px; }
.lp-done__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.lp-done__icon svg { width: 26px; height: 26px; }
.lp-done__steps { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.5; }
.lp-done__sla { margin: 0 0 8px; font-weight: 600; font-size: 15px; }
.lp-done__note, .lp-done__demo { margin: 0 0 6px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Barra fixa (somente celular) */
.lp-sticky {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  border-radius: 999px; background: var(--sticky-bg, var(--ink)); color: var(--sticky-ink, var(--surface));
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45);
  transform: translateY(140%); transition: transform .25s ease;
}
.lp-sticky.is-visible { transform: none; }
.lp-sticky__text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; }
.lp-sticky__text strong { display: block; font-size: 14px; }
.lp-sticky .lp-btn { flex: none; min-height: 44px; padding: 0 18px; font-size: 14px; }
@media (min-width: 900px) { .lp-sticky { display: none; } }
@media (prefers-reduced-motion: reduce) { .lp-sticky { transition: none; } }

@media (max-width: 560px) {
  .lp-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .lp-form { max-height: 100dvh; height: 100%; }
  .lp-form__body { flex: 1; }
  .lp-form__head { padding: 20px 60px 0 20px; }
  .lp-form__body { padding: 18px 20px 8px; }
  .lp-form__foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
}
