/* ============================================================
   Plataforma de probadores — LABD Services
   Misma paleta que el sitio (claro predeterminado, oscuro opcional).
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --bg-soft: #eceff4;
  --card: #ffffff;
  --card-2: #f8fafc;
  --border: #e2e7ee;
  --text: #1f2733;
  --text-strong: #0f1723;
  --muted: #5b6675;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --accent: #f97316;
  --ok: #15803d;
  --ok-bg: rgba(21, 128, 61, .10);
  --bad: #b91c1c;
  --bad-bg: rgba(185, 28, 28, .08);
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, .10);
  --tint: rgba(37, 99, 235, .08);
  --header-bg: rgba(255, 255, 255, .92);
  --glow-1: rgba(37, 99, 235, .10);
  --glow-2: rgba(14, 165, 233, .08);
  --btn-text: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: #161f3d;
  --card-2: #1c264a;
  --border: #27315a;
  --text: #e8ecf8;
  --text-strong: #ffffff;
  --muted: #9aa6cc;
  --brand: #6ea8fe;
  --brand-2: #8b7bff;
  --accent: #fb923c;
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, .12);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, .12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, .12);
  --tint: rgba(110, 168, 254, .12);
  --header-bg: rgba(11, 16, 32, .80);
  --glow-1: rgba(139, 123, 255, .18);
  --glow-2: rgba(110, 168, 254, .16);
  --btn-text: #0a0f1f;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, var(--glow-1), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, var(--glow-2), transparent 55%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3.4vw, 30px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-strong); }
.brand:hover { text-decoration: none; }
.brand img { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  color: var(--text); padding: 8px 10px; border-radius: 10px; font-size: 15px; font-weight: 500;
}
.nav-links a:hover { background: var(--tint); text-decoration: none; }
.nav-links a.activo { background: var(--tint); color: var(--brand); }
.tema-toggle {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 17px;
}

/* ---------- Franja de ayuda mutua (siempre visible en la plataforma) ---------- */
.franja {
  background: var(--tint); color: var(--text-strong);
  border-bottom: 1px solid var(--border); font-size: 14px; padding: 8px 0; text-align: center;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  min-height: 44px;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--btn-text); }
.btn-sec { background: var(--card); color: var(--text-strong); border-color: var(--border); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn-link { background: none; border: none; color: var(--muted); padding: 6px 8px; min-height: 0; font-weight: 500; }
.btn-link:hover { color: var(--brand); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-block { width: 100%; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 12px; }

/* ---------- Portada ---------- */
.hero { padding: 56px 0 24px; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 720px; }
.eyebrow {
  display: inline-block; background: var(--tint); color: var(--brand);
  font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.section { padding: 40px 0; }
.mutua {
  border-left: 4px solid var(--brand); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; box-shadow: var(--shadow); max-width: 760px;
}
.mutua strong:first-child { display: block; font-size: 19px; color: var(--text-strong); margin-bottom: 6px; }
.pasos { counter-reset: paso; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.paso { position: relative; padding-top: 52px; }
.paso::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; top: 16px; left: 20px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--btn-text); font-weight: 700; display: grid; place-items: center;
}
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text-strong); }
.faq details p { margin: 10px 0 0; color: var(--muted); }
#boton-google { min-height: 44px; }

/* ---------- Plataforma ---------- */
.vista { padding-top: 24px; padding-bottom: 64px; min-height: 60vh; }
.titulo-vista { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.titulo-vista h1 { font-size: clamp(24px, 4vw, 32px); margin: 0; }
.app-fila { display: flex; gap: 14px; align-items: flex-start; }
.icono {
  width: 52px; height: 52px; border-radius: 12px; background: var(--bg-soft); flex: none;
  display: grid; place-items: center; font-size: 24px; overflow: hidden; border: 1px solid var(--border);
}
.icono img { width: 100%; height: 100%; object-fit: cover; }
.app-fila .info { flex: 1; min-width: 0; }
.app-fila h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border);
}
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.brand { background: var(--tint); color: var(--brand); border-color: transparent; }
.barra { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.barra > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 24px; color: var(--text-strong); }
.stat span { font-size: 13px; color: var(--muted); }
.vacio { text-align: center; padding: 40px 20px; color: var(--muted); }
.vacio .grande { font-size: 40px; display: block; margin-bottom: 8px; }
.listo { text-align: center; background: var(--ok-bg); color: var(--ok); border-radius: var(--radius); padding: 18px; font-weight: 600; }

