:root {
  /* Modo Escuro (Padrão) */
  --color-bg-base: #0a0a0a;
  --color-bg-surface: #111111;
  --color-bg-elevated: #1a1a1a;
  --color-border: #2a2a2a;
  --color-text-primary: #ffffff;
  --color-text-secondary: #e8e8e8;
  --color-text-muted: #aaaaaa;
  --logo-stroke-color: #ffffff;
}

body {
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* O Modo Escuro já está definido no :root padrão do seu design system */
body.light-theme {
  --color-bg-base: #f9fafb;
  --color-bg-surface: #ffffff;
  --color-bg-elevated: #f3f4f6;
  --color-border: #e5e7eb;
  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
  --logo-stroke-color: #111827;
}

/* Utilitário para o Wordmark se adaptar ao tema */
.light-theme .wordmark {
  -webkit-text-stroke: 1px var(--logo-stroke-color);
  text-shadow: none; /* Remove a sombra pesada no modo claro para maior legibilidade */
  color: var(--color-text-primary);
}

/* Logo Wordmark Style */
.wordmark {
  font-family: "Black Han Sans", sans-serif;
  color: #ffffff;
  -webkit-text-stroke: 1px #ffffff;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

/* Classes de redimensionamento de fonte */
html.font-size-large {
  font-size: 110%; /* Aumenta a proporção base em 10% */
}

html.font-size-xlarge {
  font-size: 120%; /* Aumenta a proporção base em 20% */
}

html.font-size-xxlarge {
  font-size: 150%; /* Aumenta a proporção base em 20% */
}

/* SR-ONLY (Screen Reader Only) - Visível apenas para leitores de ecrã ou quando focado */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Buttons */
.btn-primary {
  background-color: #f5a020;
  color: #0a0a0a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #c97d10;
  box-shadow: 0 0 20px rgba(245, 160, 32, 0.4);
  outline: none;
}

.btn-secondary {
  background: transparent;
  color: #f5a020;
  border: 1.5px solid #f5a020;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: rgba(245, 160, 32, 0.08);
  box-shadow: 0 0 16px rgba(245, 160, 32, 0.2);
  outline: none;
}

.btn-ghost {
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-family: "IBM Plex Sans", sans-serif;
  padding: 8px 16px;
  transition: color 0.2s ease;
}

.btn-ghost:hover {
  color: #e8e8e8;
}

/* Cards */
.system-card {
  border-radius: 8px;
  padding: 24px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.system-card:hover {
  border-color: rgba(245, 160, 32, 0.4);
  box-shadow: 0 0 20px rgba(245, 160, 32, 0.08);
}

/* Inputs */
.input-field {
  background-color: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  border-radius: 4px;
  color: #ffffff;
  font-family: "IBM Plex Sans", sans-serif;
  padding: 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  width: 100%;
}

.input-field.light-theme {
  background-color: #fafafa;
  border: 1.5px solid #3c3c3c;
  border-radius: 4px;
  color: #1b1b1b;
  font-family: "IBM Plex Sans", sans-serif;
  padding: 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  /* width: 100%; */
}

.input-field:focus {
  border-color: #f5a020;
  box-shadow: 0 0 0 3px rgba(245, 160, 32, 0.15);
}

.input-field::placeholder {
  color: #555555;
}

/* Badges */
.badge-brand {
  background: rgba(245, 160, 32, 0.15);
  color: #f5a020;
  border: 1px solid rgba(245, 160, 32, 0.3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
}

.badge-white {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
}

.badge-white.light-theme {
  background: rgba(255, 255, 255, 0.8);
  color: #1d1d1d;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Utils */
.text-gradient {
  background: linear-gradient(135deg, #f5a020 0%, #c97d10 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

*:focus-visible {
  outline: 2px solid #f5a020;
  outline-offset: 2px;
}

/* Animação de Glow */
@keyframes dragonGlow {
  0%,
  100% {
    box-shadow: 0 0 16px rgba(245, 160, 32, 0.2);
  }

  50% {
    box-shadow: 0 0 32px rgba(245, 160, 32, 0.5);
  }
}

.animate-glow {
  animation: dragonGlow 3s ease-in-out infinite;
}

.step-hidden {
  display: none;
}

/* Progress Bar */
.progress-step {
  height: 4px;
  flex-grow: 1;
  background: #2a2a2a;
  transition: background 0.4s ease;
}

.progress-step.active {
  background: #f5a020;
  box-shadow: 0 0 10px rgba(245, 160, 32, 0.5);
}

/* Custom checkbox */
.checkbox-custom {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid #555555;
  border-radius: 4px;
  background-color: #1a1a1a;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; /* Evita que o checkbox amasse em textos longos */
}

.checkbox-custom.light-theme {
  border: 1.5px solid #1d1d1d;
  background-color: #fafafa;
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; /* Evita que o checkbox amasse em textos longos */
}

/* O "V" (check) desenhado via clip-path */
.checkbox-custom::before {
  content: "";
  width: 12px;
  height: 12px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #0a0a0a; /* Cor do ícone de check (igual ao background base) */
  background-color: #0a0a0a;
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Estado Ativado */
.checkbox-custom:checked {
  background-color: #f5a020;
  border-color: #f5a020;
  box-shadow: 0 0 12px rgba(245, 160, 32, 0.3);
}

/* Animação do check aparecendo */
.checkbox-custom:checked::before {
  transform: scale(1);
}

/* Acessibilidade (Navegação por teclado) */
.checkbox-custom:focus-visible {
  outline: 2px solid #f5a020;
  outline-offset: 2px;
  border-color: #f5a020;
}

/* Hover no estado não checado */
.checkbox-custom:not(:checked):hover {
  border-color: #f5a020;
  background-color: rgba(245, 160, 32, 0.05);
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #0a0a0a;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #f5a020;
}

/* Mobile menu (off-canvas) */
.mobile-menu {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}
.mobile-menu[aria-hidden="false"] {
  display: block;
}
.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(92vw, 360px);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.mobile-menu[aria-hidden="false"] .mobile-menu-panel {
  transform: translateX(0);
}
.mobile-menu-panel-inner {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.mobile-nav-link {
  display: block;
  padding: 12px 8px;
  border-radius: 6px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.mobile-nav-link:hover,
.mobile-nav-link:focus {
  color: var(--color-text-primary);
  background: rgba(245, 160, 32, 0.06);
}
.mobile-auth {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: flex-end;
  padding-bottom: 24px;
}
.mobile-auth-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
}
.mobile-auth-link:hover,
.mobile-auth-link:focus {
  background: rgba(245, 160, 32, 0.04);
  color: var(--color-text-primary);
}
.mobile-auth-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 8px;
}

@media print {
  /* Força as variáveis do Tailwind para alto contraste (preto no branco) apenas na impressão */
  :root,
  body {
    --color-bg-base: 255, 255, 255 !important;
    --color-bg-surface: 255, 255, 255 !important;
    --color-bg-elevated: 245, 245, 245 !important;
    --color-border: 200, 200, 200 !important;
    --color-text-primary: 0, 0, 0 !important; /* Preto puro */
    --color-text-secondary: 50, 50, 50 !important; /* Cinza escuro */
    --color-text-muted: 100, 100, 100 !important; /* Cinza médio */
  }

  body {
    background: white !important;
    color: black !important;
  }

  #header,
  #footer,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .system-card {
    border: 1px solid #ccc !important;
    background: white !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Removido o background-color e color problemáticos */
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
  }
}
