/* Everything that floats above the page: boot sequence, scene rail, welcome card,
   dock (WhatsApp + quick answers), sticky call to action, storage notice,
   exit-intent modal, cursor ring, confetti. */

/* --------------------------------------------------------------------------
   Boot sequence
   -------------------------------------------------------------------------- */

.fcx-boot {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 60% at 50% 45%, #0f1330, var(--film) 75%);
  color: var(--ink);
  transition: opacity 0.5s ease, visibility 0.5s;
}

.fcx-boot.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fcx-boot__stage {
  width: min(22rem, 86vw);
  text-align: center;
}

.fcx-boot__rings {
  position: relative;
  width: 9rem;
  height: 9rem;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
}

.fcx-boot__rings i {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-top-color: transparent;
  animation: fcx-spin 2.4s linear infinite;
}

.fcx-boot__rings i:nth-child(2) {
  top: 12%; right: 12%; bottom: 12%; left: 12%;
  inset: 12%;
  border-color: rgba(168, 85, 247, 0.6);
  border-bottom-color: transparent;
  animation-duration: 1.8s;
  animation-direction: reverse;
}

.fcx-boot__rings i:nth-child(3) {
  top: 24%; right: 24%; bottom: 24%; left: 24%;
  inset: 24%;
  border-color: rgba(255, 61, 154, 0.5);
  border-left-color: transparent;
  animation-duration: 1.3s;
}

.fcx-boot__name {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1;
}

.fcx-boot__bar {
  height: 3px;
  margin: 1.4rem 0 0.6rem;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.fcx-boot__bar i {
  display: block;
  height: 100%;
  background: var(--grad);
}

.fcx-boot__pct {
  margin: 0;
  font-size: 1.5rem;
}

.fcx-boot__log {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  min-height: 9.5rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.75;
  color: var(--dim);
}

.fcx-boot__log li:last-child {
  color: var(--cyan);
}

.fcx-boot__skip {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--dim);
}

/* --------------------------------------------------------------------------
   Scene rail
   -------------------------------------------------------------------------- */

.fcx-rail {
  display: none;
}

@media (min-width: 1440px) and (min-height: 700px) {
  .fcx-rail {
    display: block;
    position: fixed;
    left: 1rem;
    top: 50%;
    z-index: 40;
    transform: translateY(-50%);
    mix-blend-mode: difference;
    color: #fff;
  }
}

.fcx-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fcx-rail a {
  position: relative;
  display: flex;
  align-items: center;
  height: 1.05rem;
  color: inherit;
  text-decoration: none;
}

.fcx-rail i {
  display: block;
  width: 0.9rem;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  transition: width 0.25s, opacity 0.25s, height 0.25s;
}

.fcx-rail a:hover i,
.fcx-rail a:focus-visible i,
.fcx-rail a.is-active i {
  width: 1.9rem;
  height: 2px;
  opacity: 1;
}

.fcx-rail span {
  position: absolute;
  left: 2.5rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.fcx-rail a:hover span,
.fcx-rail a:focus-visible span {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Welcome card
   -------------------------------------------------------------------------- */

.fcx-greet {
  position: fixed;
  top: 6.4rem;
  left: 50%;
  z-index: 62;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.6rem 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-2);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  color: var(--ink);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.8);
  animation: fcx-drop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes fcx-drop {
  from { opacity: 0; transform: translate(-50%, -0.75rem); }
}

.fcx-greet b,
.fcx-greet small {
  display: block;
  line-height: 1.25;
}

.fcx-greet small {
  color: var(--dim);
  font-size: 0.82rem;
}

.fcx-greet .fcx-icon-btn,
.fcx-chat .fcx-icon-btn,
.fcx-sticky .fcx-icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}

.fcx-greet__orb {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--cyan) 30%, var(--violet) 70%);
  box-shadow: 0 0 1.2rem rgba(0, 229, 255, 0.6);
}

/* --------------------------------------------------------------------------
   Dock: quick answers + WhatsApp
   -------------------------------------------------------------------------- */

.fcx-dock {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.fcx-dock__btn {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 0.9rem 2rem -0.6rem rgba(0, 0, 0, 0.7);
  transition: transform 0.2s;
}

.fcx-dock__btn:hover {
  transform: scale(1.06);
}

.fcx-dock__btn--wa {
  background: var(--whatsapp);
}

.fcx-dock__btn--wa:focus-visible,
.fcx-dock__btn--chat:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 50%;
}

.fcx-dock__btn--chat {
  background: linear-gradient(#0a0d18, #0a0d18) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
  color: #e9ecf5;
}

.fcx-chat {
  width: min(22.5rem, calc(100vw - 2rem));
  height: min(31rem, calc(100vh - 11rem));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: 0 2rem 4rem -1.5rem rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: fcx-rise 0.25s ease-out both;
}

@keyframes fcx-rise {
  from { opacity: 0; transform: translateY(0.6rem); }
}

.fcx-chat header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.8rem 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.fcx-chat header > div {
  flex: 1;
  min-width: 0;
}

.fcx-chat header b,
.fcx-chat header small {
  display: block;
  line-height: 1.25;
}

.fcx-chat header small {
  color: var(--dim);
  font-size: 0.78rem;
}

.fcx-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fcx-chat__body p {
  margin: 0;
  max-width: 88%;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.fcx-chat__body p.is-bot {
  align-self: flex-start;
  background: var(--glass);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
}

.fcx-chat__body p.is-you {
  align-self: flex-end;
  background: var(--grad);
  color: #05070d;
  border-bottom-right-radius: 3px;
}

.fcx-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1rem 0.75rem;
}

.fcx-chat__quick button,
.fcx-chat__quick a {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--ink);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
}