/* ---------- Formularios ---------- */
label { display: block; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; font-size: 15px; }
.campo { margin-bottom: 16px; }
.ayuda { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type="text"], input[type="url"], input[type="email"], textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.contador { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.error-form { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.estrellas { display: flex; gap: 6px; flex-wrap: wrap; }
.estrellas button {
  font-size: 15px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); cursor: pointer; min-height: 40px;
}
.estrellas button.sel { background: var(--brand); color: var(--btn-text); border-color: var(--brand); }

/* ---------- Guía paso a paso ---------- */
.guia ol { padding-left: 22px; }
.guia li { margin-bottom: 8px; }
.guia .aviso { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.guia code, .card code {
  background: var(--bg-soft); padding: 1px 6px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere;
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-strong); }
.tabla-scroll { overflow-x: auto; }

/* ---------- Ventana (modal) ---------- */
.fondo-modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  background: var(--card); color: var(--text); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 22px 18px 28px; box-shadow: var(--shadow);
}
@media (min-width: 700px) {
  .fondo-modal { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding: 26px; }
}
.modal-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-cab h2 { margin: 0; font-size: 21px; }
.cerrar { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }

/* ---------- Aviso flotante ---------- */
.aviso-flotante {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200;
  background: var(--text-strong); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 15px; max-width: calc(100% - 32px);
}

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Texto legal ---------- */
.legal { max-width: 780px; }
.legal h2 { font-size: 21px; margin-top: 28px; }
.legal li { margin-bottom: 6px; }

@media (max-width: 560px) {
  .nav-links a { padding: 6px 7px; font-size: 14px; }
  .brand span { display: none; }
  .hero { padding-top: 32px; }
  .card { padding: 16px; }
}

