/* ==========================================================================
   BuscarPDF Web - Identidade Visual Apple & Civic Tech (Inspirado no id.castelandia.com)
   Estética: Carvão Ardósia Nobre (#232226) + Ouro Dourado (#c7b386) + Apple Glass
   ========================================================================== */

:root {
  --id-charcoal: #232226;
  --id-gold: #c7b386;
  --id-gold-hover: #b49f72;
  --id-gold-light: rgba(199, 179, 134, 0.15);
  --id-dark-bg: #0b0e14;
  --id-dark-surface: #121620;
}

/* 1. Letreiro Institucional Oficial (TV News Ticker Style) */
.gov-ticker-bar {
  background: linear-gradient(90deg, #0b0e14 0%, #121620 50%, #0b0e14 100%);
  border-bottom: 1.5px solid rgba(199, 179, 134, 0.35);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 34px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  font-family: var(--font-sans);
  user-select: none;
  width: 100%;
  font-size: 0.78rem;
  position: relative;
  z-index: 110;
}

.gov-ticker-badge {
  background: linear-gradient(135deg, rgba(199, 179, 134, 0.25), rgba(199, 179, 134, 0.08));
  color: #e2b857;
  border-right: 1.5px solid rgba(199, 179, 134, 0.35);
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.gov-ticker-content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  color: #94a3b8;
  font-weight: 600;
  padding-left: 1.5rem;
  white-space: nowrap;
  animation: marquee 35s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.gov-ticker-tag {
  color: #c7b386;
  font-weight: 700;
}

/* 2. Dynamic Island Notifications (Top-Center Floating Pill) */
@keyframes dynamicIslandEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.85);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, 4px) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    filter: blur(0);
  }
}

.apple-dynamic-island {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 0.95rem;
  padding: 0.85rem 1.45rem 0.85rem 1.1rem;
  max-width: min(94vw, 700px);
  box-sizing: border-box;
  background: rgba(13, 20, 36, 0.96);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(199, 179, 134, 0.35);
  box-shadow: 
    0 24px 50px -10px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
  border-radius: 34px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  animation: dynamicIslandEntrance 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
  user-select: none;
}

.apple-island-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #c7b386, #8c734b);
  color: #ffffff;
}

/* 3. Tela de Bloqueio & Seletor de Perfil (Estilo id.castelandia.com) */
.lock-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 2rem 2.5rem;
  background: rgba(5, 10, 24, 0.82);
  backdrop-filter: blur(35px) saturate(180%);
  -webkit-backdrop-filter: blur(35px) saturate(180%);
  color: #f8fafc;
  user-select: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.lock-screen-overlay.hidden {
  display: none !important;
}

/* Aurora Luminosa Respirando ao Fundo */
.aurora-light {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #818cf8 35%, #c7b386 65%, transparent 85%);
  filter: blur(85px);
  transform: translate(-50%, -50%);
  opacity: 0.22;
  pointer-events: none;
  animation: auroraBreathe 8s ease-in-out infinite alternate;
}

@keyframes auroraBreathe {
  0% { transform: scale(1) translate(-50%, -50%); opacity: 0.16; }
  100% { transform: scale(1.22) translate(-50%, -50%); opacity: 0.3; }
}

/* Relógio de Tela de Bloqueio Apple */
.lock-clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 1rem;
  z-index: 2;
}

.lock-clock-time {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.lock-clock-date {
  font-size: 1.15rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: capitalize;
  margin-top: 0.45rem;
}

.lock-institutional-motto {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e2b857;
  text-transform: uppercase;
  background: rgba(199, 179, 134, 0.12);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(199, 179, 134, 0.3);
}

/* Grade de Perfis (Seletor de Operadores) */
.profiles-selection-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 860px;
  margin: 2rem 0;
  z-index: 2;
}

.profiles-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.profiles-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  width: 100%;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  padding: 1rem 0.85rem;
  border-radius: var(--radius-lg);
  transition: transform var(--duration-fast) var(--ease-spring),
              background var(--duration-fast);
  background: transparent;
  width: 150px;
  position: relative;
}

.profile-card:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(255, 255, 255, 0.06);
}

.profile-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition: all var(--duration-fast) var(--ease-spring);
}

.profile-card:hover .profile-avatar-wrapper {
  border-color: #e2b857;
  box-shadow: 0 16px 36px rgba(199, 179, 134, 0.4);
}

.profile-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
}

.profile-role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal de Entrada de PIN / Desbloqueio */
.pin-entry-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.2s var(--ease-apple);
}

.pin-entry-box.active {
  display: flex;
}

.pin-dots {
  display: flex;
  gap: 0.85rem;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: transparent;
  transition: all var(--duration-fast);
}

.pin-dot.filled {
  background: #e2b857;
  border-color: #e2b857;
  box-shadow: 0 0 12px #e2b857;
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.pin-key {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.pin-key:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.06);
}

.pin-key:active {
  transform: scale(0.94);
  background: #e2b857;
  color: #0b0e14;
}

/* Dropdown de Usuário Ativo no Cabeçalho */
.user-profile-menu {
  position: relative;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.user-profile-trigger:hover {
  border-color: #c7b386;
  background: var(--badge-bg);
}

.user-nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #ffffff;
}

.user-nav-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 200;
  animation: fadeIn 0.18s var(--ease-spring);
}

.user-dropdown-card.show {
  display: flex;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

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

.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* ==========================================================================
   Apple & Linear Luxury: Spotlight Radial Glow, Tabular Nums & Tactile Feedback
   ========================================================================== */

/* 1. Linear / Apple Spotlight Radial Glow nos Cards */
.glass-card, .result-card, .stat-card, .scanner-main-deck, .admin-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
}

.glass-card::before, .result-card::before, .stat-card::before, .scanner-main-deck::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, -200px);
  left: var(--mouse-x, -200px);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(199, 179, 134, 0.14) 0%, rgba(56, 189, 248, 0.06) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 50%;
  z-index: 1;
}

.glass-card:hover::before, .result-card:hover::before, .stat-card:hover::before, .scanner-main-deck:hover::before {
  opacity: 1;
}

/* Garantir que conteúdo interno fique acima do reflexo */
.glass-card > *, .result-card > *, .stat-card > * {
  position: relative;
  z-index: 2;
}

/* 2. Tipografia Numérica Tabular para Valores e Métricas (Sem oscilação) */
.tabular-nums, .chip-value, .stat-number, #resultsCount, .results-count, .scan-page-meta, .meta-chip, .table-cell-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 3. Micro-interações Táteis Naturais (Padrão Apple Haptic Feedback) */
.btn, .suggestion-chip, .action-pill-btn, .filter-toggle-btn, .pill-filter-item, .nav-item, .quick-action-card {
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active, .suggestion-chip:active, .action-pill-btn:active, .filter-toggle-btn:active, .pill-filter-item:active, .nav-item:active {
  transform: scale(0.96) !important;
}

