/*
 * Login V2 - skin de produção.
 * Tokens copiados literalmente de html/home/v2/index.php (linhas 70-130):
 * claro em :root, escuro em :root[data-theme="dark"]. Mesma paleta, mesmo
 * radius, mesma tipografia do resto do CRM v2 - nada inventado aqui.
 */
:root {
  color-scheme: light;
  --bg: #F6F9FC;
  --sidebar-bg: #E8F4FB;
  --panel: #FFFFFF;
  --surface: #FFFFFF;
  --field-bg: #FFFFFF;
  --field-text: #162033;
  --text: #162033;
  --muted: #69758A;
  --placeholder: #97A3B6;
  --line: #E8EEF5;
  --line-strong: #DCE6F2;
  --azul: #0054B5;
  --azul-hover: #004494;
  --verde: #36C247;
  --verde-hover: #2fa63d;
  --danger: #ef4444;
  --danger-bg: #FDECEC;
  --danger-text: #8A1C14;
  --success-text: #1B7A3B;
  --info: #0ea5e9;
  --info-text: var(--azul);
  --warning: #f59e0b;
  --warning-bg: #FFFBEB;
  --warning-text: #92400e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, .06);
  --shadow-soft: 0 2px 8px rgba(15, 23, 42, .04);
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --hover-neutral: #E5EDF7;
  --hover-blue: #EAF2FF;
  --focus: var(--azul);
  --track: #C4D7EA;
  --signal: var(--azul);
  --step-out-ms: 220ms;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1420;
  --sidebar-bg: #161d2c;
  --panel: #161d2c;
  --surface: #1b2334;
  --field-bg: #1b2334;
  --field-text: #e5e9f0;
  --text: #e5e9f0;
  --muted: #8b96a8;
  --placeholder: #7a8699;
  --line: #2a3346;
  --line-strong: #2a3346;
  --shadow: 0 12px 35px rgba(0, 0, 0, .45);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, .3);
  --hover-neutral: #1d2536;
  --hover-blue: #132a44;
  --danger-bg: #2a1620;
  --danger-text: #FCA5A5;
  --success-text: #86E0B0;
  --info-text: #78ADFF;
  --warning-bg: rgba(245, 158, 11, .14);
  --warning-text: #FDE68A;
  --track: #2f3b52;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1 { font-family: var(--font-display); margin: 0; }
button, input { font-family: inherit; }

/* ---------- layout ---------- */
.auth-shell {
  display: grid; grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
  min-height: 100dvh; max-width: 1680px; margin-inline: auto;
}
@media (min-width: 1681px) { .auth-shell { box-shadow: 0 0 0 1px var(--line) inset; } }

.scene {
  position: relative;
  overflow: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 32px 32px;
}
/* Pessoa + conector + ato + rodapé formam UM bloco só (não "cena esticada
   até o rodapé"): a coluna inteira fica centralizada, com folga distribuída
   nas duas pontas em vez de um vão único e imprevisível antes do título.
   scale(1.08) dá mais presença ao fluxo sem redesenhar nada dele. */
.scene__flow { position: relative; margin: 0 0 32px; min-height: 300px; transform: scale(1.08); transform-origin: top left; }

/* Entidade persistente: a mesma "Mariana Alves" do início ao fim da jornada,
   nunca recriada - só muda de estado (login-journey.js). */