/* ---------- Panel de comunidad ---------- */
.comunidad {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px; max-width: 760px;
}
.comunidad-titulo { margin: 0 0 8px; font-size: 18px; color: var(--text-strong); }
.comunidad-titulo strong { color: var(--brand); font-size: 22px; }
.comunidad-cifras { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.comunidad-cifras b { color: var(--text-strong); }

/* ---------- Anuncios (separados de los botones) ---------- */
.anuncio:empty { display: none; }
.anuncio { margin: 28px 0; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; min-height: 90px; }
.anuncio-etiqueta { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }

/* =============== Rediseño 9 nov: menú único, visibilidad grande, portada =============== */

/* Cabecera: cuenta a la derecha */
.cabecera-derecha { gap: 10px; flex-wrap: nowrap; }
.cuenta { display: flex; align-items: center; gap: 10px; }
.usuario { display: flex; align-items: center; gap: 8px; color: var(--text-strong); font-weight: 600; padding: 4px 8px 4px 4px; border-radius: 999px; }
.usuario:hover { background: var(--tint); text-decoration: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center; background: var(--brand); color: var(--btn-text); font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.btn-chico { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }

/* Pestañas bajo la cabecera (deslizan en el celular) */
.pestanas { border-top: 1px solid var(--border); }
.pestanas-lista { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pestanas-lista::-webkit-scrollbar { display: none; }
.pestanas a {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 15px;
  border-bottom: 3px solid transparent;
}
.pestanas a:hover { color: var(--text-strong); text-decoration: none; }
.pestanas a.activa { color: var(--brand); border-bottom-color: var(--brand); }
.pestana-icono { font-size: 16px; }

/* Títulos de cada vista */
.titulo-vista { align-items: flex-start; margin-bottom: 20px; }
.subtitulo { margin: 4px 0 0; font-size: 15px; }

/* Resumen del día y visibilidad (tarjetas grandes) */
.resumen-dia { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 16px; }
.resumen-progreso, .visibilidad {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px;
}
.vis-etiqueta { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.vis-valor { font-size: clamp(34px, 7vw, 48px); font-weight: 800; color: var(--text-strong); line-height: 1.1; margin: 6px 0 10px; }
.vis-valor small { font-size: 18px; font-weight: 600; color: var(--muted); }
.vis-ayuda { font-size: 14px; color: var(--muted); margin-top: 8px; }
.visibilidad { border-left: 6px solid var(--brand); }
.visibilidad.ok { border-left-color: var(--ok); }
.visibilidad.ok .vis-valor { color: var(--ok); }
.visibilidad.ok .barra > span { background: var(--ok); }
.visibilidad.poco { border-left-color: var(--warn); }
.visibilidad.poco .vis-valor { color: var(--warn); }
.visibilidad.poco .barra > span { background: var(--warn); }
.visibilidad.mal { border-left-color: var(--bad); }
.visibilidad.mal .vis-valor { color: var(--bad); font-size: clamp(26px, 5vw, 34px); }
.barra { height: 10px; }

/* Tarjeta de la app de probador */
.app-probador { display: flex; gap: 16px; align-items: flex-start; border: 2px solid var(--brand); margin-bottom: 16px; }
.app-probador h3 { margin-bottom: 4px; }
.app-probador-icono { font-size: 40px; line-height: 1; }

/* Tarjetas de la lista: más aire y orden */
.grid > .card { display: flex; flex-direction: column; }
.grid > .card .btn-row { margin-top: auto; padding-top: 14px; }
.card h2 { font-size: 22px; }

/* Portada: solo texto principal, entrar y comunidad, centrado */
.hero-portada { text-align: center; padding: 72px 0 32px; max-width: 820px; }
.hero-portada .lead { margin-left: auto; margin-right: auto; }
.hero-portada .btn-row { justify-content: center; }
.comunidad-portada { margin: 8px auto 0; text-align: center; }
.comunidad-portada .comunidad-cifras { justify-content: center; }

@media (max-width: 560px) {
  .usuario-nombre { display: none; }
  .cabecera-derecha .btn-chico { padding: 6px 10px; }
  .hero-portada { padding-top: 40px; }
  .app-probador { flex-direction: column; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat b { font-size: 20px; }
}
#dev-login { margin-left: auto; margin-right: auto; text-align: left; }

/* Progreso del bloque de 10 comentarios */
.bloque { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.bloque-puntos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.bloque-puntos span { width: 18px; height: 18px; border-radius: 50%; background: var(--bg-soft); border: 2px solid var(--border); }
.bloque-puntos span.lleno { background: var(--brand); border-color: var(--brand); }
.bloque-texto { font-size: 14px; color: var(--muted); }
.bloque-texto strong { color: var(--text-strong); }

/* Pasos para descargar la app de probador */
.pasos-app { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.pasos-app li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pasos-app .ayuda { margin: 0; }

/* Preguntas de control editables */
.fila-pregunta { display: flex; gap: 8px; align-items: center; }
.fila-pregunta input { flex: 1; }

/* Cambio de idioma ES / EN */
.nav-links a.idioma {
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 9px; font-size: 13px; font-weight: 700; color: var(--brand);
}

/* Insignia roja de avisos en la pestaña «Mi app» (comentarios por calificar). */
.insignia-aviso { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.insignia-aviso.hidden { display: none; }

/* Tablero del admin: cada número es un botón que abre su detalle. */
.stat-boton { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.stat-boton:hover, .stat-boton:focus-visible { border-color: var(--brand); transform: translateY(-1px); }
.stat-boton .stat-ver { display: block; margin-top: 6px; font-size: 12px; color: var(--brand); }
/* Ventana ancha para las tablas de detalle. */
.modal.modal-ancha { width: min(1100px, 96vw); max-width: 96vw; }
.modal.modal-ancha td { font-size: 13px; vertical-align: top; }

/* Recuadro «¿Por qué?»: siempre visible, arriba de cada paso y en un color llamativo. */
.por-que { background: #fff7d6; border: 1px solid #f5c542; border-left: 6px solid #f59e0b; border-radius: 12px; padding: 12px 16px; margin: 12px 0 16px; color: #3d2f00; }
.por-que .por-que-titulo { margin: 0 0 4px; font-weight: 700; font-size: 15px; color: #92400e; }
.por-que p { margin: 0; font-size: 14px; line-height: 1.55; }
.por-que strong { color: #7c2d12; }

:root[data-theme="dark"] .por-que { background: #3a2a05; border-color: #a16207; color: #fde68a; }
:root[data-theme="dark"] .por-que .por-que-titulo, :root[data-theme="dark"] .por-que strong { color: #fcd34d; }

/* «Tienes X de 12»: apps que prueba el dueño (rojo si le faltan, verde si cumple). */
.meta-doce { border-radius: 14px; padding: 14px 16px; margin: 12px 0 16px; border: 1px solid; }
.meta-doce.falta { background: #fff1f2; border-color: #fda4af; border-left: 6px solid #e11d48; color: #4c0519; }
.meta-doce.cumple { background: #f0fdf4; border-color: #86efac; border-left: 6px solid #16a34a; color: #052e16; }
.meta-doce-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.meta-doce-titulo { font-weight: 700; }
.meta-doce-numero { font-size: 28px; font-weight: 800; }
.meta-doce-numero small { font-size: 15px; font-weight: 600; opacity: .8; }
.meta-doce.falta .barra span { background: #e11d48; }
.meta-doce.cumple .barra span { background: #16a34a; }
.meta-doce p { margin: 10px 0; font-size: 14px; line-height: 1.5; }
:root[data-theme="dark"] .meta-doce.falta { background: #3b0a14; border-color: #9f1239; color: #fecdd3; }
:root[data-theme="dark"] .meta-doce.cumple { background: #052e16; border-color: #166534; color: #bbf7d0; }
.meta-doce.probador { background: #eff6ff; border-color: #93c5fd; border-left: 6px solid #2563eb; color: #172554; }
.meta-doce.probador .barra span { background: #2563eb; }
:root[data-theme="dark"] .meta-doce.probador { background: #0b1d3f; border-color: #1e40af; color: #bfdbfe; }
