@import url("auth.css");

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar estilizado moderno para Windows (Edge, Chrome, Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: #f4f7fa;
  color: #1f2d3d;
  min-height: 100vh;
  min-height: 100dvh; /* Altura dinámica en Safari iOS */
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  touch-action: manipulation; /* Elimina retardo de toque de 300ms en Chrome y Android */
}

.main-content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
}

.main-content.legal {
  max-width: 820px;
}

.main-content.analyzer-full-screen {
  max-width: 100%;
  width: 100%;
  padding-top: max(10px, calc(env(safe-area-inset-top) + 6px));
  padding-bottom: 28px;
  padding-left: clamp(16px, 3.5vw, 48px);
  padding-right: clamp(16px, 3.5vw, 48px);
  box-sizing: border-box;
}

.analyzer-full-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0 auto;
}

.analyzer-full-container .card {
  width: 100%;
}

.analyzer-full-container .modern-upload-card {
  max-width: 980px;
  margin: 0 auto;
}

.analyzer-full-container .hub-card {
  max-width: 1380px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo {
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin-bottom: 6px;
  display: block;
}

.footer-logo {
  height: 34px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 12px;
  display: block;
}

h1 { font-size: 1.8rem; color: #0b5cab; letter-spacing: 1px; }
.subtitle { color: #6b7c8f; margin-top: 6px; font-size: 0.95rem; }

.card {
  background: #fff;
  border: 1px solid #e1e8ef;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(20, 40, 70, 0.05);
}

.dropzone {
  border: 2px dashed #b9c8d8;
  border-radius: 10px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6b7c8f;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
/* Card principal de Carga estilo Modal Amplio */
.modern-upload-card {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(11, 92, 171, 0.12), 0 4px 18px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 34px 38px;
  width: 100%;
  box-sizing: border-box;
}

.upload-card-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  width: 100%;
}

.upload-card-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 auto;
  text-align: center;
  letter-spacing: -0.4px;
}

.upload-card-close-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.35rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1;
}
.upload-card-close-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Rejilla de 2 Columnas */
.upload-grid-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 36px;
  align-items: stretch;
}

@media (max-width: 820px) {
  .upload-grid-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .modern-upload-card {
    padding: 24px 20px;
    border-radius: 20px;
  }
}

/* Columna Izquierda: Dropzone */
.upload-dropzone-column {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modern-dropzone-box {
  border: 2.5px dashed #cbd5e1;
  border-radius: 20px;
  background: #fafcff;
  height: 100%;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 24px 18px;
  position: relative;
  box-sizing: border-box;
}

.modern-dropzone-box.has-preview {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.modern-dropzone-box:hover,
.modern-dropzone-box.dragover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-2px);
}

.dropzone-prompt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.dropzone-cloud-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.28);
}

.dropzone-title {
  font-size: 1.12rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.dropzone-or-text {
  font-size: 0.92rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.dropzone-browse-pill {
  border: 1.5px solid #0284c7;
  color: #0284c7;
  background: #ffffff;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  margin-bottom: 16px;
}
.dropzone-browse-pill:hover {
  background: #0284c7;
  color: #ffffff;
}

.dropzone-meta-info {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.5;
}

.dropzone-preview-container {
  width: 100%;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.dropzone-preview-img {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 280px;
  max-height: 420px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.14);
  background: #0f172a;
}

.dropzone-replace-btn {
  font-size: 0.82rem;
  color: #0284c7;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 9999px;
  background: #e0f2fe;
  display: inline-block;
  transition: all 0.18s ease;
}
.dropzone-replace-btn:hover {
  background: #bae6fd;
}

/* Columna Derecha: Formulario y Estado */
.upload-form-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.patient-info-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.patient-info-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b5cab;
  margin: 0 0 2px 0;
}
.patient-info-header p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.form-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
}
.form-group label .req {
  color: #ef4444;
  margin-left: 3px;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Tarjeta de estado de archivo idéntica a la imagen de referencia */
.file-upload-status-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
}

.file-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.file-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.file-status-icon-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.file-status-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.file-status-size {
  font-size: 0.78rem;
  color: #64748b;
  flex-shrink: 0;
}

.file-status-remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.file-status-remove:hover {
  color: #ef4444;
  background: #fee2e2;
}