.j-person {
  position: absolute; left: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 9px 15px 9px 9px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-soft);
  opacity: 0; transform: translateY(10px) scale(.97);
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform .55s cubic-bezier(.22, 1, .36, 1);
}
.j-person.is-visible { opacity: 1; transform: none; }
.j-person__avatar {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--azul), #1c78e0); color: #fff; font-size: 11.5px; font-weight: 700;
  transition: background .3s ease;
}
.j-person__name { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
/* Nome chega junto com o cartão; o estado espera ~120ms a mais - só na
   entrada inicial (depois disso a opacidade já fica em 1 e o texto só troca). */
.j-person__state {
  display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap;
  opacity: 0; transition: opacity .35s ease .12s;
}
.j-person.is-visible .j-person__state { opacity: 1; }
.j-person.is-pulse { animation: person-pulse .5s ease; }
.j-person.is-pulse .j-person__avatar { animation: person-halo .6s ease; }
.j-person.is-pulse-success .j-person__avatar { background: linear-gradient(135deg, var(--verde), #2fa63d); }
@keyframes person-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes person-halo { 0% { box-shadow: 0 0 0 0 rgba(0, 84, 181, .35); } 100% { box-shadow: 0 0 0 9px rgba(0, 84, 181, 0); } }

/* Conector: a pessoa é a origem visual de qualquer ato que apareça abaixo -
   nunca um bloco desconectado. Fica neutro por padrão, acende brevemente
   (is-active) no instante em que o ato começa, como um pulso de causa. */
.j-link {
  position: absolute; left: 25px; top: 52px; width: 1.5px; height: 26px; z-index: 1;
  background: var(--line); opacity: 0; transition: opacity .3s ease, background .3s ease;
}
.j-link.is-visible { opacity: 1; }
.j-link.is-active { background: var(--azul); }

/* Zona compartilhada onde cada ato aparece (nunca mais de um por vez, exceto
   a bolha que atravessa por cima ao sair da campanha). Começa logo abaixo do
   conector - perto da pessoa, não a 27% de uma coluna que podia sobrar vazia. */
.j-campaign, .j-chat, .j-rule, .j-agenda {
  position: absolute; left: 0; top: 84px; width: 90%; max-width: 300px;
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease;
}
.j-campaign.is-visible, .j-chat.is-visible, .j-rule.is-visible, .j-agenda.is-visible { opacity: 1; transform: none; }

/* Ato: Campanha - progresso de verdade, não um rótulo estático. */
.j-campaign { padding: 15px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); }
.j-campaign__head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.j-campaign__head i { width: 16px; height: 16px; stroke: var(--azul); flex-shrink: 0; }
.j-campaign__audience { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.j-campaign__bar { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.j-campaign__fill { height: 100%; width: 0%; background: var(--azul); border-radius: 4px; }
.j-campaign.is-delivered .j-campaign__fill { background: var(--verde); }
.j-campaign__status { font-size: 11px; font-weight: 700; color: var(--muted); }
.j-campaign.is-delivered .j-campaign__status { color: var(--success-text); }

/* A mensagem física: nasce perto da campanha, atravessa até a pessoa. */
.j-bubble {
  position: absolute; left: 0; top: 4%; z-index: 3; display: flex; align-items: center; gap: 8px;
  max-width: 74%; padding: 9px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-soft); font-size: 11.5px; color: var(--text);
  opacity: 0; transform: translate(18px, 186px) scale(.92);
  transition: opacity .4s ease, transform .9s cubic-bezier(.22, 1, .36, 1);
}
.j-bubble.is-visible { opacity: 1; }
.j-bubble.is-arrived { transform: translate(0, 0) scale(.82); opacity: 0; transition-duration: .55s; }
.j-bubble i { width: 14px; height: 14px; stroke: var(--azul); flex-shrink: 0; }

/* Ato: Chat - balões reais entrando, não um card com legenda "atendimento". */
.j-chat { display: flex; flex-direction: column; }
.j-chat__head { margin-bottom: 10px; }
.j-chat__badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: var(--hover-blue); color: var(--info-text); transition: background .2s ease, color .2s ease;
}
.j-chat__bubble {
  max-width: 84%; padding: 9px 13px; border-radius: 14px; font-size: 12px; line-height: 1.4; margin-bottom: 8px;
  opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .3s ease;
}
.j-chat__bubble.is-visible { opacity: 1; transform: none; }
.j-chat__bubble--in { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.j-chat__bubble--out { background: var(--azul); color: #fff; border-bottom-right-radius: 4px; margin-left: auto; }
.j-chat__typing {
  display: inline-flex; gap: 4px; padding: 10px 13px; width: fit-content; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; border-bottom-left-radius: 4px;
  opacity: 0; transition: opacity .2s ease;
}
.j-chat__typing.is-visible { opacity: 1; }
.j-chat__typing i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing-dot 1s ease-in-out infinite; }
.j-chat__typing i:nth-child(2) { animation-delay: .15s; }
.j-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* Ato: Automação - entrada, decisão, ação. Cada nó/conector tem sua própria
   chegada (opacity+translateY, entra DEPOIS do conector que aponta pra ele -
   login-journey.js) e só então acende (is-active); nunca tudo de uma vez. */
.j-rule { display: flex; flex-direction: column; gap: 8px; transition: opacity .4s ease; }
.j-rule.is-resolved { opacity: .84; } /* concluído: a cabeça cede protagonismo pro título embaixo */
.j-rule__node {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 12px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s cubic-bezier(.22, 1, .36, 1), transform .35s cubic-bezier(.22, 1, .36, 1),
    border-color .25s ease, color .25s ease, background .25s ease;
}
.j-rule__node.is-shown { opacity: 1; transform: none; }
.j-rule__node i { width: 14px; height: 14px; flex-shrink: 0; }
.j-rule__node.is-active { border-color: var(--azul); color: var(--azul); background: var(--hover-blue); }
.j-rule__node--action.is-active { border-color: var(--verde); color: var(--success-text); background: rgba(54, 194, 71, .12); }
.j-rule__arrow {
  width: 1.5px; height: 12px; background: var(--line); margin-left: 19px;
  transform-origin: top center; transform: scaleY(0);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), background .25s ease;
}
.j-rule__arrow.is-shown { transform: scaleY(1); }
.j-rule__arrow.is-active { background: var(--azul); }
.j-rule__branches {
  display: flex; gap: 7px; margin-left: 19px;
  opacity: 0; transform: translateY(4px); transition: opacity .3s ease, transform .3s ease;
}
.j-rule__branches.is-shown { opacity: 1; transform: none; }
.j-rule__branch {
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 10px; font-weight: 600; color: var(--muted);
  transition: border-color .25s ease, color .25s ease, background .25s ease;
}
.j-rule__branch--yes.is-active { border-color: var(--verde); color: var(--success-text); background: rgba(54, 194, 71, .12); }

/* Ato: Agenda - abre, escolhe dia e hora, confirma; depois vira um chip. */
.j-agenda__trigger {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.j-agenda__trigger.is-active { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0, 84, 181, .14); }
.j-agenda__trigger i { width: 14px; height: 14px; stroke: var(--azul); }
.j-agenda__popover {
  margin-top: 10px; padding: 14px; max-width: 230px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
  opacity: 0; transform: translateY(-4px) scale(.97); transform-origin: top left;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.j-agenda__popover.is-visible { opacity: 1; transform: none; }
.j-agenda__days { display: flex; gap: 4px; margin-bottom: 10px; }
.j-agenda__days span {
  flex: 1; display: grid; place-items: center; height: 22px; border-radius: 6px; font-size: 10px; color: var(--muted);
  background: var(--hover-neutral); transition: background .2s ease, color .2s ease;
}
.j-agenda__days span.is-picked { background: var(--azul); color: #fff; font-weight: 700; }
.j-agenda__time { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; transition: color .2s ease; }
.j-agenda__popover.has-time .j-agenda__time { color: var(--azul); }
.j-agenda__confirm {
  text-align: center; padding: 8px; border-radius: 8px; background: var(--hover-neutral); color: var(--muted);
  font-size: 11.5px; font-weight: 700; transition: background .2s ease, color .2s ease;
}
.j-agenda__confirm.is-active { background: var(--azul); color: #fff; }
.j-agenda__chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px;
  background: rgba(54, 194, 71, .12); border: 1px solid var(--verde); color: var(--success-text);
  font-size: 12px; font-weight: 600;
  opacity: 0; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease;
}
.j-agenda__chip.is-visible { opacity: 1; transform: none; }
.j-agenda__chip i { width: 14px; height: 14px; }

/* Logo no topo, canto direito da cena - fixa num canto da moldura, não
   presa ao rodapé (que agora centraliza com o resto do bloco e pode ter
   folga variável embaixo dependendo do ato). */
.scene__logo { position: absolute; top: 26px; right: 32px; z-index: 3; height: 42px; width: auto; max-width: 190px; object-fit: contain; }

/* Rodapé da cena: eyebrow + tagline do ato atual. overflow-wrap é reforço
   pra qualquer palavra composta que não caiba na coluna mais estreita. */
.scene__foot { z-index: 2; }
.scene__eyebrow { font-size: 10px; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.scene__tagline {
  font-family: var(--font-display); font-size: clamp(22px, 2vw + 10px, 30px); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.2; margin: 10px 0 0; max-width: 20ch; overflow-wrap: break-word;
  transition: opacity .22s ease, transform .22s ease;
}
.scene__tagline.is-swapping { opacity: 0; transform: translateY(-6px); }
html[data-scene="paused"] .scene *, .scene.is-paused * { animation-play-state: paused !important; }

/* Navegação discreta entre histórias: 6 traços, o ativo vira um ponto cheio. */
.scene__nav { z-index: 2; display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.scene__nav-dot {
  border: 0; padding: 0; cursor: pointer; height: 14px; width: 14px; display: grid; place-items: center;
  background: transparent;
}
.scene__nav-dot::after {
  content: ""; display: block; height: 3px; width: 22px; border-radius: 3px; background: var(--track);
  transform: scaleX(.64); transform-origin: left center;
  transition: transform .25s ease, background .25s ease;
}
.scene__nav-dot:hover::after { background: var(--muted); }
.scene__nav-dot.is-active::after { transform: scaleX(1); background: var(--azul); }

/* ---------- coluna do formulário ---------- */
.content { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.panel { width: 100%; max-width: 372px; }
.mobile-brand { display: none; }
.mobile-activity { display: none; }

.lang-switch { position: absolute; top: 22px; right: 24px; z-index: 3; }
.lang-switch__select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel);
  color: var(--muted); font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: .02em; padding: 7px 26px 7px 13px; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
  transition: border-color .15s ease, color .15s ease;
}
.lang-switch__select:hover { border-color: var(--azul); color: var(--text); }
.lang-switch__select:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

.step { }
.step__title { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 4px; }
.step__tagline { color: var(--muted); font-size: 13.5px; margin: 0 0 28px; }
.step__note, .step__who { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; overflow-wrap: anywhere; }
.step__actions { display: flex; justify-content: center; margin-top: 22px; }
.step__actions--stack { flex-direction: column; align-items: stretch; gap: 14px; }
.step__actions--stack .link { align-self: center; }

form.form { margin-top: 22px; }
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 8px; }
.field__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field__box { position: relative; }
.field__input {
  width: 100%; height: 50px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--field-bg); color: var(--field-text); padding: 0 15px; outline: none;
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: var(--placeholder); }
.field__input:hover { border-color: var(--muted); }
.field__input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0, 84, 181, .14); }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__input--secret { padding-right: 48px; }
.field__toggle {
  position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer;
}
.field__toggle:hover { background: var(--hover-neutral); }
.field__toggle svg { width: 19px; height: 19px; }
.field__error { color: var(--danger-text); font-size: 12px; margin: 7px 0 0; }

.form__aside { display: flex; justify-content: flex-end; margin: -8px 0 18px; }
.link { border: 0; background: none; padding: 0; color: var(--azul); font-size: 12.5px; font-weight: 550; cursor: pointer; min-height: 30px; }
.link:hover { text-decoration: underline; }

.btn {
  height: 50px; width: 100%; border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; gap: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn--primary { border: 0; background: var(--azul); color: #fff; box-shadow: 0 6px 16px rgba(0, 84, 181, .22); }
.btn--primary:hover { background: var(--azul-hover); transform: translateY(-1px); }
.btn--primary:active { transform: none; }
.btn--primary.is-busy, .btn--primary[aria-disabled="true"] { opacity: .75; transform: none; cursor: wait; }
.btn--ghost { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); text-decoration: none; }
.btn--ghost:hover { background: var(--hover-neutral); }
.btn__logo { flex-shrink: 0; }

.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.providers:has(a[hidden]) { grid-template-columns: 1fr; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; margin: 24px 0; }
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.msg { font-size: 13px; line-height: 1.5; padding: 11px 13px; border-radius: 10px; margin: 4px 0 18px; border-left: 3px solid transparent; }
.msg[data-tone="error"] { color: var(--danger-text); background: var(--danger-bg); border-left-color: var(--danger); }
.msg[data-tone="success"] { color: var(--success-text); background: rgba(54, 194, 71, .12); border-left-color: var(--verde); }
.msg[data-tone="info"] { color: var(--info-text); background: var(--hover-blue); border-left-color: var(--azul); }
.msg[data-tone="warning"] { color: var(--warning-text); background: var(--warning-bg); border-left-color: var(--warning); }

.redirect { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.redirect__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--azul); animation: dot-breathe 1.3s ease-in-out infinite; }
@keyframes dot-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp__cell {
  width: 100%; min-width: 0; height: 56px; text-align: center; font-size: 21px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field-bg); color: var(--field-text);
}
.otp__cell:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0, 84, 181, .14); outline: none; }
.otp__cell.is-filled { border-color: var(--line-strong); }
.otp__expiry { font-size: 12px; color: var(--muted); margin: 0; }
[data-step="twofa"][data-expired] .otp__cell { opacity: .45; }

