/* ========================================================
   EAS+ MILITAR - CSS v4.0
   Paleta Otimizada para Médicos Temporários do Exército
   Baixa fadiga visual | Hierarquia clara | UX clínico
   ======================================================== */

/* 🎨 ======= Variáveis Globais - Paleta v4.0 ======= */
:root {
  /* Cores Primárias - Verde Militar Profundo */
  --primary: #264E36;          /* Autoridade, estabilidade, decisão */
  --primary-dark: #1F3F2C;     /* Hover - feedback claro sem agressividade */
  --primary-light: #3A6B4A;    /* Versão mais clara para estados */

  /* Cores Secundárias - Bronze Institucional */
  --accent: #9C7A1C;           /* Destaque nobre, não chamativo */
  --accent-dark: #7E6116;      /* Hover consistente */
  --accent-light: #B8922A;     /* Versão clara */

  /* Info/Saúde - Teal Médico */
  --info: #0E6E6E;             /* Cor associada à saúde */
  --info-light: #DCEEEE;       /* Cards informativos sem poluição */

  /* Estados Semânticos - UX Clínico */
  --success: #2F8F4E;          /* Prescrição salva, sync ok */
  --warning: #C7931E;          /* Atenção clínica, sem urgência */
  --danger: #7A1E1E;           /* Erros reais - uso parcimonioso */
  --disabled: #9AA5A0;         /* Elementos inativos */

  /* Sistema de Backgrounds */
  --dark: #1C2526;             /* Carvão militar - header/sidebar */
  --dark-soft: #2A3435;        /* Carvão suave */
  --bg-page: #F2F5F3;          /* Cinza esverdeado - menor fadiga */
  --bg-card: #FAFBFA;          /* Branco sujo - evita contraste extremo */
  --bg-highlight: #E8F0EA;     /* Destaque suave */
  --divider: #D6DED9;          /* Divisórias - organização visual */

  /* Escala de Cinzas (tons verdes sutis) */
  --gray-50: #F2F5F3;
  --gray-100: #E8EDEA;
  --gray-200: #D6DED9;
  --gray-300: #B8C4BD;
  --gray-400: #9AA5A0;
  --gray-500: #7B8784;
  --gray-600: #4A5554;

  /* Tipografia - WCAG AA Contrast Compliant */
  --text-primary: #1C2526;     /* Texto principal */
  --text-secondary: #3A4544;   /* Leitura confortável - darker for contrast */
  --text-muted: #4A5554;       /* Muted text - meets AA contrast */
  --text-on-dark: #F2F5F3;     /* Texto em fundo escuro (não branco puro) */
  --text-link: #0A5858;        /* Links - darker for contrast */

  /* Compatibilidade */
  --light: #FAFBFA;

  /* Sombras - UI moderna, sem decoração */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.18);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 6px 24px rgba(0, 0, 0, 0.18);

  /* Transições */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Espaçamentos base */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Bootstrap overrides */
  --bs-primary: var(--primary);
  --bs-success: var(--success);
  --bs-warning: var(--warning);
  --bs-danger: var(--danger);
  --bs-info: var(--info);
  --bs-dark: var(--dark);
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* =================== Reset & Base =================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-page);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  padding-bottom: 80px;
}

/* =================== Acessibilidade =================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary);
  color: var(--light);
  padding: 12px 24px;
  z-index: 9999;
  transition: top 0.3s ease;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =================== Layout =================== */
main {
  flex: 1;
  padding: var(--space-md);
  max-width: 100%;
}

.container {
  max-width: 960px;
}

/* =================== Tipografia =================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.875rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.125rem; margin-bottom: 0.625rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* =================== Botões =================== */
.btn {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

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

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-card);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: var(--text-on-dark);
}

.btn-success:hover {
  background: #267A40;
  color: var(--text-on-dark);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-on-dark);
}

.btn-danger:hover {
  background: #5C1717;
  color: var(--text-on-dark);
}

.btn-warning {
  background: var(--warning);
  color: var(--dark);
}

.btn-warning:hover {
  background: #A87A18;
  color: var(--dark);
}

.btn-info {
  background: var(--info);
  color: var(--text-on-dark);
}

.btn-info:hover {
  background: #0A5858;
  color: var(--text-on-dark);
}

