/* driver.css - Estilos Mobile-First para a Interface do Motorista (PWA) */

.driver-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 80px 16px;
}

/* Header do Motorista & Status CNH */
.driver-header-card {
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.driver-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.driver-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.driver-info .driver-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.driver-info .driver-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Semáforo da CNH */
.cnh-status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.cnh-green {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.cnh-green .cnh-status-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }

.cnh-yellow {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.cnh-yellow .cnh-status-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.cnh-red {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.cnh-red .cnh-status-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.cnh-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cnh-details strong {
  display: block;
  font-size: 0.82rem;
}

.cnh-details span {
  font-size: 0.74rem;
  opacity: 0.9;
}

.cnh-lock-alert {
  margin-top: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  color: #fca5a5;
  font-size: 0.8rem;
}

.cnh-lock-alert .alert-icon {
  font-size: 1.4rem;
}

/* Card de Viagem Ativa */
.active-trip-card {
  padding: 22px;
  margin-bottom: 22px;
  background: linear-gradient(165deg, #0e172a 0%, #172554 50%, #0b1329 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 25px rgba(37, 99, 235, 0.2);
  position: relative;
  overflow: hidden;
}

.active-trip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #10b981);
}

.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 4px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.18);
  border: 1.5px solid #10b981;
  color: #34d399;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.6px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGlow 1.5s infinite;
}

.trip-time-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}

