/* ===========================
   🎛️ VARIABLES + THEME
=========================== */
:root {
  --brand: #0f62fe;
  /* azul primario */
  --brand-2: #0043ce;
  /* azul oscuro */
  --bg: #f4f6f9;
  /* fondo app */
  --card: #ffffff;
  /* fondo cards */
  --ink: #1f2937;
  /* texto principal */
  --muted: #6b7280;
  /* texto secundario */
  --ring: rgba(15, 98, 254, .25);
  /* focus ring */
  --radius: 12px;
  --gap: 14px;
}

/* ===========================
   🎨 ESTILOS GENERALES
=========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2 {
  color: #2c3e50;
  margin-top: 0;
}

.hidden {
  display: none !important;
}

/* ===========================
   📌 SIDEBAR (DESKTOP)
=========================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background-color: #004080;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  transition: all 0.3s ease-in-out;
  z-index: 1000;
}

.sidebar h2 {
  color: white;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.sidebar button,
.sidebar .logout-btn {
  width: 85%;
  margin: 0.4rem 0;
  padding: 0.7rem;
  border: none;
  background: #0059b3;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
  transition: background 0.25s, transform .05s ease-in-out, box-shadow .15s;
}

.sidebar button:hover,
.sidebar .logout-btn:hover {
  background: #003e80;
}

.sidebar button:focus-visible,
.sidebar .logout-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .25);
}

.sidebar button:active,
.sidebar .logout-btn:active {
  transform: translateY(1px);
}

.logout-btn {
  text-decoration: none;
}

/* ===========================
   📌 CONTENIDO PRINCIPAL
=========================== */
.content {
  margin-left: 240px;
  /* espacio para el sidebar */
  padding: 2rem;
  max-width: 1100px;
}

.section {
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
  margin-bottom: 1.25rem;
}

/* Headers de sección (título bien pegado, sin colapso) */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 .75rem 0;
  /* evita que el label 'salte' hacia arriba */
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.section-sub {
  margin-left: auto;
  font-size: .9rem;
  color: var(--muted);
}

/* ===========================
   📊 TABLA PRINCIPAL (LISTADOS)
   + versión responsive a cards
=========================== */
.table-test {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  /* ← necesario para radius */
  border-spacing: 0;
  /* ← sin espacios entre celdas */
  margin: 1rem auto;
  background: #f9f9f9;
  border-radius: 10px;
  /* ← esquinas redondeadas */
  overflow: hidden;
  /* ← oculta las esquinas internas */
}

.table-test th,
.table-test td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
}

.table-test th {
  background-color: #eaf1ff;
  color: #333;
  font-weight: 700;
}

/* ===========================
   ✅ Botones
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.52rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  transition: transform .05s, box-shadow .15s, background .2s, border .2s;
}

.btn:hover {
  background: #1c4ffd;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.btn-continue {
  background: #3498db;
  color: #fff;
}

.btn-continue:hover {
  background: #2c80b4;
}

.btn-send {
  background: #27ae60;
  color: #fff;
}

.btn-send:hover {
  background: #1f8f4d;
}

.btn.sec {
  background: #fff;
  color: var(--ink);
  border-color: #e5e7eb;
}

.btn.small {
  padding: .35rem .6rem;
  font-size: .82rem;
}

/* ===========================
   🧭 Toolbar / filtros / búsqueda
=========================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}

.chip.ok {
  background: #ecfdf5;
  color: #047857;
}

.chip.warn {
  background: #fff7ed;
  color: #c2410c;
}

.chip.todo {
  background: #eef2ff;
  color: #3730a3;
}

.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}

.search input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 10px 38px 10px 14px;
  background: #fff;
}

.search .clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #9ca3af;
}

/* ===========================
   📝 FORMULARIO (compacto y legible)
=========================== */
form {
  max-width: 900px;
  margin: auto;
  background: var(--card);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

/* fieldset/legend → visual de card */
fieldset {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #fff;
}

legend {
  font-weight: 700;
  font-size: 1rem;
  color: #004080;
  padding: 0 .4rem;
}

/* 🔧 Labels pegados a su input (evita el "salto hacia arriba") */
label {
  display: inline-block;
  margin: 0 0 .35rem 0;
  /* << clave: NO margin-top */
  font-weight: 600;
  line-height: 1.2;
  /* << clave: compacta */
  color: var(--ink);
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border .15s, box-shadow .15s, background .2s;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Ayudas/errores bajo campo */
.hint {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .3rem;
}

.hint.error {
  color: #b91c1c;
}

/* Grupos y grids responsivos */
.field-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}

@media (min-width: 720px) {
  .form-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid.cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Cámara / adjuntos */
.camera-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  background-color: #0077cc;
  color: white;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 0, 0, .05);
  transition: background .2s, transform .05s;
}

