/* ==========================================================================
   CTA (#start) + footer. The bookend to the hero: same white ground and soft
   glow, mirrored. Signature: the visitor's answers assemble, live, into an
   outgoing WhatsApp bubble; on submit it is marked sent and WhatsApp opens.
   States on #start (set by js/cta.js): .is-in (entered), .is-ready (name and
   business filled), .is-sent (submitted).
   ========================================================================== */

#start { overflow: clip; padding-top: clamp(80px, 9vw, 128px); padding-bottom: 0; }
#start .cta__glow {
  position: absolute; top: -6%; left: -14%; width: 72vw; height: 92vh; max-height: 900px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(8, 102, 255, 0.12), rgba(8, 102, 255, 0.04) 55%, transparent),
              radial-gradient(closest-side at 70% 70%, rgba(37, 211, 102, 0.10), transparent 70%);
  filter: blur(10px);
}

#start .cta__grid {
  position: relative; display: grid;
  grid-template-columns: 440px minmax(0, 1fr); grid-template-rows: auto 1fr;
  column-gap: clamp(56px, 7.5vw, 112px); align-items: start;
}
#start .cta__scene { grid-column: 1; grid-row: 1 / span 2; }
#start .cta__copy { grid-column: 2; grid-row: 1; padding-top: 8px; }
#start .cta__form { grid-column: 2; grid-row: 2; margin-top: 44px; }

/* ---- copy ---------------------------------------------------------------- */
#start .cta__h { font-size: clamp(2.7rem, 1.25rem + 4.1vw, 4.75rem); line-height: 0.98; letter-spacing: -0.038em; max-width: 9em; }
#start .cta__lead { margin-top: 24px; max-width: 29em; }

/* ---- form ---------------------------------------------------------------- */
#start .cta__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
#start .cta__field--wide { grid-column: 1 / -1; }
#start .cta__field label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
#start .cta__optional-l { font-weight: 400; color: var(--soft); }
#start .cta__input {
  display: block; width: 100%; height: 56px; padding: 0 18px;
  border: 0; border-radius: 14px; background: #fff; outline: none;
  font-size: 17px; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: box-shadow 0.2s var(--ease);
}
#start .cta__input:hover { box-shadow: inset 0 0 0 1px rgba(10, 11, 15, 0.26), 0 1px 2px rgba(16, 24, 40, 0.04); }
#start .cta__input:focus { box-shadow: inset 0 0 0 2px var(--blue), 0 1px 2px rgba(16, 24, 40, 0.04); }
#start .cta__input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #d92d20; }
#start .cta__input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 2px #d92d20, 0 1px 2px rgba(16, 24, 40, 0.04); }
#start .cta__err {
  display: flex; align-items: center; gap: 7px; margin-top: 9px;
  font-size: 14px; font-weight: 500; color: #b42318;
}
#start .cta__err[hidden] { display: none; }
#start .cta__err::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: #d92d20 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 4.2v4.6' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.4' r='1.1' fill='white'/%3E%3C/svg%3E") center / 16px no-repeat;
}

#start .cta__actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
#start .cta__submit { height: 58px; padding: 0 30px; font-size: 17px; }
#start .cta__note { display: flex; align-items: flex-start; gap: 10px; max-width: 16.5em; font-size: 14.5px; line-height: 1.45; color: var(--soft); }
#start .cta__note svg { flex: none; width: 19px; height: 19px; margin-top: 1px; color: var(--faint); }
#start .cta__status { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
#start .cta__status:not(:empty) { margin-top: 18px; }
#start .cta__status a { color: var(--blue); font-weight: 600; text-underline-offset: 3px; }

/* ---- scene (desktop phone) ---------------------------------------------- */
#start .cta__scene { position: relative; height: 640px; }
#start .cta__plane { position: absolute; will-change: transform; }
#start .cta__plane--phone { left: 50%; top: 0; margin-left: -150px; z-index: 1; }
#start .cta__plane--pill { left: -30px; top: 318px; z-index: 2; }
/* the toast lands in the chat's open band, between the contact card and the bubble */
#start .cta__plane--toast { right: -76px; top: 300px; z-index: 3; }
#start .cta__live { box-shadow: var(--shadow-md); }