/* Botão Secundário/Bronze */
.btn-secondary {
  background: var(--accent);
  color: var(--text-on-dark);
}

.btn-secondary:hover {
  background: var(--accent-dark);
  color: var(--text-on-dark);
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--light);
}

.btn-outline-secondary {
  border: 2px solid var(--gray-300);
  color: var(--text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--text-primary);
}

.btn-outline-danger {
  border: 2px solid var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: var(--light);
}

/* Botões pequenos */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 36px;
}

/* Estado desabilitado */
.btn:disabled,
.btn.disabled {
  background: var(--gray-400);
  color: var(--text-primary);
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: none;
}

.btn:disabled:hover,
.btn.disabled:hover {
  background: var(--gray-400);
  transform: none;
}

/* =================== Navbar Superior =================== */
.navbar {
  background: var(--dark) !important;
  box-shadow: var(--shadow-md);
  padding: 0.5rem 1rem;
  z-index: 1030;
}

.navbar-brand {
  color: var(--light) !important;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.navbar-toggler {
  border: none;
  padding: 8px;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-nav .nav-link {
  color: #FFFFFF !important;
  font-weight: 500;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.navbar-nav .nav-link:hover {
  color: var(--accent-light) !important;
  background: rgba(255,255,255,0.08);
}

.navbar-nav .nav-link img,
.navbar-nav .nav-link i {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 1;
}

.dropdown-menu {
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 8px;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-highlight);
  color: var(--primary);
}

.dropdown-item img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

@media (max-width: 991px) {
  .navbar-nav { display: none !important; }
  .navbar-toggler { display: none !important; }
  /* Keep dark mode toggle visible on mobile */
  .dark-mode-toggle { display: flex !important; }
}

/* =================== Dark Mode Toggle Button =================== */
.dark-mode-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px;
  margin-left: auto;
  margin-right: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.dark-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent);
  border-color: var(--accent);
}

.dark-mode-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Show sun icon by default (light mode), hide moon */
.dark-mode-toggle .icon-sun {
  display: block;
}

.dark-mode-toggle .icon-moon {
  display: none;
  position: absolute;
}

/* In dark mode: show moon, hide sun */
[data-theme="dark"] .dark-mode-toggle .icon-sun,
.dark-mode .dark-mode-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .dark-mode-toggle .icon-moon,
.dark-mode .dark-mode-toggle .icon-moon {
  display: block;
}

@media (max-width: 991px) {
  .dark-mode-toggle {
    margin-right: 8px;
    width: 38px;
    height: 38px;
  }
  .dark-mode-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* =================== Bottom Navigation =================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--light);
  box-shadow: 0 -1px 10px rgba(28, 37, 38, 0.08);
  display: none;
  z-index: 1040;
  padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--gray-200);
}

.bottom-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  min-width: 60px;
  min-height: 48px;
}

.bottom-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  background: var(--bg-highlight);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--primary);
  background: var(--bg-highlight);
}

.bottom-nav-item img {
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.bottom-nav-item.active img,
.bottom-nav-item:hover img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(25%) sepia(30%) saturate(1000%) hue-rotate(70deg);
}

.bottom-nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 991px) {
  .bottom-nav { display: block; }
  body { padding-bottom: 85px; }
}

/* =================== Cards =================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--gray-300);
}

.card-body {
  padding: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.card-header {
  background: var(--primary);
  color: var(--text-on-dark);
  font-weight: 600;
  padding: 0.875rem 1rem;
  border: none;
  font-size: 0.9rem;
}

/* Card com ícone */
.card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  line-height: 1;
}

.card-icon i {
  display: inline-block;
}

/* Dark mode card icons */
[data-theme="dark"] .card-icon {
  color: var(--primary-light);
}

