/* =========================================================
   Casca da aplicação: base, trilho de navegação, componentes
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* Celular sem "dança" para os lados (21/10). Cinto de segurança: o estouro é
   corrigido na origem (scripts/varredura-celular.mjs mede sem contar com isto). */
html, body { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }
/* iPhone amplia a página ao tocar num campo com fonte < 16 px e ela fica solta
   para os lados; no celular todo campo de texto tem 16 px. */
@media (max-width: 768px) {
  :is(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file], [type=submit], [type=button]), select, textarea):not(.admin-code) { font-size: 16px !important; }
}
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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

/* Onde números se alinham em coluna, largura de dígito fixa. */
.price, .money, time { font-variant-numeric: tabular-nums; }

/* =========================================================
   Layout
   ========================================================= */
#app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100%;
}

.content {
  padding: 26px 30px 48px;
  min-width: 0;
  max-width: 1280px;
}

/* =========================================================
   Trilho de navegação
   ========================================================= */
.sidebar {
  border-right: 1px solid var(--rule);
  background: var(--surface-2);
  padding: 20px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -.01em;
  display: block;
}
.brand-sub {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-mute);
  display: block;
  margin-top: 1px;
}

.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 1px; padding: 0 10px; }
.nav-group {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-mute);
  padding: 14px 8px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.nav-link:hover { background: var(--rule-soft); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--paper); font-weight: 500; }

.nav-icon { display: none; }          /* a versão nova é textual, não ícone */
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-footer {
  margin-top: auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-mute);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); flex: none; }
.status-dot.connected { background: var(--ok); }
.status-dot.disconnected { background: var(--bad); }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink-mute); color: var(--ink); }
.theme-toggle-icon { display: inline-flex; width: 14px; height: 14px; }
.theme-toggle-icon svg { width: 100%; height: 100%; }

/* =========================================================
   Cabeçalho de página
   ========================================================= */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.page-subtitle { font-size: 13px; color: var(--ink-mute); margin-top: 3px; }

/* =========================================================
   Botões
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--ink-mute); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: var(--rule); }
.btn-soft { background: var(--surface-2); border-color: var(--rule); font-weight: 600; color: var(--ink); }
.btn-soft:hover { border-color: var(--ink-mute); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-bg); }
.btn-sm { font-size: 13px; padding: 5px 11px; }
.btn svg { flex: none; }

/* =========================================================
   Cartões e painéis
   ========================================================= */
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.card { padding: 15px 17px; }
.panel { overflow: hidden; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}
.panel-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
}
.panel-head .sub { font-size: 13px; color: var(--ink-mute); }

.link {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  cursor: pointer;
}
.link:hover { color: var(--ink); border-color: var(--ink-mute); }

/* =========================================================
   Etiquetas de estado — a cor aqui é informação, não enfeite
   ========================================================= */
.tag, .badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.tag.ok, .badge-success   { color: var(--ok);   background: var(--ok-bg); }
.tag.wait, .badge-warning { color: var(--wait); background: var(--wait-bg); }
.tag.bad, .badge-danger   { color: var(--bad);  background: var(--bad-bg); }
.tag.done, .badge-neutral { color: var(--ink-mute); background: var(--rule-soft); }
.tag.now, .badge-info     { color: var(--paper); background: var(--ink); }
.badge-primary { color: var(--paper); background: var(--ink); }

.chip {
  display: inline-block;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--rule-soft);
  color: var(--ink-2);
}

/* =========================================================
   Formulários
   ========================================================= */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-mute);
}
.form-input, .form-select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--ink); }
.field-help { font-size: 13px; color: var(--ink-mute); }

/* =========================================================
   Tabelas
   ========================================================= */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-mute);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); }
.table tbody tr:hover { background: var(--surface-2); }

/* =========================================================
   Estados vazios e carregamento
   ========================================================= */