#start .cta__av { display: grid; place-items: center; flex: none; }
#start .cta__av svg { width: 17px; height: 17px; fill: #fff; }
#start .cta__chat { padding-top: 22px; }
#start .cta__card { margin-bottom: auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-size: 15px; line-height: 1.3; }
#start .cta__card-av { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 10px; border-radius: 50%; background: linear-gradient(135deg, #0a0b0f, #3a3f4d); box-shadow: 0 6px 16px -6px rgba(16, 24, 40, 0.35); }
#start .cta__card-av svg { width: 28px; height: 28px; fill: #fff; }
#start .cta__card-num { font-size: 13px; color: #3b4a54; }
#start .cta__card small { margin-top: 6px; font-size: 12px; color: #667781; max-width: 17em; }

/* composer: our own, so the send button can be off until the message is ready */
#start .cta__compose {
  display: flex; align-items: center; justify-content: space-between; flex: none;
  height: 42px; margin: 0 10px 18px; padding: 0 5px 0 16px;
  border-radius: var(--r-pill); background: #fff; font-size: 14px; color: var(--faint);
}
#start .cta__send { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #d4d8de; }
#start .cta__send::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--wa);
  opacity: 0; transform: scale(0.5); transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}
#start .cta__send svg { position: relative; width: 17px; height: 17px; fill: #fff; transform: translateX(1px) rotate(-8deg) scale(0.9); transition: transform 0.6s var(--ease); }
#start.is-ready .cta__send::before { opacity: 1; transform: none; }
#start.is-ready .cta__send svg { transform: translateX(1px); }
#start.is-sent .cta__send { animation: cta-press 0.55s var(--ease); }
@keyframes cta-press { 30% { transform: scale(0.82); } 100% { transform: none; } }

/* ---- the bubble --------------------------------------------------------- */
#start .cta__bubble { max-width: 90%; font-size: 15px; line-height: 1.45; color: #111b21; overflow-wrap: anywhere; }
#start .cta__slot { font-weight: 600; }
#start .cta__slot.is-empty {
  font-weight: 500; color: rgba(17, 27, 33, 0.55); background: rgba(17, 27, 33, 0.07);
  border-radius: 5px; padding: 0 4px; margin: 0 -1px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
#start .cta__slot.is-active { text-decoration: underline 2px rgba(8, 102, 255, 0.55); text-underline-offset: 3px; }
#start .cta__slot.is-empty.is-active { text-decoration: none; color: var(--blue); background: rgba(8, 102, 255, 0.1); }
/* the caret: a word joiner with a 2px border, so it never becomes a line-break point
   (an inline-block caret let "word | ." wrap onto a new line) */
#start .cta__slot.is-active::after {
  content: "\2060"; border-right: 2px solid var(--blue); margin: 0 -2px 0 1px;
  animation: cta-caret 1.05s steps(1) infinite;
}
#start .cta__slot.is-empty.is-active::after { margin: 0 -1px 0 2px; }
@keyframes cta-caret { 50% { opacity: 0; } }
#start .cta__slot.is-pop { animation: cta-pop 0.5s var(--ease); }
@keyframes cta-pop { from { opacity: 0.25; } }
#start .cta__opt { transition: opacity 0.4s var(--ease); }
#start .cta__opt.is-blank { opacity: 0.6; }
#start .cta__opt.is-blank:has(.is-active) { opacity: 1; } /* its field is focused: the sentence is being written */
#start.is-sent .cta__opt.is-blank { display: none; }

#start .cta__meta {
  float: right; display: inline-flex; align-items: center; gap: 3px; margin: 7px -2px -3px 12px;
  font-size: 11px; line-height: 1; color: #667781; opacity: 0; transition: opacity 0.4s var(--ease);
}
#start .cta__ticks { width: 17px; height: 11px; fill: none; stroke: #667781; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; clip-path: inset(0 100% 0 0); transition: clip-path 0.55s var(--ease) 0.2s; }
#start.is-sent .cta__meta { opacity: 1; }
#start.is-sent .cta__ticks { clip-path: inset(0 0 0 0); }