.camera-label:hover {
  background-color: #005fa3;
}

.camera-label:active {
  transform: translateY(1px);
}

.camera-label .attach-text {
  font-size: 0.75rem;
  color: #dbeafe;
}

/* ===========================
   ✅ TABLA DE RESULTADOS (test)
   + modo cards en móvil
=========================== */
.test-table {
  width: 100%;
  border-collapse: separate;
  /* ← para radius */
  border-spacing: 0;
  margin-top: 1rem;
  table-layout: fixed;
  font-size: 0.9rem;
  border-radius: 10px;
  /* ← redondeado visible */
  overflow: hidden;
  /* ← oculta esquinas internas */
}

.test-table th,
.test-table td {
  border: 1px solid #e5e7eb;
  padding: 0.6rem;
  text-align: center;
  /* centrado de valores */
  vertical-align: middle;
  word-wrap: break-word;
}

.test-table th {
  background-color: #f2f6ff;
  font-weight: 700;
}

/* Inputs dentro de la tabla */
.test-table input[type="text"],
.test-table input[type="number"],
.test-table select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  font-size: 0.86rem;
  border-radius: 8px;
}

/* Botón N/A modernizado */
.na-btn {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
  padding: .35rem .55rem;
  cursor: pointer;
  font-size: 0.8rem;
  margin-bottom: 4px;
  border-radius: 8px;
  transition: background .2s, border-color .2s, color .2s;
}

.na-btn:hover {
  background: #eef2f7;
}

.na-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ===========================
   🧷 Sticky actions (guardar/enviar)
=========================== */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, transparent, rgba(245, 247, 251, .92) 30%);
  padding-top: 10px;
  margin-top: 10px;
}

/* ===========================
   📱 RESPONSIVE: SIDEBAR Y FORMULARIO
=========================== */
.hamburger {
  display: none;
}

@media (max-width: 1024px) {
  .content {
    margin-left: 0;
    padding: 1rem;
    max-width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -220px;
    width: 220px;
    z-index: 1200;
    height: 100vh;
    transition: left 0.3s ease-in-out;
  }

  .sidebar.active {
    left: 0;
  }

  .hamburger {
    display: block;
    position: fixed;
    top: 15px;
    right: 15px;
    background: #004080;
    color: white;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1300;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.9rem;
  }

  .content,
  form,
  .section {
    max-width: 100%;
    margin: 0;
    padding: 1rem;
  }

  fieldset {
    width: 100%;
    padding: 0.8rem;
  }

  /* ✅ Tabla de resultados como cards */
  .test-table,
  .test-table thead,
  .test-table tbody,
  .test-table th,
  .test-table td,
  .test-table tr {
    display: block;
    width: 100%;
  }

  .test-table thead {
    display: none;
  }

  .test-table tr {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .05);
  }

  .test-table td {
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 6px;
    text-align: left;
  }

  .test-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 1;
    padding-right: 10px;
  }

  /* 📊 Tabla principal del dashboard como cards también */
  .table-test,
  .table-test thead,
  .table-test tbody,
  .table-test th,
  .table-test td,
  .table-test tr {
    display: block;
    width: 100%;
  }

  .table-test thead {
    display: none;
  }

  .table-test tr {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .05);
  }

  .table-test td {
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 6px;
    text-align: left;
  }

  .table-test td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 1;
    padding-right: 10px;
  }

  .toolbar {
    gap: 8px;
  }

  .search {
    flex: 1 1 100%;
  }
}

/* ===========================
   🔬 UTILIDADES PEQUEÑAS
=========================== */
.mt-0 {
  margin-top: 0 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: .25rem !important;
}

.mb-2 {
  margin-bottom: .5rem !important;
}

.mb-3 {
  margin-bottom: .75rem !important;
}

.text-muted {
  color: var(--muted) !important;
}

