/* Doctor Autoloader - Design System complementar ao Tailwind (CDN) */

:root {
  --brand-primary: #1e3a8a;   /* blue-900 */
  --brand-accent: #22d3ee;    /* cyan-400 */
  --bg-app: #f8fafc;          /* slate-50 */
}

html, body {
  background-color: var(--bg-app);
  font-family: "Inter", "Roboto", ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Navbar ---------- */
.nav-link {
  position: relative;
  transition: color 0.15s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0%;
  background-color: var(--brand-accent);
  transition: width 0.2s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: var(--brand-accent);
}

/* ---------- Security badges ---------- */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: rgba(30, 58, 138, 0.08);
  color: var(--brand-primary);
  white-space: nowrap;
}
.security-badge svg { width: 13px; height: 13px; }

/* ---------- Dropzone (Ingestão) ---------- */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  background-color: #ffffff;
}
.dropzone.drag-over {
  border-color: var(--brand-accent);
  background-color: rgba(34, 211, 238, 0.06);
  transform: scale(1.01);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(30, 58, 138, 0.15);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background-color: #e2e8f0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  width: 0%;
  transition: width 0.25s ease;
}

/* ---------- Split screen (Validação) ---------- */
.split-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .split-container {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.doc-viewer {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  max-height: 78vh;
  overflow-y: auto;
}
.doc-viewer::-webkit-scrollbar { width: 8px; }
.doc-viewer::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 999px; }

.doc-page {
  aspect-ratio: 1 / 1.35;
  background: #ffffff;
  padding: 2rem;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  color: #334155;
}

.blurred {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
}
.blurred.revealed {
  filter: none;
}

/* ---------- Alertas clínicos ---------- */
.value-alert {
  color: #ef4444; /* red-500 */
  font-weight: 700;
  animation: blink-pulse 1.4s ease-in-out infinite;
}
@keyframes blink-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.value-normal {
  color: #16a34a; /* green-600 */
  font-weight: 600;
}

.exam-row {
  transition: background-color 0.15s ease;
}
.exam-row:hover {
  background-color: rgba(148, 163, 184, 0.08);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  min-width: 260px;
  background: #ffffff;
  border-left: 4px solid #16a34a;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toast-in 0.25s ease;
  font-size: 0.85rem;
  color: #1e293b;
}
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Dashboard cards ---------- */
.chart-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.step-indicator span {
  color: #94a3b8;
}
.step-indicator span.current {
  color: var(--brand-primary);
  font-weight: 700;
}