.trip-vehicle-highlight {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vehicle-plate-badge {
  background: #000000;
  color: #ffffff;
  border: 2px solid #38bdf8;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.2rem;
  padding: 6px 14px;
  border-radius: 8px;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.vehicle-name-block h4 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}

.vehicle-name-block p {
  font-size: 0.86rem;
  color: #cbd5e1;
  font-weight: 500;
}

.vehicle-name-block p strong {
  color: #38bdf8;
  font-weight: 700;
}

/* Painel de Detalhes da Missão - Alto Contraste e Legibilidade Total */
.trip-details-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(8, 14, 27, 0.7);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.detail-item {
  background: rgba(24, 38, 71, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3.5px solid #38bdf8;
  border-radius: 8px;
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.detail-item:hover {
  background: rgba(30, 48, 88, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  border-left-color: #00f0ff;
}

.detail-item .detail-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: 0.9px;
  margin-bottom: 4px;
}

.detail-item .detail-value {
  font-size: 0.94rem;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.detail-item .cycle-value {
  color: #67e8f9 !important;
  font-weight: 700;
}

/* Caixa de Ação Rápida */
.driver-action-box {
  padding: 22px;
  margin-bottom: 22px;
  text-align: center;
}

.action-hero h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.action-hero p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Histórico de Viagens */
.driver-section {
  margin-top: 10px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
}

.trip-count-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.driver-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trip-history-item {
  background: rgba(17, 28, 53, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition-fast);
}

.trip-history-item:hover {
  background: rgba(24, 38, 71, 0.75);
}

.trip-history-item.border-active {
  border-color: var(--accent-cyan);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.history-plate {
  font-weight: 700;
  font-size: 0.9rem;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.status-pill {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.status-em_andamento { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.status-finalizada { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.history-dest {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.history-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Formulários de Saída / Devolução */
.form-page-header {
  margin-bottom: 18px;
}

.btn-icon-back {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  padding: 0;
}

.form-page-header h2 {
  font-size: 1.25rem;
}

.form-page-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.driver-form {
  padding: 20px;
}

.vehicle-preview-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.preview-metric .metric-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.preview-metric .metric-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.km-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.45;
  transition: all var(--transition-fast);
}

.km-alert-danger { 
  background: var(--danger-bg); 
  border: 1px solid rgba(239, 68, 68, 0.4); 
  color: #fca5a5; 
}

.km-alert-warning { 
  background: var(--warning-bg); 
  border: 1px solid rgba(245, 158, 11, 0.4); 
  color: #fde68a; 
}

.km-alert-success { 
  background: var(--success-bg); 
  border: 1px solid rgba(16, 185, 129, 0.4); 
  color: #a7f3d0; 
}

html[data-theme="light"] .km-alert-danger { 
  color: #b91c1c; 
  border-color: rgba(239, 68, 68, 0.35); 
}

html[data-theme="light"] .km-alert-warning { 
  color: #b45309; 
  border-color: rgba(245, 158, 11, 0.35); 
}

html[data-theme="light"] .km-alert-success { 
  color: #047857; 
  border-color: rgba(16, 185, 129, 0.35); 
}

/* Combustível - Alternadores */
.fuel-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #090e1a;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.btn-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-mode.active {
  background: #1e293b;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fuel-buttons-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.btn-fraction {
  background: #111c35;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  padding: 10px 4px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-fraction.active {
  background: var(--primary);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Chips Rápidos */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #111c35;
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip.active {
  background: #2563eb !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
  font-weight: 600;
}

html[data-theme="light"] .chip {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

html[data-theme="light"] .chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

html[data-theme="light"] .chip.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

select.form-control option {
  background: #0e172a;
  color: #f8fafc;
  padding: 8px 12px;
}

html[data-theme="light"] select.form-control option {
  background: #ffffff;
  color: #0f172a;
}

/* Subcards com Toggle */
.form-card-sub {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(11, 17, 32, 0.5);
  border: 1px solid var(--border-subtle);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-toggle {
  width: 44px;
  height: 24px;
  accent-color: var(--primary);
  cursor: pointer;
}

.km-delta-tag {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Modal de Salto de KM */
.gap-diff-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #090e1a;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-align: center;
}

.diff-col span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.diff-col strong {
  font-size: 1.1rem;
}

.diff-arrow {
  color: var(--warning);
  font-weight: 700;
}

.photo-upload-area {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  background: rgba(11, 17, 32, 0.4);
  cursor: pointer;
  transition: var(--transition-fast);
}

.photo-upload-area:hover {
  border-color: var(--accent-cyan);
  background: rgba(11, 17, 32, 0.7);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #cbd5e1;
}

.upload-icon {
  font-size: 2rem;
}

.upload-preview-box img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Múltiplos Abastecimentos no Percurso */
.abastecimento-item {
  background: rgba(14, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.abastecimento-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.abastecimento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.badge-abs-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.abs-total-summary {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #93c5fd;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

html[data-theme="light"] .abastecimento-item {
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="light"] .abastecimento-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .abs-total-summary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1e40af;
}

/* --- Tema Claro Completo para o Painel do Motorista e Viagem Ativa --- */
html[data-theme="light"] .active-trip-card {
  background: #ffffff;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 12px 30px -4px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .active-trip-card::before {
  background: linear-gradient(90deg, #0284c7, #2563eb, #059669);
}

html[data-theme="light"] .live-pill {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

html[data-theme="light"] .trip-time-tag {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

html[data-theme="light"] .trip-vehicle-highlight {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .vehicle-plate-badge {
  background: #0f172a;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .vehicle-name-block h4 {
  color: #0f172a;
}

html[data-theme="light"] .vehicle-name-block p {
  color: #475569;
}

html[data-theme="light"] .vehicle-name-block p strong {
  color: #1d4ed8;
}

html[data-theme="light"] .trip-details-grid {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .detail-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3.5px solid #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .detail-item:hover {
  background: #f0f9ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
}

html[data-theme="light"] .detail-item .detail-label {
  color: #0369a1;
  font-weight: 800;
}

html[data-theme="light"] .detail-item .detail-value {
  color: #0f172a;
  font-weight: 600;
}

html[data-theme="light"] .detail-item .cycle-value {
  color: #0284c7 !important;
  font-weight: 700;
}

html[data-theme="light"] .driver-header-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .driver-info .driver-name {
  color: #0f172a;
}

html[data-theme="light"] .driver-info .driver-role {
  color: #64748b;
}

html[data-theme="light"] .driver-action-box {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .action-hero h3 {
  color: #0f172a;
}

html[data-theme="light"] .action-hero p {
  color: #64748b;
}

html[data-theme="light"] .section-title {
  color: #0f172a;
}

html[data-theme="light"] .trip-history-item {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .trip-history-item:hover {
  background: #f8fafc;
  border-color: #93c5fd;
}

html[data-theme="light"] .history-plate {
  color: #1d4ed8;
}

html[data-theme="light"] .history-dest {
  color: #1e293b;
}

html[data-theme="light"] .history-meta {
  color: #64748b;
}

html[data-theme="light"] .driver-form {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="light"] .form-page-header h2 {
  color: #0f172a;
}

html[data-theme="light"] .form-page-header p {
  color: #64748b;
}

html[data-theme="light"] .vehicle-preview-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .preview-metric .metric-label {
  color: #64748b;
}

html[data-theme="light"] .preview-metric .metric-val {
  color: #0f172a;
}

/* --- Media Queries Responsivas do Motorista --- */
@media (max-width: 600px) {
  .driver-container {
    padding: 14px 12px 70px 12px;
  }
  .driver-header-card {
    padding: 14px;
  }
  .driver-avatar-row {
    gap: 12px;
  }
  .driver-avatar {
    width: 46px;
    height: 46px;
    font-size: 1rem;
  }
  .active-trip-card, .driver-action-box, .driver-form {
    padding: 16px 14px;
  }
  .trip-vehicle-highlight {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (max-width: 420px) {
  .driver-container {
    padding: 10px 8px 60px 8px;
  }
  .trip-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .btn-mode {
    font-size: 0.74rem;
    padding: 6px 4px;
  }
}

/* Banner de Saída de Urgência / Veículo em Gap */
.alert-box-urgencia {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  animation: pulse-urgencia-border 2.5s infinite;
}

.alert-urgencia-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-urgencia-header .urgencia-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.alert-urgencia-header strong {
  display: block;
  font-size: 0.95rem;
  color: #f87171;
  margin-bottom: 4px;
}

.alert-urgencia-header p {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

@keyframes pulse-urgencia-border {
  0%, 100% { border-color: rgba(239, 68, 68, 0.45); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { border-color: rgba(239, 68, 68, 0.9); box-shadow: 0 0 12px rgba(239, 68, 68, 0.35); }
}

/* ==========================================================================
   VALIDAÇÃO FACIAL DO CONDUTOR (SELFIE EM TEMPO REAL)
   ========================================================================== */

.security-badge-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}

.facial-verification-container {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: rgba(8, 13, 26, 0.75);
  transition: var(--transition-fast);
}

.facial-verification-container.has-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
}

.facial-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

/* Estado Idle / Aguardando */
.facial-avatar-placeholder {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(30, 58, 138, 0.25);
  border: 2px dashed #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto;
}

.facial-placeholder-icon {
  font-size: 2.5rem;
}

.facial-guide-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.35);
  animation: pulseGuide 2s infinite ease-in-out;
}

@keyframes pulseGuide {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.facial-instructions h4 {
  font-size: 1rem;
  margin: 0 0 6px 0;
  color: #f8fafc;
}

.facial-instructions p {
  font-size: 0.82rem;
  color: #cbd5e1;
  max-width: 440px;
  margin: 0 auto 14px auto;
  line-height: 1.45;
}

/* Estado Câmera Ativa */
.camera-stream-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
  border: 2px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  margin: 0 auto;
}

#video-selfie-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Espelhado para sensação de selfie natural */
}

.biometric-oval-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 230px;
  border-radius: 50%;
  border: 2.5px dashed rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35), inset 0 0 20px rgba(56, 189, 248, 0.15);
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
}

.biometric-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #10b981, transparent);
  box-shadow: 0 0 10px #38bdf8;
  animation: biometricScan 2.4s infinite ease-in-out;
}

@keyframes biometricScan {
  0% { top: 5%; opacity: 0.2; }
  50% { top: 92%; opacity: 1; }
  100% { top: 5%; opacity: 0.2; }
}

.biometric-oval-label {
  font-size: 0.72rem;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.camera-controls-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

/* Estado Foto Capturada */
.captured-photo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
}

.captured-selfie-img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2.5px solid #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.verified-seal-tag {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #059669;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.captured-meta-info {
  margin-top: 10px;
}

.captured-meta-info strong {
  font-size: 1.05rem;
  color: #f8fafc;
}

.captured-meta-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0;
}

html[data-theme="light"] .facial-verification-container {
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="light"] .facial-instructions h4,
html[data-theme="light"] .captured-meta-info strong {
  color: #0f172a;
}

html[data-theme="light"] .facial-instructions p {
  color: #475569;
}