/* =================== Page Header =================== */
.page-header {
  text-align: center;
  padding: 1.25rem 0;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* =================== Hero Section =================== */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
  margin: -1rem -1rem 2rem -1rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/assets/img/background.png') center/cover no-repeat;
  opacity: 0.12;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero h1 {
  color: var(--text-on-dark);
  font-size: 1.875rem;
  margin-bottom: 0.875rem;
}

.hero p {
  color: rgba(242, 245, 243, 0.85);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.hero .disclaimer {
  font-size: 0.7rem;
  color: rgba(242, 245, 243, 0.7);
  margin-top: 1.5rem;
}

/* Links */
a {
  color: var(--text-link);
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary);
}

/* =================== Listas =================== */
.list-group {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 16px;
  transition: var(--transition-fast);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background: var(--gray-50);
}

.list-group-item:active {
  background: var(--bg-highlight);
}

/* =================== Áudio Player =================== */
.audio-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  color: var(--text-primary);
}

.audio-title img {
  width: 22px;
  height: 22px;
  opacity: 0.5;
}

.audio-actions {
  display: flex;
  gap: 8px;
}

#audioPlayerContainer {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
}

#audioPlayerContainer h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
  color: var(--primary);
}

#audioPlayerContainer audio {
  width: 100%;
  border-radius: var(--radius-sm);
  height: 40px;
}

#letraMusica {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  max-height: 280px;
  overflow-y: auto;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =================== Formulários =================== */
.form-control, .form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  padding: 10px 14px;
  font-size: 0.95rem;
  min-height: 44px;
  transition: var(--transition-fast);
  background: var(--bg-card);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.12);
}

.form-label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.input-group-text {
  background: var(--gray-200);
  border: 1px solid var(--gray-300);
  color: var(--text-primary);
}