.strength { height: 4px; border-radius: 4px; background: var(--line); margin: 10px 0 10px; overflow: hidden; position: relative; }
.strength::after {
  content: ""; position: absolute; inset: 0; transform-origin: left center;
  transform: scaleX(calc(var(--score, 0) / 5)); background: var(--danger);
  transition: transform .2s ease, background .2s ease;
}
.strength[data-score="3"]::after, .strength[data-score="4"]::after { background: #f59e0b; }
.strength[data-score="5"]::after { background: var(--verde); }
.rules { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 7px; }
.rules li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--muted); flex-shrink: 0; }
.rules li.is-ok { color: var(--success-text); }
.rules li.is-ok::before { background: var(--verde); border-color: var(--verde); }

.progress { height: 2px; background: var(--line); border-radius: 2px; margin-top: 22px; overflow: hidden; }
.progress::after { content: ""; display: block; height: 100%; width: 0; background: var(--azul); animation: progress-grow 1.4s linear forwards; }
.progress--long::after { animation-duration: 2.5s; background: var(--verde); }
@keyframes progress-grow { to { width: 100%; } }

.panel__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; margin-top: 30px; }
.panel__foot a { color: inherit; text-decoration: none; }
.panel__foot a:hover { text-decoration: underline; }

/* ---------- transições de etapa ---------- */
[data-step] { display: none; }
[data-step].is-active, [data-step].is-entering, [data-step].is-leaving { display: block; }
[data-step].is-entering { opacity: 0; transform: translateY(8px); }
[data-step].is-active { opacity: 1; transform: none; transition: opacity var(--step-out-ms) ease, transform var(--step-out-ms) ease; }
[data-step].is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity var(--step-out-ms) ease, transform var(--step-out-ms) ease; }

