/* ==========================================================================
   PIAR - Programación, Inteligencia Artificial y Robótica
   SISTEMA DE DISEÑO VISUAL: LABORATORIO ROBÓTICO FUTURISTA
   Estética: Blanco tecnológico · Gris frío · Azul técnico · Acentos cian sutiles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS Y VARIABLES DE DISEÑO
   -------------------------------------------------------------------------- */
:root {
  /* Superficies y materiales */
  --bg-page: #f5f8fc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-panel: #f8fafc;
  --bg-surface-subtle: #f0f4f9;
  --bg-surface-hover: #fbfdff;

  /* Bordes de ensamblaje robótico */
  --border-subtle: #e2e8f0;
  --border-tech: #cbd8e6;
  --border-strong: #94a3b8;
  --border-accent: rgba(6, 182, 212, 0.45);
  --border-glow: rgba(34, 211, 238, 0.65);

  /* Paleta cromática: Azul tecnológico & Cian de acento */
  --blue-primary: #0284c7;
  --blue-primary-hover: #0369a1;
  --blue-deep: #0369a1;
  --blue-dark: #0c4a6e;
  --blue-tint: rgba(2, 132, 199, 0.08);

  --cyan-core: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-tint: rgba(6, 182, 212, 0.12);
  --cyan-glow: rgba(6, 182, 212, 0.28);
  --cyan-halo: 0 0 12px rgba(6, 182, 212, 0.25);

  /* Texto de alta legibilidad (Azul grafito / marino oscuro) */
  --text-main: #0f1d2e;
  --text-muted: #3a4d63;
  --text-light: #62778f;
  --text-inverse: #ffffff;

  /* Colores de estado refinados (sin saturaciones agresivas) */
  --state-prog-bg: #edf5fc;
  --state-prog-text: #0284c7;
  --state-prog-border: #bfdbfe;

  --state-ai-bg: #f1f4fd;
  --state-ai-text: #4338ca;
  --state-ai-border: #c7d2fe;

  --state-robotics-bg: #ecfdf8;
  --state-robotics-text: #0f766e;
  --state-robotics-border: #99f6e4;

  --state-scratch-bg: #f6f8fb;
  --state-scratch-text: #0369a1;
  --state-scratch-border: #bae6fd;

  --state-success-bg: #f0fdf4;
  --state-success-text: #166534;
  --state-success-border: #86efac;

  --state-alert-bg: #fff1f2;
  --state-alert-text: #9f1239;
  --state-alert-border: #fecdd3;

  /* Sombras y halos de iluminación sutil */
  --shadow-sm: 0 1px 3px rgba(15, 29, 46, 0.04), 0 0 0 1px var(--border-subtle);
  --shadow-md: 0 3px 8px -1px rgba(15, 29, 46, 0.05), 0 0 0 1px var(--border-subtle);
  --shadow-lg: 0 6px 18px -3px rgba(15, 29, 46, 0.07), 0 0 0 1px var(--border-tech);
  --shadow-glow: 0 6px 20px -3px rgba(2, 132, 199, 0.12), 0 0 0 1px rgba(6, 182, 212, 0.45), 0 0 14px rgba(6, 182, 212, 0.16);

  /* Radios de curvatura de piezas */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transición suave e interactiva */
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. RESETEO Y FONDO DEL LABORATORIO
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  /* Patrón de cuadrícula técnica milimétrica casi imperceptible */
  background-image:
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.07) 0%, transparent 55%),
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--cyan-core);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   3. CABECERA Y NAVEGACIÓN (PANEL SUPERIOR)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(15, 29, 46, 0.03), 0 1px 0 rgba(6, 182, 212, 0.12);
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-logo:hover {
  color: var(--text-main);
  text-decoration: none;
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28), 0 0 10px rgba(6, 182, 212, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-badge::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 6px #ffffff;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  display: block;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--blue-deep);
  background-color: var(--bg-surface-subtle);
  border-color: var(--border-tech);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.12);
  text-decoration: none;
}

