/* ============================================================
   FERZION · Design System
   Soluções inteligentes para negócios com propósito.
   Bespoke CSS — substitui o Bootstrap. Tema adaptativo claro/escuro.
   ============================================================ */

/* ---------- Tokens: tema CLARO (default) ---------- */
:root {
  /* Marca */
  --brand-green:   #16201A;
  --brand-green-2: #1E2A23;
  --brand-cream:   #ECE6D8;
  --brand-mint:    #4FD1A5;

  /* Superfícies */
  --bg:          #ECE6D8;
  --bg-grad:     radial-gradient(1200px 600px at 80% -10%, #F4EFE3 0%, #ECE6D8 55%, #E6DFCF 100%);
  --surface:     #FBF9F3;
  --surface-2:   #F3EFE4;
  --border:      #DED7C7;
  --border-soft: #E7E0D1;

  /* Texto */
  --ink:        #16201A;
  --ink-soft:   #2E3A33;
  --ink-muted:  #6A736C;

  /* Acento */
  --accent:        #1F8F6B;   /* menta de contraste p/ texto/links sobre claro */
  --accent-strong: #0F8A63;
  --accent-soft:   #E2F2EB;
  --accent-ring:   rgba(31,143,107,.22);

  /* Ação primária */
  --action-bg:     #16201A;
  --action-fg:     #F4F1E8;
  --action-bg-hov: #20302700;

  /* Feedback */
  --danger:     #B4452F;
  --danger-bg:  #FBEAE5;
  --danger-bd:  #EBC7BC;
  --warn:       #9A6B12;
  --warn-bg:    #FBF1DA;
  --warn-bd:    #ECD9AE;

  /* Bolhas de chat */
  --bubble-ia-bg:    #FFFFFF;
  --bubble-ia-bd:    #E7E0D1;
  --bubble-ia-ink:   #1B2620;
  --bubble-user-bg:  linear-gradient(180deg, #1E2A23, #16201A);
  --bubble-user-ink: #EDF6F1;

  /* Painel escuro (hero esquerdo é sempre escuro) */
  --panel-bg:    radial-gradient(900px 500px at 20% 0%, #233127 0%, #16201A 60%, #11190F 100%);
  --panel-ink:   #ECE6D8;
  --panel-muted: #A7B2AA;
  --panel-line:  rgba(79,209,165,.55);

  /* Tipografia */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Raios */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(22,32,26,.06), 0 1px 3px rgba(22,32,26,.05);
  --shadow-md: 0 6px 20px -8px rgba(22,32,26,.18), 0 2px 6px rgba(22,32,26,.06);
  --shadow-lg: 0 24px 60px -20px rgba(22,32,26,.30), 0 8px 24px -12px rgba(22,32,26,.18);
  --shadow-accent: 0 0 0 0 transparent;

  /* Logo */
  --logo-filter: none;

  --maxw: 1180px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Tokens: tema ESCURO ---------- */
:root[data-theme="dark"] {
  --bg:          #11190F;
  --bg-grad:     radial-gradient(1100px 600px at 80% -10%, #1A2419 0%, #141B17 50%, #0E140F 100%);
  --surface:     #1A241C;
  --surface-2:   #212E25;
  --border:      #2C3A30;
  --border-soft: #25322A;

  --ink:        #ECE6D8;
  --ink-soft:   #D3D9CE;
  --ink-muted:  #97A39A;

  --accent:        #4FD1A5;
  --accent-strong: #6BE0BB;
  --accent-soft:   #18261F;
  --accent-ring:   rgba(79,209,165,.30);

  --action-bg:     #4FD1A5;
  --action-fg:     #0F1A14;

  --danger:     #E89077;
  --danger-bg:  #2A1B16;
  --danger-bd:  #5A382C;
  --warn:       #E7C77E;
  --warn-bg:    #271F12;
  --warn-bd:    #4A3C1F;

  --bubble-ia-bg:    #212E25;
  --bubble-ia-bd:    #2E3D32;
  --bubble-ia-ink:   #E8EDE4;
  --bubble-user-bg:  linear-gradient(180deg, #56DAAE, #3FBE93);
  --bubble-user-ink: #0E1A13;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
  --shadow-md: 0 8px 24px -10px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 28px 70px -24px rgba(0,0,0,.70), 0 10px 30px -16px rgba(0,0,0,.55);
  --shadow-accent: 0 0 24px -2px rgba(79,209,165,.35);

  --logo-filter: brightness(0) invert(.92);
}

/* Fallback sem JS: respeita preferência do sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #11190F;
    --bg-grad:     radial-gradient(1100px 600px at 80% -10%, #1A2419 0%, #141B17 50%, #0E140F 100%);
    --surface:     #1A241C;
    --surface-2:   #212E25;
    --border:      #2C3A30;
    --border-soft: #25322A;
    --ink:        #ECE6D8;
    --ink-soft:   #D3D9CE;
    --ink-muted:  #97A39A;
    --accent:        #4FD1A5;
    --accent-strong: #6BE0BB;
    --accent-soft:   #18261F;
    --accent-ring:   rgba(79,209,165,.30);
    --action-bg:     #4FD1A5;
    --action-fg:     #0F1A14;
    --danger:     #E89077;
    --danger-bg:  #2A1B16;
    --danger-bd:  #5A382C;
    --bubble-ia-bg:    #212E25;
    --bubble-ia-bd:    #2E3D32;
    --bubble-ia-ink:   #E8EDE4;
    --bubble-user-bg:  linear-gradient(180deg, #56DAAE, #3FBE93);
    --bubble-user-ink: #0E1A13;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
    --shadow-md: 0 8px 24px -10px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
    --shadow-lg: 0 28px 70px -24px rgba(0,0,0,.70), 0 10px 30px -16px rgba(0,0,0,.55);
    --shadow-accent: 0 0 24px -2px rgba(79,209,165,.35);
    --logo-filter: brightness(0) invert(.92);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- Utilities ---------- */
.hide { display: none !important; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.center-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 20px 56px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar__inner { width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- Lockup da marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; filter: var(--logo-filter); flex: none; }
.brand__word {
  font-family: var(--font-display); font-weight: 700; font-size: 1.18rem;
  letter-spacing: .14em; text-transform: uppercase;
}
.brand__word .dot { color: var(--accent); }
.brand--lg .brand__mark { width: 52px; height: 52px; }
.brand--lg .brand__word { font-size: 1.7rem; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; color: var(--ink-soft); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.card--pad { padding: 30px; }
@media (max-width: 560px) { .card--pad { padding: 22px; } }

/* ---------- Eyebrow / headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: .74rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.title-xl { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.title-lg { font-size: clamp(1.5rem, 3.5vw, 1.95rem); }
.lead { color: var(--ink-muted); font-size: 1.04rem; }
.muted { color: var(--ink-muted); }
.small { font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn--primary {
  background: var(--action-bg); color: var(--action-fg);
  box-shadow: var(--shadow-md), var(--shadow-accent);
}
.btn--primary:hover { box-shadow: var(--shadow-lg), var(--shadow-accent); transform: translateY(-2px); color: var(--action-fg); }
.btn--primary .arrow { transition: transform .2s var(--ease); }
.btn--primary:hover .arrow { transform: translateX(4px); }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 26px; font-size: 1.04rem; }
.btn--sm { padding: 8px 15px; font-size: .85rem; }
.btn[disabled], .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }
.field__label {
  display: block; margin-bottom: 7px;
  font-weight: 600; font-size: .9rem; color: var(--ink-soft);
}
.field__label .req { color: var(--accent); margin-left: 2px; }
.form-control,
input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], input[type="number"], textarea, select {
  width: 100%; padding: 13px 15px;
  background: var(--bg); color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: 1rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { background: #131C16; }
.form-control::placeholder, input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: .8; }
.form-control:focus,
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring); background: var(--surface);
}
.field__help { margin-top: 6px; font-size: .82rem; color: var(--ink-muted); }
.field__error, .invalid-feedback {
  display: block; margin-top: 6px; font-size: .85rem; color: var(--danger); font-weight: 500;
}
.field--invalid .form-control,
.field--invalid input, .field--invalid textarea { border-color: var(--danger); }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 15px; border-radius: var(--r-md);
  font-size: .9rem; border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex: none; }
.alert__msg { flex: 1; min-width: 12ch; }
.alert .btn { margin-left: auto; }
.alert--warn .btn--ghost { border-color: currentColor; color: inherit; }
.alert--warn .btn--ghost:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.alert--warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); }
.alert--danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); }
.alert--info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-strong); }

/* ---------- Reassurance / chips ---------- */
.reassure {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; font-size: .82rem; color: var(--ink-muted);
}
.reassure svg { width: 15px; height: 15px; color: var(--accent); }

/* ============================================================
   LANDING — hero split
   ============================================================ */
.hero {
  width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero__panel {
  position: relative; padding: 48px 44px;
  background: var(--panel-bg); color: var(--panel-ink);
  display: flex; flex-direction: column;
  isolation: isolate; overflow: hidden;
}
.hero__panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 22px);
  mask-image: linear-gradient(120deg, #000 35%, transparent 90%);
}
.hero__panel::after {
  content: ""; position: absolute; top: -1px; right: 0; bottom: -1px; width: 3px;
  background: linear-gradient(180deg, transparent, var(--panel-line), transparent);
}
.hero__panel .brand { color: var(--panel-ink); }
.hero__panel .brand__mark { filter: brightness(0) invert(.92); }
.hero__eyebrow { color: var(--brand-mint); }
.hero__eyebrow::before { background: var(--brand-mint); }
.hero__title { color: var(--panel-ink); margin: 18px 0 12px; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.hero__title em { color: var(--brand-mint); font-style: normal; }
.hero__sub { color: var(--panel-muted); font-size: 1.02rem; max-width: 42ch; }

.pillars { margin-top: auto; padding-top: 34px; display: grid; gap: 16px; }
.pillar { display: flex; gap: 14px; align-items: flex-start; }
.pillar__ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid rgba(79,209,165,.45); color: var(--brand-mint);
  background: rgba(79,209,165,.08);
}
.pillar__ico svg { width: 20px; height: 20px; }
.pillar__t { font-family: var(--font-display); font-weight: 600; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brand-mint); }
.pillar__d { color: var(--panel-muted); font-size: .92rem; line-height: 1.45; }

.hero__form { padding: 44px 42px; display: flex; flex-direction: column; justify-content: center; }
.hero__form-head { margin-bottom: 22px; }
.hero__form-head h2 { font-size: 1.5rem; }
.hero__form-head p { color: var(--ink-muted); margin-top: 6px; font-size: .95rem; }

/* Resume callout */
.resume {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft); border-radius: var(--r-lg);
  padding: 18px 20px; margin-bottom: 20px;
}
.resume__t { font-weight: 600; color: var(--ink); }
.resume__d { color: var(--ink-muted); font-size: .9rem; margin: 4px 0 14px; }
.divider-text {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 20px;
  color: var(--ink-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
}
.divider-text::before, .divider-text::after { content: ""; height: 1px; flex: 1; background: var(--border); }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero__panel { padding: 38px 30px; }
  .hero__panel::after { display: none; }
  .hero__form { padding: 32px 28px; }
  .pillars { padding-top: 28px; }
}

/* ============================================================
   CHAT — briefing
   ============================================================ */
.chat {
  width: 100%; max-width: 860px; margin: 0 auto;
  display: flex; flex-direction: column;
  height: calc(100dvh - 71px);
}
.chat__head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border-soft);
}
.chat__head-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chat__who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat__avatar {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--panel-bg); display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.chat__avatar img { width: 24px; height: 24px; filter: brightness(0) invert(.92); }
.chat__title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.chat__sub { font-size: .82rem; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* progress */
.progress { margin-top: 14px; }
.progress__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.progress__phase {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 4px 11px; border-radius: var(--r-pill);
}
.progress__phase .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-ring); animation: pulse 2s infinite; }
.progress__hint { font-size: .76rem; color: var(--ink-muted); }
.progress__track { height: 6px; background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-pill); overflow: hidden; }
.progress__bar {
  height: 100%; width: 8%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: var(--r-pill); transition: width .6s var(--ease); box-shadow: var(--shadow-accent);
}

/* history */
.chat__body {
  flex: 1; overflow-y: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}
.chat__body::-webkit-scrollbar { width: 10px; }
.chat__body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }

/* message bubbles */
.msg { display: flex; gap: 10px; max-width: 86%; animation: rise .35s var(--ease) both; }
.msg__avatar {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  background: var(--panel-bg); display: grid; place-items: center; margin-top: 2px;
}
.msg__avatar img { width: 18px; height: 18px; filter: brightness(0) invert(.92); }
.msg__bubble {
  padding: 11px 15px; border-radius: 16px; box-shadow: var(--shadow-sm);
  font-size: .96rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg__author { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.msg--ia { align-self: flex-start; }
.msg--ia .msg__bubble { background: var(--bubble-ia-bg); border: 1px solid var(--bubble-ia-bd);
  color: var(--bubble-ia-ink); border-top-left-radius: 5px; }
.msg--user { align-self: flex-end; flex-direction: row-reverse; }
.msg--user .msg__bubble { background: var(--bubble-user-bg); color: var(--bubble-user-ink);
  border-top-right-radius: 5px; box-shadow: var(--shadow-md); }
.msg--user .msg__author { opacity: .85; }

.chat__empty { margin: auto; text-align: center; color: var(--ink-muted); padding: 40px 20px; }
.chat__empty svg { width: 34px; height: 34px; color: var(--accent); margin: 0 auto 12px; opacity: .7; }

/* typing indicator */
.typing { align-self: flex-start; }
.typing .msg__bubble { background: var(--bubble-ia-bg); border: 1px solid var(--bubble-ia-bd);
  border-top-left-radius: 5px; padding: 13px 16px; }
.typing-dot { display: inline-block; width: 7px; height: 7px; margin: 0 1px;
  background: var(--accent); border-radius: 50%; animation: blink 1.3s infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }

/* composer */
.composer { padding: 14px 22px 18px; border-top: 1px solid var(--border-soft); background: var(--bg); }
.composer__row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; max-height: 160px; min-height: 50px;
  border-radius: var(--r-lg); padding: 13px 16px;
  overflow-y: hidden;                 /* sem scrollbar até atingir o max-height */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.composer textarea::-webkit-scrollbar { width: 8px; }
.composer textarea::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
.composer textarea::-webkit-scrollbar-track { background: transparent; }
.composer .btn--send { flex: none; height: 50px; width: 50px; padding: 0; }
.composer .btn--send svg { width: 20px; height: 20px; }
.composer__hint { margin-top: 8px; font-size: .76rem; color: var(--ink-muted); text-align: center; }
.chat__closed { padding: 22px; text-align: center; color: var(--ink-muted); border-top: 1px solid var(--border-soft); }

/* spinner (substitui o do bootstrap) */
.spinner { width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor; animation: spin .7s linear infinite; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request .btn-label { display: none; }

@media (max-width: 560px) {
  .chat { height: calc(100dvh - 65px); }
  .chat__body { padding: 16px; }
  .msg { max-width: 92%; }
  .composer { padding: 12px 14px 14px; }
}

/* ============================================================
   SUCESSO — finalizado
   ============================================================ */
.success { max-width: 560px; text-align: center; }
.success__check {
  width: 92px; height: 92px; margin: 0 auto 26px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent);
  background: var(--accent-soft); box-shadow: var(--shadow-accent);
}
.success__check svg { width: 46px; height: 46px; }
.success__check svg path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .7s .25s var(--ease) forwards; }
.success__check { animation: pop .5s var(--ease) both; }
.steps { display: grid; gap: 12px; text-align: left; margin: 30px auto 0; max-width: 420px; }
.step { display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.step__n { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  background: var(--action-bg); color: var(--action-fg); }
.step__t { font-weight: 600; font-size: .95rem; }
.step__d { font-size: .82rem; color: var(--ink-muted); }

/* error pages */
.errcode { font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1; color: var(--accent); letter-spacing: -.04em; }

/* ---------- Animations ---------- */
@keyframes blink { 0%,60%,100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