.page-loading, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 20px;
  color: var(--ink-mute);
  text-align: center;
}
.empty-icon { color: var(--ink-mute); opacity: .55; }
.empty-title { font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.empty-desc { font-size: 13px; max-width: 44ch; }

/* =========================================================
   Modal
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 20, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-container {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-container.modal-wide { max-width: 860px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--rule);
}
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; }
.modal-close {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  width: 28px; height: 28px;
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { border-color: var(--rule); color: var(--ink); }
/* Alvo de toque de 44 px no celular; a margem negativa devolve os 16 px, então o cabeçalho e o × ficam onde estavam. */
@media (max-width: 1023px) { .modal-close { width: 44px; height: 44px; margin: -8px; } }
.modal-body { padding: 18px; overflow-y: auto; overflow-x: hidden; } /* com overflow-y:auto o x vira auto: no iPhone a janela "dançava" de lado */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
}

/* =========================================================
   Avisos temporários
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
}

/* =========================================================
   Utilitários herdados das telas antigas
   ========================================================= */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }

.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }

.text-sm { font-size: 13px; } .text-xs { font-size: 13px; }
.text-muted, .text-secondary { color: var(--ink-mute); }

 .font-semibold { font-weight: 600; }

.w-full { width: 100%; }

/* =========================================================
   Telas estreitas
   ========================================================= */
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar-nav { flex-direction: row; padding: 0; }
  .nav-group { display: none; }
  /* Só o essencial do rodapé sobrevive no celular: Sair. Tema e status são
     mesa de trabalho; sair da conta é direito de quem está no telefone. */
  .sidebar-footer { display: flex; flex-direction: row; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar-footer .theme-toggle,
  .sidebar-footer .connection-status,
  .sidebar-footer .session-who { display: none; }
  /* Cabeçalho vira uma linha só: nome do salão não pode empurrar a navegação. */
  .sidebar-header { flex: none; padding: 0 4px 0 0; max-width: 42vw; }
  .brand-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-sub { display: none; }
  .nav-link { white-space: nowrap; }
  .content { padding: 18px 16px 40px; }
  .form-row { grid-template-columns: 1fr; }
}

/* =========================================================
   Tela Início
   ========================================================= */

.page-header [hidden] { display: none !important; }

.person {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track { height: 4px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.track span { display: block; height: 100%; background: var(--ink-2); }
.track span.full { background: var(--ok); }

.slot {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.slot:last-child { border-bottom: 0; }
.slot.is-now { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink); }
.slot.is-done { opacity: .62; }
.slot time { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.task { display: flex; flex-direction: column; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--rule-soft); }
.task:last-child { border-bottom: 0; }

/* =========================================================
   Componentes que as telas antigas usam (classes legadas),
   reestilizados na linguagem nova — substituem o que morava
   nos CSS removidos, agora com a cara certa.
   ========================================================= */

/* Abas */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--rule-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Campo de busca com ícone embutido */
.search-bar { position: relative; }
.search-bar .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  display: inline-flex;
  pointer-events: none;
}
.search-bar .form-input { padding-left: 32px; }

/* Seções de Ajustes */
.settings-sections { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.settings-section {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 17px 18px;
}

/* Seletor de tema (Ajustes) — os SVGs precisam de tamanho contido */
.appearance-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.appearance-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
}
.appearance-option strong { color: var(--ink); font-size: 13px; }
.appearance-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.appearance-option.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.appearance-option.is-selected .appearance-option-icon { color: var(--accent); }
.appearance-option strong .badge { margin-left: 6px; vertical-align: 1px; font-size: 13px; }
.appearance-option-icon { display: inline-flex; width: 20px; height: 20px; color: var(--ink-2); }
.appearance-option-icon svg { width: 100%; height: 100%; }

/* Painel de proteção da fila de mensagens */
.queue-safety {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.queue-safety-icon { display: inline-flex; color: var(--ok); }
.queue-safety.is-paused .queue-safety-icon { color: var(--wait); }
.queue-safety p { font-size: 13px; color: var(--ink-mute); }

/* Avatar neutro: iniciais em tinta — substitui as cores aleatórias */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--rule-soft) !important; /* vence os estilos inline antigos */
  color: var(--ink-2) !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  overflow: hidden;
}