.nav-link.active {
  color: var(--blue-deep);
  background-color: #eef6fc;
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.08), 0 0 8px rgba(6, 182, 212, 0.15);
}

.nav-link-badge {
  font-size: 0.68rem;
  background-color: rgba(6, 182, 212, 0.12);
  color: var(--blue-deep);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* --------------------------------------------------------------------------
   4. LAYOUT GENERAL Y BREADCRUMB
   -------------------------------------------------------------------------- */
.page-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--blue-primary);
  text-decoration: none;
}

.breadcrumb-separator {
  color: var(--border-strong);
  font-size: 0.75rem;
  opacity: 0.6;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
  background: rgba(2, 132, 199, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

/* --------------------------------------------------------------------------
   5. HERO BANNERS (MÓDULO DE MANDO)
   -------------------------------------------------------------------------- */
.hero-banner {
  background: linear-gradient(135deg, #0a192f 0%, #0e2744 55%, #13385e 100%) !important;
  color: #ffffff !important;
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 8px 24px -4px rgba(10, 25, 47, 0.25), 0 0 20px rgba(6, 182, 212, 0.14);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--cyan-light) 50%, transparent 95%);
  box-shadow: 0 0 8px var(--cyan-light);
  z-index: 2;
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(2, 132, 199, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  max-width: 760px;
  position: relative;
  z-index: 3;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.hero-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 6px #22d3ee;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 0.98rem;
  line-height: 1.5;
  color: #cbd8e6;
  margin-bottom: 1.35rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   6. BOTONES (CONTROLES ROBÓTICOS COMPACTOS)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.3;
}

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

.btn-primary {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35), 0 0 10px rgba(34, 211, 238, 0.35) !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.hero-banner .btn-primary {
  background: #ffffff !important;
  color: #0369a1 !important;
  border: 1px solid #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 12px rgba(6, 182, 212, 0.3) !important;
}

.hero-banner .btn-primary:hover {
  background: #f0f7ff !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), 0 0 16px rgba(6, 182, 212, 0.45) !important;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  backdrop-filter: blur(6px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border-color: rgba(34, 211, 238, 0.5) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-scratch {
  background: linear-gradient(180deg, #0891b2 0%, #0e7490 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(34, 211, 238, 0.45) !important;
  box-shadow: 0 2px 6px rgba(8, 145, 178, 0.25);
}

.btn-scratch:hover {
  background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35), 0 0 12px rgba(34, 211, 238, 0.35) !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-outline {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-tech) !important;
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--bg-surface-hover) !important;
  border-color: var(--cyan-core) !important;
  color: var(--blue-deep) !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2) !important;
  transform: translateY(-1px);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   7. SECCIÓN DESTACADA Y CONTENEDORES CON ESTILOS INLINE
   -------------------------------------------------------------------------- */
section > div[style*="fef3c7"],
section > div[style*="background: linear-gradient(135deg, #fef3c7"] {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fc 100%) !important;
  border: 1px solid var(--border-tech) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.5rem !important;
  box-shadow: 0 3px 12px -2px rgba(15, 29, 46, 0.05), 0 0 0 1px rgba(6, 182, 212, 0.2), 0 0 14px rgba(6, 182, 212, 0.08) !important;
  position: relative;
  overflow: hidden;
}

section > div[style*="fef3c7"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 10%, var(--cyan-light) 50%, transparent 90%);
}

section > div[style*="fef3c7"] h2 {
  color: var(--text-main) !important;
  font-size: 1.35rem !important;
}

section > div[style*="fef3c7"] p {
  color: var(--text-muted) !important;
  font-size: 0.92rem !important;
}