/* entrance: a clip wipes the bubble open line by line while its words assemble one by one */
.js #start .cta__bubble.is-armed {
  opacity: 0; transform: translateY(8px);
  clip-path: inset(-4px -4px 100% -4px round 18px 8px 18px 18px);
  transition: opacity 0.35s var(--ease) 0.45s, transform 0.6s var(--ease) 0.45s, clip-path 1s cubic-bezier(0.45, 0, 0.4, 1) 0.45s;
}
#start.is-in .cta__bubble.is-armed { opacity: 1; transform: none; clip-path: inset(-4px round 18px 8px 18px 18px); }
.js #start .is-armed .cta__w { opacity: 0; transition: opacity 0.35s var(--ease), transform 0.45s var(--ease); transition-delay: calc(0.5s + var(--i, 0) * 34ms); }
.js #start .is-armed .cta__w:not(.cta__slot):not(.cta__w--p) { display: inline-block; transform: translateY(5px); }
#start.is-in .is-armed .cta__w, #start.is-in .is-armed .cta__w:not(.cta__slot):not(.cta__w--p) { opacity: 1; transform: none; }

/* the "sent" toast exists only after a send, with or without JS */
#start .cta__plane--toast > * { opacity: 0; }
/* without JS nothing updates live, so the mock makes no "live" claim */
html:not(.js) #start .cta__plane--pill, html:not(.js) #start .cta__mini-live { display: none; }

/* planes: entrance, then the toast on send */
.js #start .cta__plane > * { opacity: 0; transform: translateY(26px) scale(0.98); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); }
.js #start .cta__plane--toast > * { transform: translateY(-14px) scale(0.96); transition-duration: 0.5s, 0.7s; }
#start.is-in .cta__plane--phone > * { opacity: 1; transform: none; }
#start.is-in .cta__plane--pill > * { opacity: 1; transform: none; transition-delay: 1.6s; }
#start.is-in.is-sent .cta__plane--pill > * { opacity: 0; transition-delay: 0s; }
#start.is-sent .cta__plane--toast > * { opacity: 1; transform: none; transition-delay: 0.35s; }

/* narrow two-column range: a tighter scene column, planes pulled inside the page */
@media (min-width: 961px) and (max-width: 1180px) {
  #start .cta__grid { grid-template-columns: 380px minmax(0, 1fr); column-gap: 56px; }
  #start .cta__plane--pill { left: -10px; }
  #start .cta__plane--toast { right: -44px; }
}

/* short desktop screens: keep the form and the phone's composer above the fold */
@media (min-width: 961px) and (max-height: 820px) {
  #start { padding-top: 72px; }
  #start .cta__h { font-size: clamp(2.7rem, 1.25rem + 3.4vw, 4.1rem); }
  #start .cta__form { margin-top: 32px; }
  #start .cta__actions { margin-top: 26px; }
  #start .cta__scene { height: 560px; }
  #start .cta__plane--phone { margin-left: -135px; }
  #start .cta__plane--phone .phone { zoom: 0.9; }
  #start .cta__plane--pill { top: 290px; }
  #start .cta__plane--toast { top: 272px; }
}

/* ---- mobile preview (hidden on desktop) --------------------------------- */
#start .cta__mini { display: none; }