.fcx-chat__quick button:hover,
.fcx-chat__quick a:hover {
  border-color: var(--hi2);
}

.fcx-chat__quick a {
  border-color: var(--whatsapp);
  color: var(--whatsapp);
}

.fcx-chat form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--line);
}

.fcx-chat form input {
  flex: 1;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.fcx-chat form input:focus {
  outline: 2px solid var(--hi2);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Sticky call to action and storage notice
   -------------------------------------------------------------------------- */

.fcx-sticky,
.fcx-cookie {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 64;
  background: var(--bg-2);
  background: color-mix(in srgb, var(--bg-2) 90%, transparent);
  color: var(--ink);
  box-shadow: 0 1.5rem 3rem -1.25rem rgba(0, 0, 0, 0.85);
  animation: fcx-rise 0.35s ease-out both;
}

.fcx-sticky {
  left: 1rem;
  right: 5.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.25;
}

.fcx-sticky > span {
  flex: 1;
  min-width: 0;
}

@media (max-width: 559px) {
  .fcx-sticky {
    border-radius: 1.4rem;
    font-size: 0.82rem;
  }
}

@media (min-width: 900px) {
  .fcx-sticky {
    left: 50%;
    right: auto;
    width: max-content;
    max-width: calc(100vw - 14rem);
    margin-left: 0;
    transform: translateX(-50%);
    animation-name: fcx-rise-center;
  }
}

@keyframes fcx-rise-center {
  from { opacity: 0; transform: translate(-50%, 0.6rem); }
}

.fcx-cookie {
  left: 1rem;
  right: 5.4rem;
  z-index: 66;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .fcx-cookie {
    right: auto;
    max-width: 24rem;
  }
}

.fcx-cookie p {
  margin: 0 0 0.8rem;
  line-height: 1.45;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 85%, transparent);
}

.fcx-cookie div {
  display: flex;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Exit-intent modal
   -------------------------------------------------------------------------- */

.fcx-modal__veil {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 90;
  background: rgba(2, 3, 8, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fcx-fade 0.2s ease-out both;
}

@keyframes fcx-fade {
  from { opacity: 0; }
}

.fcx-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 91;
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: clamp(1.4rem, 4vw, 2.25rem);
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: 0 3rem 6rem -2rem #000, 0 0 6rem -2rem var(--violet);
  box-shadow: 0 3rem 6rem -2rem #000, 0 0 6rem -2rem color-mix(in srgb, var(--violet) 70%, transparent);
}

.fcx-modal__title {
  margin: 0.6rem 2.5rem 0.6rem 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.02;
}

.fcx-modal__body {
  margin: 0 0 1.25rem;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}

.fcx-modal .fcx-field + .fcx-field {
  margin-top: 0.9rem;
}

.fcx-modal .fcx-form__actions small {
  color: var(--dim);
  font-size: 0.82rem;
}

.fcx-modal__x {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
}

/* --------------------------------------------------------------------------
   Cursor ring, confetti, toasts
   -------------------------------------------------------------------------- */

.fcx-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 110;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1.5px solid #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, width 0.25s, height 0.25s;
  will-change: transform;
}

.fcx-cursor.is-on {
  opacity: 0.55;
}

.fcx-cursor.is-over {
  width: 3.6rem;
  height: 3.6rem;
  opacity: 0.9;
}

.fcx-confetti {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.fcx-toast {
  font-family: var(--font-sans) !important;
}

@media (prefers-reduced-motion: reduce) {
  .fcx-greet,
  .fcx-chat,
  .fcx-sticky,
  .fcx-cookie,
  .fcx-modal__veil {
    animation: none;
  }
}

@media print {
  .fcx-dock,
  .fcx-sticky,
  .fcx-cookie,
  .fcx-greet,
  .fcx-rail,
  .fcx-cursor,
  .fcx-backdrop,
  .fcx-boot {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   v28.1 · tap reliability on every device and browser
   -------------------------------------------------------------------------- */
/* iOS Safari only sends clicks to elements it considers clickable */
[data-action], [data-speak], [data-calc-tab], [data-track][tabindex], [role="button"], [role="tab"], summary, label[for], .fcx-chip { cursor: pointer; }
a, button, [role="button"], [role="tab"], summary, input, select, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: rgba(120, 120, 140, 0.18); }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
/* The footer's last row stays clear of the floating Founder AI, chat and WhatsApp buttons */
.fcx-footer { padding-bottom: calc(6.25rem + env(safe-area-inset-bottom)); }
/* Keep content clear of the floating chat / WhatsApp / Founder AI buttons on phones */
@media (max-width: 1024px) {
  .fcx-journey__stage { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) { .fcx-dock { gap: 0.5rem; } }
@media (pointer: coarse) { .fcx-footer li a { display: inline-block; padding-block: 0.2rem; } }

/* v28.6: iPhone Safari zooms the page into any field under 16px; keep the chat field at 16px on touch screens. */
@media (hover: none), (max-width: 900px) { .fcx-chat form input { font-size: 16px; } }

/* v28.7: voice conversation — the microphone ring follows the visitor's voice; listening state is clear */
.fcx-chat [data-chat-mic] { box-shadow: 0 0 0 calc(var(--lvl, 0) * 9px) rgba(0, 229, 255, .28); transition: box-shadow .08s linear; }
.fcx-chat.is-listening [data-chat-input] { border-color: var(--cyan, #00e5ff); }
.fcx-chat.is-listening [data-chat-input]::placeholder { color: var(--cyan, #00e5ff); }