.avatar-lg { width: 38px; height: 38px; min-width: 38px; font-size: 13px; }
.avatar-xl { width: 56px; height: 56px; min-width: 56px; font-size: 17px; }
.avatar-img { object-fit: cover; background: transparent !important; }

/* =========================================================
   Tela de entrada + sessão
   ========================================================= */
/* Entrada e cadastro são telas de porta: sem trilho de navegação, porque
   ainda não há sessão para navegar. */
html[data-page="login"] .sidebar,
html[data-page="signup"] .sidebar,
html[data-page="recover"] .sidebar { display: none; }
html[data-page="login"] #app,
html[data-page="signup"] #app,
html[data-page="recover"] #app { grid-template-columns: 1fr; }
html[data-page="login"] .content,
html[data-page="signup"] .content,
html[data-page="recover"] .content { max-width: none; padding: 0; }
html:not([data-page="login"]) #login-fallback { display: none !important; }
html[data-page="login"] #boot-loading { display: none !important; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: var(--paper);
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  width: min(100%, 1040px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.auth-shell-compact { min-height: 500px; }
.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 6vw, 72px);
  background: var(--surface-2);
  border-right: 1px solid var(--rule);
}
.auth-eyebrow,
.auth-form-kicker {
  margin: 0 0 16px;
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.3;
}
.auth-intro h1 {
  max-width: 520px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.08;
}
.auth-lead { max-width: 470px; margin: 20px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.58; }
.auth-points { display: grid; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.auth-points li { display: flex; align-items: center; gap: 9px; }
.auth-points li::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 999px; background: var(--ok); }
/* Cadastro: a lista de passos do assistente, igual à do app (onda 9). */
.auth-steps { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: passo; max-width: 470px; }
.auth-steps li { counter-increment: passo; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.auth-steps li::before { content: counter(passo); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 13px; }
.auth-steps strong { display: block; color: var(--ink); font-size: 15px; }
.auth-caption { max-width: 430px; margin: 30px 0 0; color: var(--ink-mute); font-size: 13px; line-height: 1.5; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(28px, 5vw, 56px); }
.login-card {
  width: 100%;
  max-width: 380px;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.login-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.12;
}
.login-sub { font-size: 13px; color: var(--ink-mute); margin: 8px 0 28px; line-height: 1.5; }
.login-error {
  font-size: 13px;
  color: var(--bad);
  background: var(--bad-bg);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 12px;
}
.login-error.is-success { color: var(--ok); background: var(--ok-bg); }
.login-foot { font-size: 13px; color: var(--ink-mute); margin-top: 14px; line-height: 1.5; }
/* Primeiro acesso (C2): "Barbearia ou salão?", dois botões grandes de um toque. */
/* Seletor de ramo em cartões (cadastro e passo 1): a grade cresce por linhas, sem rolagem lateral, até ~8 ramos. */
.seg-picker { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.seg-picker legend { grid-column: 1 / -1; padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.seg-card { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 4px; min-width: 0;
  border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface, #fff); color: var(--ink); cursor: pointer; text-align: center; font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: normal; word-break: normal; }
.seg-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
/* Marcado: borda de 2 px (o padding perde 1 px para o cartão não mudar de tamanho), fundo suave, ícone e texto na cor da marca e ✓ no canto; sem anel extra. */
.seg-card:has(input:checked) { border-width: 2px; padding: 7px 3px; border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text, var(--brand)); font-weight: 700; }
.seg-card:has(input:checked)::after { content: "✓" / ""; position: absolute; top: 4px; right: 7px; font-size: 14px; font-weight: 800; line-height: 1; color: var(--brand-text, var(--brand)); }
/* Anel de foco só pelo teclado (:focus-visible); toque e clique não o mostram. */
.seg-card:has(input:focus-visible) { outline: 2px dashed var(--ink); outline-offset: 3px; }   /* tracejado: não se confunde com a borda sólida do marcado */
/* Tema escuro: a borda do cartão não marcado passa de 3:1 contra o fundo do painel e do cartão (#8A9B8F: cerca de 6:1); o claro não muda. */
:root[data-theme="dark"] .seg-card:not(:has(input:checked)) { border-color: #8A9B8F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-card:not(:has(input:checked)) { border-color: #8A9B8F; } }
.seg-picker[aria-invalid="true"] .seg-card { border-color: var(--bad); }
.seg-picker[aria-invalid="true"] .seg-card:has(input:checked) { border-color: var(--brand); }
:root[data-theme="dark"] .seg-picker[aria-invalid="true"] .seg-card:not(:has(input:checked)) { border-color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-picker[aria-invalid="true"] .seg-card:not(:has(input:checked)) { border-color: var(--bad); } }
.seg-select { margin: 0 0 14px; }
.setup-form .seg-picker + .field-error { margin: -6px 0 14px; }
.signup-accept { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 13px; line-height: 1.45; color: var(--ink-2, inherit); }
.signup-accept input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; }
.signup-accept a { color: inherit; text-decoration: underline; }
/* Logo pequeno no topo do formulário no celular (onde o painel da marca some); no computador, só a palavra. */
.auth-form-logo { display: none; width: 122px; height: auto; }
.signup-next { display: none; }
.signup-down { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border-radius: 12px; background: var(--wait-bg); font-size: 14px; line-height: 1.45; color: var(--ink); }
.signup-down p { margin: 0; }
.signup-down .btn { justify-content: center; min-height: 44px; }

@media (max-width: 760px) {
  .login-wrap { align-items: flex-start; padding: 0; background: var(--surface); }
  .auth-shell,
  .auth-shell-compact { display: block; width: 100%; min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .auth-intro { display: none; }
  .auth-strip { display: block; margin: 0; padding: max(9px, env(safe-area-inset-top)) 16px 9px; background: #F6F5F1; border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; font-weight: 700; line-height: 1.35; text-align: center; }
  .auth-strip .g { white-space: nowrap; }
  /* Estreito (360): duas linhas equilibradas, sem "·" no fim de linha. */
  @media (max-width: 375px) { .auth-strip .g { display: block; } .auth-strip .sep { display: none; } }
  .auth-panel { min-height: 0; align-items: flex-start; padding: 24px 20px max(32px, env(safe-area-inset-bottom)); }
  .auth-shell-login .auth-panel, .auth-shell-compact .auth-panel { padding-top: max(40px, env(safe-area-inset-top)); }
  .login-card { max-width: 440px; }
  .auth-form-kicker { margin-bottom: 18px; }
  .login-wrap .auth-shell { border: 0; border-radius: 0; box-shadow: none; }
  .auth-form-word { display: none; }
  .auth-form-logo { display: block; }
  .login-brand { font-size: 30px; }
  .login-sub { margin-bottom: 20px; }
}

.session-who { font-size: 13px; color: var(--ink-mute); border-top: 1px solid var(--rule); padding-top: 10px; }
.session-who b { display: block; color: var(--ink); font-weight: 600; }
.session-who-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-xs);
  padding: 4px 6px;
  margin: -4px -6px;
}
.session-who-link:hover { background: var(--rule-soft); }
.logout-btn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  align-self: flex-start;
}
.logout-btn:hover { border-color: var(--bad); color: var(--bad); }

/* Esconde visualmente sem tirar da acessibilidade (padrão clip). O modal de
   contratação usava a classe sem ela existir: o input de arquivo nativo
   aparecia duplicado ao lado do botão "Escolher foto". */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Senha com "Mostrar"/"Ocultar" dentro do campo (login e cadastro). */
.password-field { position: relative; }
.password-field .form-input { padding-right: 84px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--brand-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--surface-2); outline: none; }
/* Cadastro fora do ar: só o aviso com o WhatsApp e o "Já tem conta? Entrar" (onda 9). */
/* Alvo de 44 px também no computador (antes só abaixo de 1024 px): a margem negativa mantém o × onde estava. */
.modal-close { flex: none; width: 44px; height: 44px; margin: -8px; position: relative; z-index: 1; } /* z-index: o corpo do modal, mais adiante, cobria a borda de baixo do alvo */