/* ---- footer -------------------------------------------------------------- */
#start .cta__foot { position: relative; margin-top: clamp(88px, 10vw, 144px); padding: 56px 0 44px; border-top: 1px solid var(--line); }
#start .cta__foot-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 28px 40px; }
#start .cta__mark { display: inline-flex; align-items: center; min-height: 44px; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; text-decoration: none; }
#start .cta__mark img, #start .cta__mark .logo { height: 34px; }
#start .cta__tag { margin-top: 10px; font-size: var(--t-small); color: var(--soft); }
#start .cta__links { display: flex; flex-wrap: wrap; gap: 2px; margin-right: -12px; }
#start .cta__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: var(--r-pill); font-size: 15px; color: var(--soft); text-decoration: none; transition: color 0.2s, background-color 0.2s; }
#start .cta__links a:hover { color: var(--ink); background: rgba(10, 11, 15, 0.04); }
#start .cta__foot-base { margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; font-size: 14.5px; color: var(--soft); }
#start .cta__contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; }
#start .cta__wa { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--ink); text-decoration: none; }
#start .cta__wa svg { width: 18px; height: 18px; color: var(--soft); }
#start .cta__wa:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* ---- tablet + mobile: form first, compact live preview inside it --------- */
@media (max-width: 960px) {
  #start .cta__grid { grid-template-columns: minmax(0, 1fr); }
  #start .cta__scene { display: none; }
  #start .cta__copy, #start .cta__form { grid-column: 1; }
  #start .cta__copy { padding-top: 0; }
  #start .cta__form { margin-top: 36px; }
  #start .cta__h { max-width: 8em; }
  #start .cta__glow { left: auto; right: -30%; top: -4%; width: 110vw; height: 70vh; }

  #start .cta__mini {
    display: block; position: relative; margin-top: 28px; padding: 0 0 12px;
    border-radius: 24px; background: var(--wa-bg); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  }
  /* the preview leads the form, so the message sits right above the field being typed in */
  #start .cta__stage > .cta__mini { margin: 0 0 28px; }
  /* pinned under the nav while the fields pass beneath it (js/cta.js sets .is-pin only when the
     visible height fits the card plus a field, so it never covers a landscape or keyboard-squeezed screen) */
  #start.is-pin .cta__stage > .cta__mini { position: sticky; top: var(--cta-pin, 84px); z-index: 3; }
  #start .cta__mini-bar {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 12px;
    border-radius: 24px 24px 0 0; background: #fff; border-bottom: 1px solid var(--line);
    font-size: 14px; line-height: 1.2;
  }
  #start .cta__mini-bar small { display: block; font-size: 12px; color: #667781; }
  #start .cta__mini-live { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12.5px; color: var(--soft); }
  #start .cta__mini-live { transition: opacity 0.3s var(--ease); }
  #start.is-sent .cta__mini-live { opacity: 0; }
  #start .cta__mini-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wa); }
  #start .cta__mini-chat { display: flex; flex-direction: column; justify-content: flex-end; min-height: 128px; padding: 16px 12px 12px; }
  #start .cta__mini .cta__bubble { max-width: 92%; }
  #start .cta__mini .cta__compose { margin: 0 10px; }
  /* on send the toast drops over the card's header like a banner notification (covers it fully, never the message) */
  #start .cta__toast--mini { position: absolute; left: 8px; right: 8px; top: -3px; z-index: 2; opacity: 0; transform: translateY(-10px) scale(0.96); transition: opacity 0.5s var(--ease), transform 0.7s var(--ease); pointer-events: none; }
  #start.is-sent .cta__toast--mini { opacity: 1; transform: none; transition-delay: 0.35s; }

  #start .cta__foot-top { flex-direction: column; }
  #start .cta__links { margin: 0 0 0 -13px; }
}
@media (max-width: 560px) {
  #start .cta__fields { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #start .cta__actions { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 24px; }
  #start .cta__submit { width: 100%; }
  #start .cta__h { font-size: 2.85rem; }
  #start .cta__note { max-width: none; }
  #start .cta__links { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 4px; }
  #start .cta__foot { padding-top: 44px; }
  #start .cta__foot-base { flex-direction: column; align-items: flex-start; margin-top: 28px; }
  #start .cta__contact { flex-direction: column; align-items: flex-start; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  #start .cta__plane > *, #start .cta__bubble, #start .cta__w, #start .cta__toast--mini,
  #start .cta__send::before, #start .cta__send svg, #start .cta__meta, #start .cta__ticks, #start .cta__opt { transition: none !important; }
  #start .cta__slot.is-active::after, #start.is-sent .cta__send, #start .cta__slot.is-pop { animation: none; }
}