/* Placeholder contrast fix */
.form-control::placeholder,
.form-select::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* =================== Accordion =================== */
.accordion-item {
  border: none;
  margin-bottom: 12px;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.accordion-button {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 18px;
  border-radius: var(--radius-md) !important;
  gap: 0;
}

.accordion-button i {
  font-size: 1.1em;
  opacity: 0.9;
}

.accordion-button:not(.collapsed) {
  background: var(--primary-dark) !important;
  color: #FFFFFF !important;
  box-shadow: none;
}

.accordion-button::after {
  filter: brightness(0) invert(1);
}

.accordion-button:focus {
  box-shadow: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.accordion-button:hover {
  background: var(--primary-light) !important;
}

.accordion-body {
  background: var(--bg-card);
  padding: 1rem 1.125rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* =================== Tabelas =================== */
.table {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
}

.table thead {
  background: var(--primary);
  color: var(--text-on-dark);
}

.table th {
  font-weight: 600;
  padding: 12px 14px;
  border: none;
  font-size: 0.85rem;
}

.table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-color: var(--gray-200);
  font-size: 0.875rem;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--gray-50);
}

/* =================== Badges =================== */
.badge {
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; color: var(--dark) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-secondary { background: var(--gray-500) !important; }

/* =================== Alertas =================== */
.alert {
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}

.alert-warning {
  background: #FEF6E7;
  color: #5C4609;
  border-left: 4px solid var(--warning);
}

.alert-success {
  background: #E8F5EC;
  color: #1D5A32;
  border-left: 4px solid var(--success);
}

.alert-danger {
  background: #F8E8E8;
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: var(--info-light);
  color: #0A5454;
  border-left: 4px solid var(--info);
}

/* =================== Footer =================== */
footer {
  background: var(--dark);
  color: rgba(242, 245, 243, 0.65);
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
}

@media (max-width: 991px) {
  footer { display: none; }
}

/* =================== Checklist Styles =================== */
.checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.checklist-header {
  background: var(--primary);
  color: var(--text-on-dark);
  padding: 0.875rem 1rem;
  font-weight: 700;
  font-size: 1rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--gray-200);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background: var(--gray-50);
}

.checklist-item.checked {
  background: var(--bg-highlight);
  color: var(--success);
}

.checklist-item.checked::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  margin-right: 12px;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.checklist-item:not(.checked)::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

/* =================== Progress Bar =================== */
.progress-bar-custom {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  transition: width 0.4s ease;
  border-radius: var(--radius-full);
}

/* =================== Nav Tabs =================== */
.nav-tabs {
  border-bottom: 2px solid var(--gray-200);
  gap: 4px;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 16px;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

/* =================== Utilitários =================== */
.shadow-card { box-shadow: var(--shadow-md); }
.rounded-xl { border-radius: var(--radius-xl); }
.bg-highlight { background: var(--bg-highlight); }
.text-primary-custom { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.border-primary { border-color: var(--primary) !important; }

/* Highlight box para bizus */
.highlight-box {
  background: var(--bg-highlight);
  border-left: 4px solid var(--primary);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  font-size: 0.9rem;
}

.highlight-box strong {
  color: var(--primary);
}

/* Info table para bizus */
.info-table {
  width: 100%;
  font-size: 0.875rem;
}

.info-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-200);
}

.info-table td:first-child {
  font-weight: 600;
  width: 35%;
  color: var(--primary);
}

.info-table tr:last-child td {
  border-bottom: none;
}

/* Quick reference grid */
.quick-ref {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.quick-ref-item {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-ref-item strong {
  display: block;
  color: var(--primary);
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.03em;
}

/* =================== Animações =================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.card, .checklist-card, .accordion-item {
  animation: cardStagger 0.35s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =================== Responsividade =================== */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .hero { min-height: 35vh; padding: 2rem 1rem; }
  .hero h1 { font-size: 1.5rem; }

  .card-body { padding: 1rem; }
  .btn { padding: 10px 14px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  body { padding-top: 56px; }
  .page-header h1 { font-size: 1.2rem; }

  .list-group-item {
    padding: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .audio-title { width: 100%; }
  .audio-actions { width: 100%; justify-content: flex-end; }

  .quick-ref { grid-template-columns: repeat(3, 1fr); }
}

/* =================== Dark Mode =================== */
/* Dark mode variables - applied via data-theme or media query */
[data-theme="dark"],
.dark-mode {
  --bg-page: #0D1214;
  --bg-card: #181F21;
  --bg-highlight: #1A2A22;
  --divider: #2A3436;
  --text-primary: #E8EDEA;
  --text-secondary: #B8C4BD;
  --text-muted: #9AA6A0;
  --text-on-dark: #E8EDEA;
  --text-link: #4AAEAE;
  --accent: #D4B856;
  --info: #3AAEAE;
  --gray-50: #181F21;
  --gray-100: #202A2C;
  --gray-200: #2A3436;
  --gray-300: #3A4648;
  --gray-400: #6A7678;
  --primary-light: #5A9A6A;
  --info-light: #1A3838;
}

[data-theme="dark"] body,
.dark-mode body,
[data-theme="dark"],
.dark-mode {
  background-color: #0D1214;
  color: #E8EDEA;
}

[data-theme="dark"] .card,
[data-theme="dark"] .checklist-card,
[data-theme="dark"] .list-group,
[data-theme="dark"] #audioPlayerContainer,
.dark-mode .card,
.dark-mode .checklist-card,
.dark-mode .list-group,
.dark-mode #audioPlayerContainer {
  background: #181F21;
  border-color: #2A3436;
}

[data-theme="dark"] .list-group-item,
.dark-mode .list-group-item {
  background: #181F21;
  border-color: #2A3436;
  color: #E8EDEA;
}

[data-theme="dark"] .list-group-item:hover,
.dark-mode .list-group-item:hover {
  background: #202A2C;
}

[data-theme="dark"] .bottom-nav,
.dark-mode .bottom-nav {
  background: #181F21;
  border-color: #2A3436;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
.dark-mode .form-control,
.dark-mode .form-select {
  background: #181F21;
  border-color: #3A4648;
  color: #E8EDEA;
}

[data-theme="dark"] .dropdown-menu,
.dark-mode .dropdown-menu {
  background: #181F21;
  border-color: #2A3436;
}

[data-theme="dark"] .dropdown-item,
.dark-mode .dropdown-item {
  color: #E8EDEA;
}

[data-theme="dark"] .dropdown-item:hover,
.dark-mode .dropdown-item:hover {
  background: #202A2C;
}

[data-theme="dark"] .accordion-body,
.dark-mode .accordion-body {
  background: var(--bg-card);
  color: var(--text-primary);
}

[data-theme="dark"] .accordion-button,
.dark-mode .accordion-button {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .accordion-button:not(.collapsed),
.dark-mode .accordion-button:not(.collapsed) {
  background: var(--primary-dark) !important;
}

[data-theme="dark"] #letraMusica,
.dark-mode #letraMusica {
  background: #202A2C;
  border-color: #2A3436;
}

[data-theme="dark"] .highlight-box,
.dark-mode .highlight-box {
  background: #1A2A22;
}

[data-theme="dark"] .quick-ref-item,
.dark-mode .quick-ref-item {
  background: #181F21;
  border-color: #2A3436;
}

[data-theme="dark"] .info-table td,
.dark-mode .info-table td {
  border-color: #2A3436;
}

[data-theme="dark"] .skeleton,
.dark-mode .skeleton {
  background: linear-gradient(90deg, #2A3436 25%, #202A2C 50%, #2A3436 75%);
}

[data-theme="dark"] .page-header h1,
.dark-mode .page-header h1 {
  color: #4A8A5A;
}

[data-theme="dark"] .checklist-item,
.dark-mode .checklist-item {
  background: #181F21;
  color: #E8EDEA;
  border-color: #2A3436;
}

[data-theme="dark"] .checklist-item:hover,
.dark-mode .checklist-item:hover {
  background: #202A2C;
}

[data-theme="dark"] .checklist-item.checked,
.dark-mode .checklist-item.checked {
  background: #1A2A22;
}

[data-theme="dark"] .checklist-header,
.dark-mode .checklist-header {
  background: var(--primary-dark);
}

[data-theme="dark"] .table,
.dark-mode .table {
  border-color: #2A3436;
}

[data-theme="dark"] .table td,
.dark-mode .table td {
  border-color: #2A3436;
  color: #E8EDEA;
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: #181F21;
}

/* Auto dark mode based on system preference (fallback) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg-page: #0D1214;
    --bg-card: #181F21;
    --bg-highlight: #1A2A22;
    --divider: #2A3436;
    --text-primary: #E8EDEA;
    --text-secondary: #A0ACA7;
    --text-muted: #7B8784;
    --gray-50: #181F21;
    --gray-100: #202A2C;
    --gray-200: #2A3436;
    --gray-300: #3A4648;
    --primary-light: #4A8A5A;
  }

  html:not([data-theme="light"]) body {
    background-color: #0D1214;
    color: #E8EDEA;
  }

  html:not([data-theme="light"]) .card,
  html:not([data-theme="light"]) .checklist-card,
  html:not([data-theme="light"]) .list-group,
  html:not([data-theme="light"]) #audioPlayerContainer {
    background: #181F21;
    border-color: #2A3436;
  }

  html:not([data-theme="light"]) .list-group-item {
    background: #181F21;
    border-color: #2A3436;
    color: #E8EDEA;
  }

  html:not([data-theme="light"]) .bottom-nav {
    background: #181F21;
    border-color: #2A3436;
  }

  html:not([data-theme="light"]) .form-control,
  html:not([data-theme="light"]) .form-select {
    background: #181F21;
    border-color: #3A4648;
    color: #E8EDEA;
  }

  html:not([data-theme="light"]) .dropdown-menu {
    background: #181F21;
    border-color: #2A3436;
  }

  html:not([data-theme="light"]) .dropdown-item {
    color: #E8EDEA;
  }

  html:not([data-theme="light"]) .accordion-body {
    background: #202A2C;
  }

  html:not([data-theme="light"]) .dark-mode-toggle .icon-sun {
    display: none;
  }

  html:not([data-theme="light"]) .dark-mode-toggle .icon-moon {
    display: block;
  }
}

/* =================== High Contrast =================== */
@media (prefers-contrast: high) {
  :root {
    --primary: #1A4010;
    --accent: #9A7209;
  }

  .btn { border: 2px solid currentColor; }
  .card { border: 2px solid var(--text-primary); }

  :focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
  }
}

/* =================== Reduced Motion =================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =================== Safe Areas (iPhone) =================== */
@supports (padding: max(0px)) {
  body {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* =================== PWA Styles =================== */
.pwa-installed .navbar {
  padding-top: max(0.5rem, env(safe-area-inset-top));
}

.pwa-installed .bottom-nav {
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-logo {
  width: 100px;
  height: 100px;
}

.splash-title {
  color: var(--light);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1rem;
}

.splash-subtitle {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.splash-loader {
  width: 32px;
  height: 32px;
  margin-top: 1.5rem;
  border: 3px solid rgba(242, 245, 243, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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