/* Flowsdone chat demo page (chat.flowsdone.com). Same brand as the landing
   (static/flowsdone/styles.css): navy #04141F, cyan #19B4E6 -> green #3EFF8B,
   Outfit. Mobile first. */

:root {
  --navy: #04141f;
  --navy-2: #0a2231;
  --navy-3: #12324a;
  --cyan: #19b4e6;
  --green: #3eff8b;
  --green-2: #24e5a3;
  --ink: #0b1b2b;
  --on-dark: #eaf6f2;
  --on-dark-muted: #9fb3c2;
  --grad: linear-gradient(90deg, var(--cyan) 0%, var(--green-2) 70%, var(--green) 100%);
  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--on-dark);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(25 180 230 / 0.22), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgb(62 255 139 / 0.12), transparent 60%),
    var(--navy);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}

a { color: inherit; }
h1, h2 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.container { position: relative; width: min(1160px, 100% - 40px); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgb(4 20 31 / 0.82); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 10px; }
.brand-name { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #f2fbf7; }
.brand-name span { font-weight: 300; color: var(--green); }
.header-link { font-size: 15px; text-decoration: none; color: var(--on-dark-muted); transition: color 0.15s; }
.header-link:hover { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: var(--navy); box-shadow: 0 8px 24px -10px rgb(36 229 163 / 0.7); }
.btn-primary:hover { box-shadow: 0 12px 30px -10px rgb(36 229 163 / 0.9); }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgb(234 246 242 / 0.35); }
.btn-ghost:hover { background: rgb(234 246 242 / 0.08); }

/* ---------- Demo ---------- */
.demo { padding: 40px 0 56px; }
.demo-grid { display: grid; gap: 40px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 14px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgb(62 255 139 / 0.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(62 255 139 / 0.55); }
  70% { box-shadow: 0 0 0 10px rgb(62 255 139 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(62 255 139 / 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.demo h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 700; color: #fff; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 18px; font-size: clamp(17px, 2vw, 19px); color: var(--on-dark-muted); max-width: 560px; }

.points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; font-size: 16px; }
.points li { display: flex; gap: 10px; align-items: center; }
.points li::before {
  content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: var(--grad); color: var(--navy); font-size: 12px; font-weight: 800;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.test-badge {
  display: inline-block; margin-top: 22px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--on-dark-muted);
  background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.1);
}

.privacy-note { margin-top: 22px; font-size: 13px; color: var(--on-dark-muted); max-width: 520px; }

/* The chat, framed like the landing's phone mockup. */
.stage { justify-self: center; width: min(440px, 100%); display: grid; gap: 14px; }

/* Chatear / Llamar switch, only when the agent also has a phone. */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.1);
}
.tab {
  padding: 9px 12px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--on-dark-muted); background: transparent;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { background: var(--grad); color: var(--navy); }

.chat-frame {
  width: 100%; height: min(680px, 78vh); min-height: 460px;
  padding: 10px; border-radius: 30px;
  background: linear-gradient(180deg, #0f2a3b, #0a1f2d);
  border: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.7), 0 0 0 8px rgb(255 255 255 / 0.03);
}
.chat-frame .agent-chat-widget { border-radius: 22px; box-shadow: none; font-family: var(--font); }
.chat-frame .agent-chat-header { background: var(--navy-2); border-bottom: 1px solid rgb(255 255 255 / 0.06); }
.chat-frame .agent-chat-messages { background: #f4f7fb; }
.chat-frame .agent-chat-input-area input { font-family: var(--font); font-size: 15px; }

/* No (or broken) link: explain instead of showing a dead chat. */
.notice-card {
  justify-self: center; width: min(440px, 100%); padding: 32px 28px; border-radius: 24px; text-align: center;
  background: rgb(255 255 255 / 0.04); border: 1px solid rgb(255 255 255 / 0.1);
}
.notice-card h2 { font-size: 24px; color: #fff; }
.notice-card p { margin-top: 12px; color: var(--on-dark-muted); }
.notice-card .btn { margin-top: 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid rgb(255 255 255 / 0.06); padding: 22px 0; font-size: 14px; color: var(--on-dark-muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }

@media (min-width: 900px) {
  .demo { padding: 64px 0 80px; }
  .demo-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; }
}

/* ---------- Llamar ---------- */
.call-panel { display: grid; }
.call-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  height: 100%; padding: 28px 22px; border-radius: 22px;
  background: radial-gradient(420px 300px at 50% 0%, rgb(25 180 230 / 0.18), transparent 70%), var(--navy-2);
}
.call-avatar {
  position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%;
  background: var(--grad); color: var(--navy); font-size: 44px; font-weight: 700;
}
.call-avatar::before, .call-avatar::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgb(62 255 139 / 0.5);
  opacity: 0; pointer-events: none;
}
.call-panel[data-state="connecting"] .call-avatar::before,
.call-panel[data-state="inCall"] .call-avatar::before { animation: ring 1.8s infinite; }
.call-panel[data-state="connecting"] .call-avatar::after,
.call-panel[data-state="inCall"] .call-avatar::after { animation: ring 1.8s 0.9s infinite; }
@keyframes ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .call-avatar::before, .call-avatar::after { animation: none !important; } }

.call-name { margin-top: 20px; font-size: 24px; font-weight: 700; color: #fff; }
.call-status { margin-top: 6px; min-height: 1.6em; color: var(--on-dark-muted); max-width: 320px; }
.call-panel[data-state="error"] .call-status { color: #ffb4a8; }
.call-timer { margin-top: 4px; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }

.call-controls { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.call-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.call-btn:hover { transform: translateY(-1px); }
.call-btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.call-btn svg { width: 20px; height: 20px; }
.call-start { background: var(--grad); color: var(--navy); box-shadow: 0 8px 24px -10px rgb(36 229 163 / 0.7); }
.call-hangup { background: #e5484d; color: #fff; box-shadow: 0 8px 24px -10px rgb(229 72 77 / 0.8); }
.call-hangup svg { transform: rotate(135deg); }
.call-mute { background: transparent; color: var(--on-dark); border-color: rgb(234 246 242 / 0.35); }
.call-mute[aria-pressed="true"] { background: rgb(234 246 242 / 0.12); }

.call-hint { margin-top: 26px; font-size: 14px; color: var(--on-dark-muted); max-width: 320px; }
.call-alt { margin-top: 12px; font-size: 14px; color: var(--on-dark-muted); }
.call-alt a { color: var(--green-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.call-alt a:hover { text-decoration: underline; }