.w-100 {
  width: 100% !important;
}

/* =========================================================
   ✨ AÑADIDOS LANDING (UX/UI público) — no afectan el panel
========================================================= */
.landing-body {
  background: #fff;
  color: var(--ink);
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.section--alt {
  background: #f7f8fb;
}

.section--spacious {
  padding: 3.25rem 0;
}

.section-head {
  margin-bottom: 1rem;
}

/* Header público */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .04);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.main-nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--brand-2);
}

.main-nav .is-active a {
  color: var(--brand-2);
}

.header-cta {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 6px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin: 6px 0;
}

/* Hero / Slider */
.hero {
  padding: 0;
  background: linear-gradient(180deg, #fff, #f9fafb);
}

.slider {
  position: relative;
  overflow: hidden;
}

.slide {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  align-items: center;
  min-height: 68vh;
  padding: 48px 0;
  opacity: 0;
  transform: translateX(8%);
  transition: opacity .5s ease, transform .5s ease;
}

.slide.is-active {
  opacity: 1;
  transform: none;
}

.hero-title {
  margin: .2em 0 .4em;
  font-size: clamp(1.6rem, 1.2vw + 1.2rem, 2.2rem);
}

.lead {
  font-size: clamp(1.02rem, .6vw + 1rem, 1.18rem);
  color: var(--ink);
  max-width: 60ch;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.slide-visual {
  height: 48vh;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
  background-size: cover;
  background-position: center;
}

.slide-1 {
  background-image: linear-gradient(135deg, rgba(15, 98, 254, .1), rgba(0, 67, 206, .1)), url('/static/img/hero-1.jpg');
}

.slide-2 {
  background-image: linear-gradient(135deg, rgba(15, 98, 254, .1), rgba(0, 67, 206, .1)), url('/static/img/hero-2.jpg');
}

.slide-3 {
  background-image: linear-gradient(135deg, rgba(15, 98, 254, .1), rgba(0, 67, 206, .1)), url('/static/img/hero-3.jpg');
}

/* Controles slider */
.slider-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 5;
}

.slider-controls .prev,
.slider-controls .next {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.slider-controls .prev:hover,
.slider-controls .next:hover {
  background: rgba(0, 0, 0, 0.7);
}

.slider-controls .slider-dots {
  display: flex;
  gap: 8px;
}

.slider-controls .slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #d1d5db;
  cursor: pointer;
  transition: background .2s;
}

.slider-controls .slider-dots button[aria-current="true"] {
  background: #0f62fe;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 14px;
}

.feature-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .06);
}

.feature-card h3 {
  margin: .4rem 0 .35rem;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-weight: 900;
  color: #fff;
  background: var(--brand-2);
}

/* CTA Banner */
.cta-banner {
  margin-top: 28px;
  padding: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 98, 254, .08), rgba(0, 67, 206, .08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cta-banner .cta-text h3 {
  margin: 0 0 6px;
}

/* Sponsors */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  align-items: center;
}

.sponsor {
  background: #fff;
  border: 1px dashed #d7ddea;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 82px;
  transition: transform .15s, box-shadow .2s;
}

.sponsor img {
  max-height: 40px;
  width: auto;
  opacity: .85;
  filter: grayscale(100%) contrast(1.2);
}

.sponsor:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .12);
}

.sponsor:hover img {
  filter: none;
  opacity: 1;
}

/* Contacto / Signup */
.contact-wrap {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
}

.contact-form {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .06);
}

.contact-side {
  align-self: start;
}

.contact-side h3 {
  margin-top: 0;
}

.contact-side ul {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.contact-side li+li {
  margin-top: 6px;
}

.small {
  font-size: .9rem;
}

.signup-form {
  max-width: 720px;
}

/* Footer */
.site-footer {
  margin-top: 36px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.footer-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.footer-brand img {
  height: 24px;
  width: auto;
}

/* Responsive landing */
@media (max-width: 980px) {
  .slide {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .slide-visual {
    height: 38vh;
  }

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

  .sponsor-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
  }

  .main-nav.is-open {
    display: block;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
  }

  .main-nav.is-open ul {
    flex-direction: column;
    padding: 12px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .header-cta {
    display: none;
  }

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

  .sponsor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


.slider {
  position: relative;
}

.slide {
  opacity: 0;
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}