.file-status-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.file-status-progress {
  height: 100%;
  background: linear-gradient(90deg, #0b5cab 0%, #0284c7 100%);
  border-radius: 9999px;
}

.file-upload-empty-hint {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modern-consent {
  margin-top: 4px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #edf2f7;
  font-size: 0.78rem;
  line-height: 1.45;
}
.modern-consent a {
  color: #0b5cab;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.15s ease;
}
.modern-consent a:hover {
  color: #0284c7;
}

/* Cloudflare Turnstile CAPTCHA */
.turnstile-wrapper {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
  width: 100%;
}

.cf-turnstile-slot {
  display: flex;
  justify-content: center;
}

.turnstile-notice-box {
  margin-top: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  color: #166534;
  line-height: 1.45;
  text-align: left;
}

.turnstile-notice-box code {
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: #14532d;
}

.turnstile-notice-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.modern-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.pill-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 6px;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.preview { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; }

.btn {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #0b5cab;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s;
}
.btn:hover:not(:disabled) { background: #094a8c; }
.btn:disabled { background: #a9bdd1; cursor: not-allowed; }

.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result h2 { font-size: 1.1rem; margin-bottom: 14px; color: #0b5cab; }
.row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #eef2f6;
}
.row span { color: #6b7c8f; }
.bar { height: 8px; background: #e6edf4; border-radius: 4px; margin-top: 16px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: #1fa971; transition: width .5s; }

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  color: #1e293b;
}

.error { margin-top: 14px; color: #c0392b; background: #fdecea; padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; }

.hidden { display: none !important; }

/* ---- ETAPA 2: HUB CIRCULAR DE ANÁLISIS (LAYOUT DE 2 COLUMNAS) ---- */
.hub-card {
  max-width: 1380px;
  margin: 0 auto;
  text-align: left;
  padding: 20px 28px;
}

.hub-layout-columns {
  display: grid;
  grid-template-columns: minmax(560px, 590px) 1fr;
  gap: 36px;
  align-items: center;
}

.hub-stage-column {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-details-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hub-side-header h2 {
  font-size: 1.85rem;
  color: #0b5cab;
  margin: 0 0 6px 0;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hub-side-header p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 22px 0;
}

/* Escenario Circular Orbital con Radiografía Central Gigante */
.circular-stage {
  position: relative;
  width: 580px;
  height: 580px;
  margin: 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Núcleo Central: Marco Circular Verde y Radiografía Gigante */
.stage-center-wrapper {
  position: relative;
  width: 350px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stage-center-wrapper:hover {
  transform: scale(1.02);
}

.stage-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}

.stage-center {
  position: relative;
  width: 318px;
  height: 318px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 5px rgba(224, 242, 254, 0.75), 0 16px 36px rgba(11, 92, 171, 0.25);
  z-index: 5;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stage-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.stage-center-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 92, 171, 0.68);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  border-radius: 50%;
  z-index: 8;
}

.stage-center-wrapper:hover .stage-center-hover-overlay {
  opacity: 1;
}

.pulse-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: pulseEffect 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pulseEffect {
  0% { transform: scale(0.98); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Nodos Orbitales Circulares con Soporte de Preview Grad-CAM */
.orbit-node {
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #bae6fd;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  z-index: 15;
  text-align: center;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.orbit-node.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.2) !important;
}

.orbit-node.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: popInNode 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.orbit-node.has-gradcam {
  border-color: #34d399;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.orbit-node:hover {
  transform: scale(1.12);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.32);
  border-color: #0284c7;
}

.orbit-node.has-gradcam:hover {
  border-color: #10b981;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
  transform: scale(1.12);
}

.orbit-node:active {
  transform: scale(0.95);
}

/* Contenido interior del nodo */
.node-inner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  user-select: none;
}

.node-title {
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0369a1;
  text-align: center;
  transition: all 0.25s ease;
}

.orbit-node.has-gradcam .node-title {
  font-size: 0.64rem;
  line-height: 1.15;
  color: #0f172a;
  max-width: 95px;
}

/* Miniatura Grad-CAM que brota con efecto POP */
.gradcam-pop-thumb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55), inset 0 0 4px rgba(0,0,0,0.3);
  margin-bottom: 3px;
  position: relative;
  background: #000;
  flex-shrink: 0;
  animation: popGradcam 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.gradcam-pop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Badge de confirmación en el nodo */
.node-check-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.6);
  animation: popBadge 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 12;
}

@keyframes popBadge {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes popGradcam {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-22deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.24) rotate(4deg);
  }
  80% {
    transform: scale(0.92) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes popInNode {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-20deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@media (max-width: 520px) {
  .orbit-node {
    width: 82px;
    height: 82px;
    padding: 4px;
  }
  .gradcam-pop-thumb {
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
  }
  .node-title {
    font-size: 0.64rem;
    line-height: 1.15;
  }
  .orbit-node.has-gradcam .node-title {
    font-size: 0.54rem;
    line-height: 1.1;
  }
  .node-check-badge {
    width: 14px;
    height: 14px;
    font-size: 9px;
    top: -2px;
    right: -2px;
  }
}

/* Posiciones Circulares de los Nodos Orbitales (sobrelapando sutilmente la radiografía central) */
.node-1 {
  top: 37px;
  left: 50%;
  margin-left: -58px;
}
.node-2 {
  top: 172px;
  right: 47px;
}
.node-3 {
  bottom: 74px;
  right: 117px;
}
.node-4 {
  bottom: 74px;
  left: 117px;
}
.node-5 {
  top: 172px;
  left: 47px;
}

/* Lista Dinámica de Diagnósticos Progresivos */
.live-diagnostics-container {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 30px;
  min-height: 270px;
}

.diagnostic-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.diagnostic-card-item.is-complete {
  border-left: 4px solid #10b981;
  cursor: pointer;
}

.diagnostic-card-item.is-complete:hover {
  transform: translateX(4px);
  border-color: #0284c7;
  border-left-color: #10b981;
  box-shadow: 0 6px 18px rgba(11, 92, 171, 0.12);
  background: #f8fafc;
}

.diagnostic-card-item.is-analyzing {
  border-left: 4px solid #38bdf8;
  background: #f8fafc;
  border-style: dashed;
}

.diag-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.diag-category-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #0f172a;
}

.diag-divider {
  font-weight: 700;
  color: #64748b;
  margin-right: 2px;
}

.diag-class-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: #0b5cab;
}

.diagnostic-card-item.is-complete:hover .diag-class-value {
  color: #0284c7;
}

.diag-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.diag-loading-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.diag-dots-label {
  font-size: 0.88rem;
  color: #0284c7;
  font-weight: 500;
  font-style: italic;
}

.diag-typing-dot {
  width: 4.5px;
  height: 4.5px;
  background: #0284c7;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.diag-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.diag-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Acciones Inferiores en Columna Derecha */
.hub-side-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.hub-side-footer-actions .btn-circle-back {
  width: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  background: #0f172a;
  color: #ffffff;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  transition: all 0.22s ease;
  flex-shrink: 0;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.hub-side-footer-actions .btn-circle-back:hover {
  background: #1e293b;
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.32);
}

.hub-side-footer-actions .btn-circle-back:active {
  transform: scale(0.95);
}

.hub-side-footer-actions .btn-save-report,
.hub-side-footer-actions .btn-save-patient-history,
.hub-side-footer-actions .btn {
  height: 48px !important;
  max-height: 48px !important;
  padding: 0 22px !important;
  border-radius: 12px !important;
  font-size: 0.94rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  margin: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  gap: 8px;
}

.hub-side-footer-actions .btn-save-patient-history {
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.hub-side-footer-actions .btn-save-patient-history:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8 !important;
}

@media (max-width: 1080px) {
  .hub-layout-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hub-details-column {
    padding: 0 10px;
  }
  .hub-side-header h2,
  .hub-side-header p {
    text-align: center;
  }
  .hub-side-footer-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .circular-stage {
    width: 380px;
    height: 380px;
    margin: 10px auto;
  }
  .stage-center-wrapper {
    width: 230px;
    height: 230px;
  }
  .stage-center {
    width: 208px;
    height: 208px;
  }
  .orbit-node {
    width: 88px;
    height: 88px;
    padding: 5px;
  }
  .gradcam-pop-thumb {
    width: 38px;
    height: 38px;
    margin-bottom: 2px;
  }
  .node-title {
    font-size: 0.65rem;
    line-height: 1.15;
  }
  .orbit-node.has-gradcam .node-title {
    font-size: 0.55rem;
    line-height: 1.1;
  }
  .node-check-badge {
    width: 15px;
    height: 15px;
    font-size: 10px;
    top: -2px;
    right: -2px;
  }
  .node-1 { top: 24px; left: 50%; margin-left: -44px; }
  .node-2 { top: 112px; right: 30px; }
  .node-3 { bottom: 48px; right: 76px; }
  .node-4 { bottom: 48px; left: 76px; }
  .node-5 { top: 112px; left: 30px; }
}

@media (max-width: 420px) {
  .circular-stage {
    width: 310px;
    height: 310px;
    margin: 10px auto;
  }
  .stage-center-wrapper {
    width: 186px;
    height: 186px;
  }
  .stage-center {
    width: 168px;
    height: 168px;
  }
  .orbit-node {
    width: 72px;
    height: 72px;
    padding: 3px;
  }
  .gradcam-pop-thumb {
    width: 30px;
    height: 30px;
    margin-bottom: 1px;
  }
  .node-title { font-size: 0.56rem; line-height: 1.1; }
  .orbit-node.has-gradcam .node-title { font-size: 0.48rem; line-height: 1.05; }
  .node-1 { top: 20px; left: 50%; margin-left: -36px; }
  .node-2 { top: 92px; right: 24px; }
  .node-3 { bottom: 39px; right: 62px; }
  .node-4 { bottom: 39px; left: 62px; }
  .node-5 { top: 92px; left: 24px; }
}
.btn-save-report {
  background: linear-gradient(135deg, #0b5cab 0%, #0284c7 100%);
  color: #ffffff !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: all 0.25s ease;
  cursor: pointer;
}
.btn-save-report:hover:not(:disabled) {
  background: linear-gradient(135deg, #094a8a 0%, #0369a1 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}
.btn-save-report:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ---- MODAL CLÍNICO DE CARGA Y GRAD-CAM ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: modalEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 16px; right: 18px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close-btn:hover { color: #0f172a; }

/* Vista 1: Spinner dentro del Modal */
.modal-loading-state {
  text-align: center;
  padding: 40px 16px;
}

.clinical-spinner {
  width: 58px;
  height: 58px;
  border: 5px solid #e0f2fe;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  margin: 0 auto 20px;
}

.modal-loading-state h3 {
  color: #0b5cab;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.modal-loading-state p {
  color: #64748b;
  font-size: 0.9rem;
}

/* Vista 2: Resultados y Grad-CAM */
.modal-badge-status {
  display: inline-block;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

#modalResultTitle {
  font-size: 1.4rem;
  color: #0f172a;
  margin-bottom: 18px;
}

.result-highlight-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 22px;
}

.res-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.res-label { color: #64748b; font-size: 0.92rem; }
.res-value { color: #0b5cab; font-size: 1.05rem; }

/* Comparador de Imágenes Original vs Grad-CAM */
.gradcam-comparison-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 560px) {
  .gradcam-comparison-box {
    grid-template-columns: 1fr;
  }
}

.cam-box h4 {
  font-size: 0.82rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.img-wrapper {
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid #cbd5e1;
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cam-legend {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 0.68rem;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
  backdrop-filter: blur(2px);
}

.modal-disclaimer {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid #0284c7;
  margin-bottom: 20px;
}

.modal-actions .btn {
  margin-top: 0;
}

/* ---- MODAL VISUALIZADOR DE RADIOGRAFÍA ORIGINAL ---- */
.original-viewer-overlay {
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.5vw, 24px);
}

.original-viewer-card {
  max-width: 900px;
  width: 96%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
  position: relative;
  overflow: hidden;
}

.original-viewer-header {
  margin-bottom: 12px;
  text-align: left;
  padding-right: 36px;
}

.original-viewer-header h3 {
  font-size: 1.25rem;
  color: #0b5cab;
  margin: 0 0 6px 0;
  font-weight: 700;
}

.original-viewer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.original-viewer-meta .meta-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #bae6fd;
}

.original-viewer-meta .meta-filename {
  color: #64748b;
  background: #f1f5f9;
  border-color: #cbd5e1;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.original-viewer-img-container {
  flex: 1;
  min-height: 280px;
  max-height: calc(94vh - 165px);
  background: #090d16;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.original-viewer-img-container img {
  max-width: 100%;
  max-height: calc(94vh - 190px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.original-viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.original-viewer-actions .btn {
  width: auto;
  min-width: 110px;
  padding: 8px 18px;
  font-size: 0.9rem;
}

/* ---- Cumplimiento legal ---- */
.ai-notice { background: #fff8e1; border: 1px solid #f0d98a; color: #6b5300; border-radius: 10px; padding: 12px 14px; margin-bottom: 20px; font-size: 0.88rem; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 0.85rem; color: #4a5b6d; line-height: 1.4; }
.consent input { margin-top: 3px; }
.consent a, .footer a { color: #0b5cab; }
/* ---- Footer Institucional Full-Width (Estilo Dark Corporativo) ---- */
.site-footer {
  width: 100%;
  background: #0f172a; /* Slate 900 */
  color: #94a3b8;
  margin-top: 48px;
  padding: 48px max(24px, env(safe-area-inset-right)) max(28px, calc(28px + env(safe-area-inset-bottom))) max(24px, env(safe-area-inset-left));
  border-top: 1px solid #1e293b;
  font-size: 0.88rem;
}

.footer-container {
  max-width: 1140px;
  margin: 0 auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 36px 28px;
  padding-bottom: 36px;
  border-bottom: 1px solid #1e293b;
}

@media (max-width: 860px) {
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 30px 20px;
  }
}

@media (max-width: 520px) {
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

.footer-col h4 {
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-col p {
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.55;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col ul li a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.15s ease;
}

.footer-col ul li a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-security-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 0.76rem;
  margin-top: 4px;
}

.footer-security-note svg {
  color: #10b981;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 24px;
  font-size: 0.78rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #f1f5f9;
}

.legal h1 { text-align: left; margin-bottom: 8px; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 8px; color: #0b5cab; text-align: left; }
.legal p, .legal li { line-height: 1.6; font-size: 0.92rem; margin-bottom: 8px; text-align: justify; text-justify: inter-word; }
.legal ul { padding-left: 20px; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  display: table;
}
.legal th, .legal td { border: 1px solid #e1e8ef; padding: 8px; text-align: left; vertical-align: top; }
.legal th { background: #eef3f8; }

@media (max-width: 640px) {
  .legal table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* ========================================================
   CABECERA UNIVERSAL DE NAVEGACIÓN (HEADER COMPARTIDO)
   ======================================================== */
.site-nav-header {
  position: relative;
  z-index: 100;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.25) 70%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Cabecera ultra semi-transparente sobre la portada oscura (sube con el contenido, no se queda fija) */
.site-nav-header.header-on-dark {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.15) 60%, rgba(15, 23, 42, 0) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.site-nav-header.header-on-dark .nav-link {
  color: #f1f5f9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.site-nav-header.header-on-dark .nav-link:hover,
.site-nav-header.header-on-dark .nav-link.active {
  color: #38bdf8;
}

.site-nav-header.header-on-dark .hamburger-bar {
  background: #ffffff;
}

/* Contenedor que ocupa el ancho de la pantalla con amplia separación */
.nav-container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 22px max(48px, env(safe-area-inset-right)) 22px max(48px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.nav-logo:hover {
  transform: scale(1.02);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 52px;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 44px;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #475569;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
  position: relative;
  padding: 8px 4px;
}

.nav-link:hover {
  color: #0b5cab;
}

.nav-link.active {
  color: #0b5cab;
  font-weight: 700;
}

/* Sin ninguna línea subrayada debajo de enlaces */
.nav-link::after,
.nav-link.active::after,
.site-nav-header.header-on-dark .nav-link.active::after {
  display: none !important;
  content: none !important;
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-right-actions .nav-link {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 8px 4px;
  white-space: nowrap;
}

/* Icono de login: solo la persona, sin círculo ni fondo */
.nav-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 6px;
  color: #334155;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
  text-decoration: none;
}

.nav-login-btn svg {
  display: block;
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.nav-login-btn:hover {
  background: transparent !important;
  color: #0b5cab;
  transform: scale(1.12);
}

.site-nav-header.header-on-dark .nav-login-btn {
  color: #ffffff;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

.site-nav-header.header-on-dark .nav-login-btn:hover {
  background: transparent !important;
  color: #38bdf8;
  border: none !important;
  transform: scale(1.12);
}

.nav-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 105;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
  transition: all 0.25s ease;
}

.nav-mobile-toggle.is-active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle.is-active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-mobile-toggle.is-active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================================
   LANDING PAGE A PANTALLA COMPLETA (INDEX.HTML)
   ======================================================== */
.landing-page-body {
  background: #0f172a;
  color: #ffffff;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Capa de fondo fija permanente: la radiografía permanece fija mientras el contenido pasa por encima */
.landing-page-body .hero-bg-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fullscreen-hero {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: max(112px, calc(env(safe-area-inset-top) + 96px)) 24px 60px;
  background: transparent;
}

/* ========================================================
   FOOTER ULTRA TRANSLÚCIDO FLOTANTE (EXCLUSIVO PARA INDEX.HTML)
   ======================================================== */
.landing-page-body .site-footer {
  position: relative;
  z-index: 2;
  margin-top: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.04) 0%,
    rgba(15, 23, 42, 0.12) 40%,
    rgba(15, 23, 42, 0.22) 100%
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
}

.landing-page-body .footer-columns {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-page-body .site-footer p,
.landing-page-body .site-footer span,
.landing-page-body .site-footer h4,
.landing-page-body .site-footer a {
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}

.landing-page-body .site-footer a {
  color: #e2e8f0;
  transition: color 0.18s ease;
}

.landing-page-body .site-footer a:hover {
  color: #38bdf8;
}

.fullscreen-hero-img,
.fullscreen-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
  border: none;
  outline: none;
  pointer-events: none;
}

.hero-video-loop {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 1;
  filter: blur(0px);
  transform: scale(1);
  transition: filter 0.9s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: filter, transform;
}

/* Difuminado suave cuando el bucle recomienza */
.hero-video-loop.is-looping-blur {
  filter: blur(12px);
  transform: scale(1.03);
}

.hero-video-intro {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1;
  filter: blur(0px);
  transform: scale(1);
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1),
              filter 1.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, filter, transform;
}

/* Transición difuminada hacia el bucle */
.hero-video-intro.is-faded {
  opacity: 0;
  filter: blur(16px);
  transform: scale(1.04);
  pointer-events: none;
}

.hero-vignette-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.94) 0%,
    rgba(15, 23, 42, 0.85) 40%,
    rgba(15, 23, 42, 0.42) 70%,
    rgba(15, 23, 42, 0.15) 100%
  );
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.fullscreen-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero-text-block {
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-brand-block {
  margin-bottom: 24px;
}

.hero-brand-block .hero-brand-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

.hero-text-block h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 30px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.hero-cta-action {
  margin-top: 6px;
}

.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b5cab;
  color: #ffffff !important;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 44px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(11, 92, 171, 0.55);
  transition: all 0.22s ease;
  min-height: 54px;
}

.btn-hero-cta:hover {
  background: #094a8c;
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(11, 92, 171, 0.7);
}

/* Estilos de Analizador Header */
.analyzer-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.analyzer-header {
  text-align: center;
  margin-bottom: 22px;
}

.analyzer-header h1 {
  font-size: 1.75rem;
  color: #0b5cab;
  margin-bottom: 6px;
}

/* ========================================================
   ADAPTACIONES RESPONSIVAS PARA MÓVILES (SAFARI IOS & ANDROID)
   ======================================================== */
@media (max-width: 960px) {
  .nav-container {
    padding: 18px 28px;
  }
  .nav-menu {
    gap: 36px;
  }
  .nav-list {
    gap: 28px;
  }
  .hero-text-block h2 {
    font-size: 2.1rem;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 12px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  }
  .nav-logo {
    height: 32px;
  }
  .nav-right-actions {
    gap: 16px;
  }
  .nav-right-actions .nav-link {
    font-size: 0.95rem;
    padding: 6px 2px;
  }
  .nav-login-btn svg {
    width: 22px;
    height: 22px;
  }
  .nav-mobile-toggle {
    display: none !important;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    padding: 24px 20px 30px;
    gap: 22px;
    border: none !important;
    border-bottom: none !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 999;
  }
  .site-nav-header.header-on-light .nav-menu {
    background: rgba(255, 255, 255, 0.98);
    border: none !important;
    border-bottom: none !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  }
  .site-nav-header.header-on-light .nav-link {
    color: #0f172a;
  }
  .nav-menu.is-open {
    display: flex;
  }
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }
  .nav-link {
    font-size: 1.15rem;
    padding: 10px 0;
    width: 100%;
  }
  .fullscreen-hero {
    padding: max(80px, calc(env(safe-area-inset-top) + 60px)) 20px max(44px, env(safe-area-inset-bottom));
  }
  .hero-vignette-overlay {
    background: linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.92) 0%,
      rgba(15, 23, 42, 0.8) 45%,
      rgba(15, 23, 42, 0.96) 100%
    );
  }
  .hero-text-block h2 {
    font-size: clamp(1.65rem, 5.8vw, 2.15rem);
    line-height: 1.25;
    margin-bottom: 24px;
  }
  .hero-brand-block .hero-brand-logo {
    height: 42px;
  }
  .btn-hero-cta {
    width: 100%;
    max-width: 360px;
    text-align: center;
    padding: 15px 24px;
    font-size: 1.1rem;
  }
}