section > div[style*="fef3c7"] div[style*="fde68a"] {
  background: rgba(6, 182, 212, 0.1) !important;
  color: var(--blue-deep) !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

section[style*="eff6ff"] {
  background: linear-gradient(180deg, #f8fbfe 0%, #f0f6fc 100%) !important;
  border: 1px solid var(--border-tech) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm), 0 0 12px rgba(6, 182, 212, 0.08) !important;
}

section[style*="eff6ff"] h3 {
  color: var(--text-main) !important;
}

/* --------------------------------------------------------------------------
   8. GRILLAS Y TARJETAS (PANELES MODULARES ROBÓTICOS)
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  background-color: var(--bg-surface-hover);
}

.card:hover::before {
  background: linear-gradient(90deg, transparent, var(--cyan-light), transparent);
}

/* Badges superiores */
.card-badge-top {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, monospace;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid transparent;
}

.card-badge-top::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 5px currentColor;
}

.badge-prog {
  background-color: var(--state-prog-bg);
  color: var(--state-prog-text);
  border-color: var(--state-prog-border);
}

.badge-ai {
  background-color: var(--state-ai-bg);
  color: var(--state-ai-text);
  border-color: var(--state-ai-border);
}

.badge-robotics {
  background-color: var(--state-robotics-bg);
  color: var(--state-robotics-text);
  border-color: var(--state-robotics-border);
}

.badge-scratch {
  background-color: var(--state-scratch-bg);
  color: var(--state-scratch-text);
  border-color: var(--state-scratch-border);
}

/* Iconos de tarjeta: Lentes ópticos / Sensores */
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
  background: var(--bg-surface-subtle) !important;
  border: 1px solid var(--border-tech);
  color: var(--blue-deep) !important;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 0 8px rgba(6, 182, 212, 0.1);
  transition: var(--transition);
}

