:root {
  --bg: #060606;
  --card: #101010;
  --card-alt: #161616;
  --border: #272727;
  --text: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #6b6b6b;
  --success: #4ade80;
  --error: #f87171;
  --warning: #fbbf24;
  /* Paleta estritamente preto / cinza / branco: o "acento" é um cinza-claro
     metálico, sem nenhuma cor saturada, para manter o visual monocromático. */
  --accent: #e4e4e7;
  --accent-soft: rgba(228, 228, 231, 0.10);
  --accent-border: rgba(228, 228, 231, 0.30);
  --silver-gradient: linear-gradient(135deg, #ffffff 0%, #c7c7cf 50%, #8b8b93 100%);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --transition: 180ms ease;
  --transition-slow: 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% -10%, rgba(255,255,255,0.06), transparent 42%),
    radial-gradient(circle at 90% 110%, rgba(255,255,255,0.05), transparent 42%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
}

/* ------------------------------------------------------------------ */
/* Auth Page - fundo ambiente                                         */
/* ------------------------------------------------------------------ */

.auth-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  animation: driftGlow 16s ease-in-out infinite alternate;
}

.auth-page::before {
  width: 480px;
  height: 480px;
  top: -180px;
  left: -160px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
}

.auth-page::after {
  width: 520px;
  height: 520px;
  bottom: -220px;
  right: -180px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
  animation-delay: -8s;
}