/* sucesso: lavado verde sutil na cena, sem tocar Home V2 */
html[data-auth-step="success"] .scene { transition: background-color .5s ease; }
html[data-auth-step="success"] .scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 30% 85%, rgba(54, 194, 71, .16), transparent 60%);
  animation: success-wash 1.1s ease both;
}
@keyframes success-wash { from { opacity: 0; } to { opacity: 1; } }

/* ---------- mobile: sem cena, tira compacta com sinal em miniatura ---------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(280px, 38%) minmax(0, 1fr); }
  .scene { padding: 26px 24px; }
  .j-campaign, .j-chat, .j-rule, .j-agenda { max-width: 270px; }
  .scene__logo { top: 20px; right: 24px; height: 32px; } /* coluna mais estreita */
}
@media (max-width: 760px) {
  .auth-shell { display: block; min-height: 100dvh; }
  .scene { display: none; }
  .content { min-height: 100dvh; align-items: center; padding: 24px 22px; }
  .lang-switch { top: 16px; right: 16px; }
  .mobile-brand {
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    padding: 22px 2px 4px;
  }
  .mobile-brand__logo { display: flex; align-items: center; }
  .mobile-brand__logo img { height: 38px; width: auto; }

  /* Ticker de atividade desligado no mobile: logo em cima + formulário
     embaixo, sem nada animando entre os dois (pedido explícito - a versão
     anterior competia visualmente com o login). Regras mantidas caso volte
     a ser usada em outro lugar, só a exibição em mobile foi removida. */
  .mobile-activity {
    display: none; align-items: center; gap: 9px; margin: 14px 0 22px;
    padding: 10px 12px; background: var(--sidebar-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    opacity: 0; transform: translateY(-4px); transition: opacity .3s ease, transform .3s ease;
  }
  .mobile-activity.is-visible { opacity: 1; transform: none; }
  .mobile-activity__icon {
    display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0;
    background: var(--azul); border-radius: 8px;
  }
  .mobile-activity__icon svg { width: 13px; height: 13px; stroke: #fff; }
  .mobile-activity__text { font-size: 12px; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .panel { max-width: 420px; }
  .step__title { font-size: 26px; }
  .otp__cell { height: 52px; font-size: 19px; }
  .rules { grid-template-columns: 1fr; }

  /* Toque: links de texto (Esqueci, Voltar) e o link do rodapé com alvo de 36/32 px. */
  .link { min-height: 36px; }
  .panel__foot a { display: inline-flex; align-items: center; min-height: 32px; }
  /* Escuro: o azul da marca some no fundo escuro; os links usam o azul claro do tema. */
  :root[data-theme="dark"] .link { color: var(--info-text); }
}
@media (max-width: 380px) {
  .content { padding-inline: 18px; }
  .panel__foot { font-size: 10px; flex-wrap: wrap; gap: 8px; }
  .providers { gap: 8px; }
  .providers .btn { font-size: 12.5px; padding-inline: 6px; gap: 6px; }
}
/* 320: lado a lado o "Entrar com Google" quebrava em duas linhas; um embaixo do outro. */
@media (max-width: 359px) {
  .providers { grid-template-columns: minmax(0, 1fr); }
  .providers .btn { font-size: 14px; }
}

/* auth-base.css (não alterado) já zera duração de toda animação/transição sob
   prefers-reduced-motion e html[data-motion="reduced"]; o único ajuste daqui
   é impedir que o estado "escondido" fique visualmente cortado a meio caminho. */
@media (prefers-reduced-motion: reduce) {
  .j-person, .j-campaign, .j-chat, .j-rule, .j-agenda, .j-bubble, .mobile-activity { transform: none !important; }
}
html[data-motion="reduced"] .j-person,
html[data-motion="reduced"] .j-campaign,
html[data-motion="reduced"] .j-chat,
html[data-motion="reduced"] .j-rule,
html[data-motion="reduced"] .j-agenda,
html[data-motion="reduced"] .j-bubble,
html[data-motion="reduced"] .mobile-activity { transform: none !important; }

/* ---------- transição para a Home V2 (progressive enhancement) ---------- */
@view-transition { navigation: auto; }
.scene { view-transition-name: crm-sidebar; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .01ms !important; }
}

/* Escuro em qualquer largura: o azul da marca nos links (Esqueci, Voltar) tinha contraste de 2,6:1 no fundo escuro. */
:root[data-theme="dark"] .link { color: var(--info-text); }