.card:hover .card-icon {
  border-color: var(--cyan-core);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 0 10px rgba(6, 182, 212, 0.3);
  transform: scale(1.04);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.15rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   9. CALLOUTS / ALERTAS (PANELES DIAGNÓSTICOS)
   -------------------------------------------------------------------------- */
.callout {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--blue-primary);
  background-color: var(--bg-surface-panel);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.callout-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.callout-content {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* REQUERIMIENTO EXPLÍCITO: el .callout-content strong no debe ser display:block */
.callout-content strong {
  display: inline;
  margin-bottom: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.callout-tip {
  background-color: #f7fcfb;
  border-color: #ccfbf1;
  border-left-color: #0d9488;
}
.callout-tip .callout-icon { color: #0f766e; }

.callout-info {
  background-color: #f6fafd;
  border-color: #dbeafe;
  border-left-color: #0284c7;
}
.callout-info .callout-icon { color: #0284c7; }

.callout-warning {
  background-color: #fdfaf6;
  border-color: #fed7aa;
  border-left-color: #ea580c;
}
.callout-warning .callout-icon { color: #c2410c; }

.callout-challenge {
  background-color: #f9f8fe;
  border-color: #e0e7ff;
  border-left-color: #6366f1;
}
.callout-challenge .callout-icon { color: #4f46e5; }

/* --------------------------------------------------------------------------
   10. PASOS Y MISIONES (DESCOMPOSICIÓN TÉCNICA)
   -------------------------------------------------------------------------- */
.step-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin: 1.35rem 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--border-tech);
  box-shadow: var(--shadow-md), 0 0 10px rgba(6, 182, 212, 0.08);
}

.step-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3), 0 0 8px rgba(6, 182, 212, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.step-explanation {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

/* --------------------------------------------------------------------------
   11. ACORDEONES (COMPUERTAS DE INSPECCIÓN)
   -------------------------------------------------------------------------- */
.accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 0.85rem 0;
  background-color: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.accordion:hover {
  border-color: var(--border-tech);
}

.accordion-header {
  padding: 0.75rem 1rem;
  background-color: var(--bg-surface-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.accordion-header:hover {
  background-color: #eaf1f8;
  color: var(--blue-deep);
}

.accordion-content {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  display: none;
  font-size: 0.9rem;
  line-height: 1.55;
  background-color: var(--bg-surface);
}

.accordion.open {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.12);
}

.accordion.open .accordion-header {
  border-bottom-color: var(--border-subtle);
  background-color: #f1f7fc;
  color: var(--blue-deep);
}

.accordion.open .accordion-content {
  display: block;
}

.accordion.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--cyan-core);
}

.accordion-icon {
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

/* --------------------------------------------------------------------------
   12. LAYOUT DEL TUTORIAL Y BARRA LATERAL
   -------------------------------------------------------------------------- */
.tutorial-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.tutorial-sidebar {
  position: sticky;
  top: 4.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.toc-link:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--blue-deep);
  border-left-color: var(--cyan-core);
  text-decoration: none;
}

.toc-link.active {
  background-color: #edf5fc;
  color: var(--blue-deep);
  font-weight: 600;
  border-left-color: var(--blue-primary);
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.12);
}

.tutorial-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tutorial-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.tutorial-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.tutorial-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tutorial-lead {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   13. TEST DE AUTOEVALUACIÓN (DIAGNÓSTICO TÉCNICO)
   -------------------------------------------------------------------------- */
.quiz-container {
  background-color: var(--bg-surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.quiz-question {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.quiz-question:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.quiz-question-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quiz-option {
  text-align: left;
  background-color: #ffffff;
  border: 1px solid var(--border-tech);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(15, 29, 46, 0.03);
}

.quiz-option:hover:not(:disabled) {
  background-color: var(--bg-surface-hover);
  border-color: var(--cyan-core);
  color: var(--blue-deep);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
  transform: translateY(-1px);
}

.quiz-option.correct {
  background-color: var(--state-success-bg) !important;
  border-color: var(--state-success-border) !important;
  color: var(--state-success-text) !important;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2) !important;
}

.quiz-option.incorrect {
  background-color: var(--state-alert-bg) !important;
  border-color: var(--state-alert-border) !important;
  color: var(--state-alert-text) !important;
}

.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
  display: none;
}

.feedback-correct {
  background-color: var(--state-success-bg);
  color: var(--state-success-text);
  border: 1px solid var(--state-success-border);
}

.feedback-incorrect {
  background-color: var(--state-alert-bg);
  color: var(--state-alert-text);
  border: 1px solid var(--state-alert-border);
}

/* --------------------------------------------------------------------------
   14. BLOQUES DE SCRATCH (INTEGRACIÓN EN EL SISTEMA)
   -------------------------------------------------------------------------- */
/* REQUERIMIENTO EXPLÍCITO: al .sb-c-body ponle un padding-left : 0.1rem */
.sb-c-body {
  padding-left: 0.1rem !important;
}

/* --------------------------------------------------------------------------
   15. PIE DE PÁGINA (ESTACIÓN INFERIOR)
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #0b1726;
  color: #8da4be;
  padding: 2.25rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  margin-top: 3.5rem;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--cyan-core) 50%, transparent 90%);
  opacity: 0.6;
}

.footer-container {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-brand h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-light);
  box-shadow: 0 0 6px var(--cyan-light);
}

.footer-brand p {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #7890a8;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.footer-links a {
  color: #8da4be;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #38bdf8;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #647b95;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   16. COMPONENTES DE DESCARGA DE MATERIALES Y ASSETS
   -------------------------------------------------------------------------- */
.asset-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.asset-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.asset-card:hover {
  border-color: var(--cyan-core);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.asset-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-tech);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  padding: 0.4rem;
  font-size: 2rem;
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.asset-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.asset-tag {
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  color: var(--blue-deep);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.65rem;
  display: inline-block;
}

.btn-download-asset {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   17. ACCESIBILIDAD Y MOVIMIENTO REDUCIDO
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   17. RESPONSIVIDAD MÓVIL Y TABLET
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .tutorial-layout {
    grid-template-columns: 1fr;
  }

  .tutorial-sidebar {
    position: static;
    margin-bottom: 1.25rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 680px) {
  .hero-banner {
    padding: 1.75rem 1.25rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .header-container {
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-content {
    padding: 1.25rem;
  }
}