@keyframes driftGlow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(24px, 18px, 0) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page::before,
  .auth-page::after {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Auth Page                                                          */
/* ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--card-alt) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6), 0 8px 28px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: cardIn 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-logo {
  width: 8px;
  height: 8px;
  color: var(--text);
  font-size: 8px;
  display: inline-block;
}

.auth-brand span,
.dash-brand span {
  background: var(--silver-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: formIn 350ms ease;
}

.auth-form.active {
  display: flex;
}

@keyframes formIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: -10px;
  margin-bottom: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.field input {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:hover {
  border-color: #333333;
}

.field input:focus {
  border-color: var(--accent);
  background: #101010;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input.invalid {
  border-color: var(--error);
}

.field-error {
  min-height: 16px;
  font-size: 12px;
  color: var(--error);
  display: block;
}

/* Cloudflare Turnstile (CAPTCHA) */

.turnstile-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.cf-turnstile-box {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 65px;
}

.cf-turnstile-box iframe {
  border-radius: var(--radius-sm);
}

.turnstile-field .field-error {
  text-align: center;
}

/* Medidor de força de senha */

.password-strength {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.strength-bars {
  display: flex;
  gap: 4px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.strength-bar.active {
  box-shadow: 0 0 6px 0 var(--bar-glow, transparent);
}

.strength-label {
  font-size: 12px;
  font-weight: 600;
  min-height: 14px;
  letter-spacing: 0.01em;
  transition: color 220ms ease;
}

.btn-primary {
  position: relative;
  margin-top: 6px;
  background: var(--silver-gradient);
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), filter var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(255,255,255,0.08);
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left 550ms ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(255,255,255,0.14);
}

.btn-secondary {
  position: relative;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-secondary:hover {
  border-color: #3d3d3d;
  background: rgba(255,255,255,0.04);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(10,10,10,0.25);
  border-top-color: #0a0a0a;
  animation: spin 700ms linear infinite;
}

.btn-primary.loading .btn-label {
  opacity: 0.6;
}

.btn-primary.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.forgot-link {
  color: var(--text-secondary);
  font-weight: 500;
}

.field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -8px;
  flex-wrap: wrap;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-field input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  position: relative;
  transition: border-color var(--transition), background var(--transition);
}

.checkbox-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #0a0a0a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 120ms ease;
}

.checkbox-field input:checked + .checkbox-box {
  background: var(--silver-gradient);
  border-color: transparent;
}

.checkbox-field input:checked + .checkbox-box::after {
  opacity: 1;
}

.checkbox-field input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.checkbox-field-block {
  align-items: flex-start;
  line-height: 1.5;
}

.checkbox-field-block .checkbox-box {
  margin-top: 1px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.link-btn:hover {
  color: var(--accent);
}

.auth-toast {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  border: 1px solid var(--border);
  animation: toastIn 250ms ease;
}

.auth-toast.show {
  display: flex;
}

.auth-toast.success {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.06);
}

.auth-toast.error {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------ */
/* Mostrar/ocultar senha                                              */
/* ------------------------------------------------------------------ */

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 42px;
}

.toggle-password {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.toggle-password:hover {
  color: var(--accent);
  background: rgba(255,255,255,0.05);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------ */
/* Disponibilidade de username / e-mail                               */
/* ------------------------------------------------------------------ */

.availability-field {
  position: relative;
  display: flex;
  align-items: center;
}

.availability-field input {
  width: 100%;
  padding-right: 90px;
}

.availability-indicator {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.availability-indicator[data-state="checking"] {
  color: var(--accent);
}

.availability-indicator[data-state="available"] {
  color: var(--success);
}

.availability-indicator[data-state="unavailable"] {
  color: var(--error);
}

/* ------------------------------------------------------------------ */
/* Checklist de requisitos da senha                                   */
/* ------------------------------------------------------------------ */

.password-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.password-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 200ms ease;
}

.password-checklist .check-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.password-checklist li.valid {
  color: var(--text-secondary);
}

.password-checklist li.valid .check-dot {
  background: var(--success);
  box-shadow: 0 0 6px 0 rgba(74, 222, 128, 0.5);
}

/* ------------------------------------------------------------------ */
/* Verificação em duas etapas — ícone e contexto de segurança         */
/* ------------------------------------------------------------------ */

.twofa-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--text);
  margin-bottom: 2px;
}

.twofa-icon svg {
  width: 22px;
  height: 22px;
}

.twofa-context {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: -6px;
}

.twofa-context-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.twofa-context-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.otp-expiry {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.otp-expiry.warning {
  color: var(--warning);
}

/* ------------------------------------------------------------------ */
/* Caixas de código (OTP)                                             */
/* ------------------------------------------------------------------ */

.otp-group {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.otp-box:hover {
  border-color: #333333;
}

.otp-box:focus {
  border-color: var(--accent);
  background: #101010;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ------------------------------------------------------------------ */
/* Reenvio com cooldown                                               */
/* ------------------------------------------------------------------ */

.auth-switch .link-btn.cooldown {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.auth-switch .link-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Variações do toast                                                 */
/* ------------------------------------------------------------------ */

.auth-toast.cooldown {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.06);
}

.auth-toast.info {
  color: var(--text-secondary);
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}

/* ------------------------------------------------------------------ */
/* Dashboard Page                                                     */
/* ------------------------------------------------------------------ */

.dash-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dash-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dash-menu-toggle span {
  display: block;
  width: 14px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--text-secondary);
}

.dash-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card-alt);
  white-space: nowrap;
}

.dashboard-logout {
  color: var(--text-secondary);
}

.dash-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.dash-sidebar {
  width: 220px;
  flex: none;
  border-right: 1px solid var(--border);
  background: var(--card);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.dash-nav-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.dash-nav-item:hover {
  background: rgba(228, 228, 231, 0.06);
  color: var(--text);
}

.dash-nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 2px 0 0 0 var(--accent);
}

.dash-nav-item.active .dash-nav-icon {
  color: var(--accent);
}

.dash-sidebar-logout {
  margin-top: auto;
  color: var(--text-muted);
  text-align: left;
}

.dash-sidebar-overlay {
  display: none;
}

.dash-content {
  flex: 1;
  padding: 32px 28px 48px;
  max-width: 960px;
  animation: cardIn 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-welcome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 24px;
}

.dash-welcome-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dash-welcome-name {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.dash-welcome-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition), transform var(--transition);
}

.dash-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(228, 228, 231, 0.06);
}

.dash-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dash-card-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.dash-card-value.is-positive {
  color: var(--success);
}

/* ------------------------------------------------------------------ */
/* Abas do painel (Visão geral / Perfil / Segurança)                  */
/* ------------------------------------------------------------------ */

.dash-tab {
  display: none;
}

.dash-tab.active {
  display: block;
  animation: tabIn var(--transition-slow);
}

@keyframes tabIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------ */
/* Toast do painel (reaproveita as cores do toast de autenticação)    */
/* ------------------------------------------------------------------ */

.dash-toast {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  border: 1px solid var(--border);
  animation: toastIn 250ms ease;
}

.dash-toast.show {
  display: flex;
}

.dash-toast.success {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.06);
}

.dash-toast.error {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}

.dash-toast.cooldown {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.06);
}

/* ------------------------------------------------------------------ */
/* Aba Perfil                                                          */
/* ------------------------------------------------------------------ */

.dash-profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 24px;
}

.dash-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--bg);
  background: var(--silver-gradient);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.dash-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-profile-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dash-profile-username {
  font-size: 13px;
  color: var(--text-secondary);
}

.dash-status-pill {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.dash-status-pill.is-positive {
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
}

/* ------------------------------------------------------------------ */
/* Aba Segurança                                                       */
/* ------------------------------------------------------------------ */

.dash-grid-security {
  margin-bottom: 24px;
}

.dash-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.dash-panel:hover {
  border-color: var(--accent-border);
}

.dash-panel-danger {
  border-color: rgba(248, 113, 113, 0.25);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.05), var(--card));
}

.dash-panel-danger:hover {
  border-color: rgba(248, 113, 113, 0.45);
}

.dash-panel-danger .dash-panel-title {
  color: var(--error);
}

.dash-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.two-factor-disable {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.two-factor-confirm-form {
  margin-top: 6px;
}

.dash-panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dash-panel-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.security-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 420px;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Histórico de login                                                  */
/* ------------------------------------------------------------------ */

.login-history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-alt);
  transition: border-color var(--transition), transform var(--transition);
}

.login-history-item:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.login-history-item.is-current {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.login-history-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(228, 228, 231, 0.1);
  font-size: 14px;
}

.login-history-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.login-history-device {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.login-history-badge {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(228, 228, 231, 0.12);
  border: 1px solid var(--accent-border);
  padding: 2px 6px;
  border-radius: 999px;
}

.login-history-meta {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}

.login-history-empty {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 4px;
}

.login-history-remove {
  flex: none;
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.login-history-remove:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.5);
}

.login-history-remove:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ------------------------------------------------------------------ */
/* Responsividade                                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card {
    padding: 30px 22px;
    border-radius: var(--radius-md);
  }

  .auth-title {
    font-size: 20px;
  }

  .otp-box {
    font-size: 17px;
  }

  .otp-group {
    gap: 6px;
  }

  .password-field input,
  .availability-field input {
    font-size: 16px; /* evita zoom automático em iOS/Android */
  }

  .trust-strip {
    gap: 6px;
    margin-bottom: 20px;
  }

  .trust-badge {
    font-size: 10.5px;
    padding: 5px 9px;
  }

  .trust-badge svg {
    width: 12px;
    height: 12px;
  }

  .auth-footer-note {
    font-size: 11.5px;
    padding: 0 8px;
  }
}

@media (max-width: 860px) {
  .dash-menu-toggle {
    display: flex;
  }

  .dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: 20px 0 40px rgba(0,0,0,0.4);
  }

  .dash-sidebar.open {
    transform: translateX(0);
  }

  .dash-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 30;
  }

  .dash-sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .dash-content {
    padding: 24px 18px 40px;
  }

  .dash-welcome-card {
    padding: 22px 20px;
  }

  .dash-welcome-name {
    font-size: 24px;
  }

  .dashboard-badge {
    display: none;
  }
}

@media (max-width: 420px) {
  .dash-topbar {
    padding: 14px 16px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-profile-card {
    flex-direction: column;
    text-align: center;
    padding: 22px 18px;
  }

  .dash-profile-info {
    align-items: center;
  }

  .dash-panel {
    padding: 20px 18px;
  }

  .security-form {
    max-width: none;
  }
}

/* ------------------------------------------------------------------ */
/* Trust strip (selo de confiança abaixo da marca)                    */
/* ------------------------------------------------------------------ */

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 6px 10px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.trust-badge:hover {
  border-color: rgba(228, 228, 231, 0.5);
  background: rgba(228, 228, 231, 0.16);
  transform: translateY(-1px);
}

.trust-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--accent);
}

.link-btn-inline {
  font-size: inherit;
  font-weight: 600;
  display: inline;
}

.auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 420px;
}

.auth-footer-note svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.auth-footer-note .link-btn {
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-footer-note .link-btn:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Modal: Termos de proteção e segurança                              */
/* ------------------------------------------------------------------ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay.show {
  display: flex;
  animation: overlayIn 200ms ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: min(720px, 88vh);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--card-alt) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: cardIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-logo {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.modal-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d0d0d;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--accent-border);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}

.modal-updated {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.modal-lead {
  color: var(--text);
  margin-bottom: 18px;
}

.modal-body h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.modal-body h3:first-of-type {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 4px;
}

.modal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.modal-list li {
  position: relative;
  padding-left: 16px;
}

.modal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.modal-list strong {
  color: var(--text);
}

.modal-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-footer .modal-accept-btn {
  width: 100%;
}

@media (max-width: 480px) {
  .modal-card {
    max-height: 92vh;
  }
  .modal-header {
    padding: 20px 18px 14px;
  }
  .modal-body {
    padding: 16px 18px;
  }
  .modal-footer {
    padding: 14px 18px 18px;
  }
}
