/* ============================================================
   VOCALIA - Sistema de diseño
   Paleta tomada del logo: noche profunda -> violeta -> atardecer,
   con cian como acento de "IA" y guía interactiva.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --noche: #0b0a2a;
  --violeta: #4c2a8f;
  --atardecer: #ff7a3d;
  --cian: #29d6e6;
  --cian-suave: #7ef0f6;
  --texto: #f4f2ff;
  --texto-tenue: #b8b3d9;
  --tarjeta: rgba(255, 255, 255, 0.06);
  --borde: rgba(255, 255, 255, 0.14);
  --error: #ff6b6b;
  --exito: #3ddc97;

  --fuente-titulo: 'Sora', sans-serif;
  --fuente-cuerpo: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fuente-cuerpo);
  color: var(--texto);
  background:
    radial-gradient(ellipse 900px 500px at 50% 100%, rgba(255,122,61,0.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 20% 0%, rgba(76,42,143,0.55), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 10%, rgba(41,214,230,0.18), transparent 55%),
    var(--noche);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--fuente-titulo); margin: 0 0 8px; letter-spacing: -0.01em; }
p { line-height: 1.55; color: var(--texto-tenue); }
a { color: var(--cian-suave); }

/* ---------- Layout genérico ---------- */

.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 80px;
}

.encabezado-marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  text-align: center;
}

.encabezado-marca img { width: 76px; height: 76px; }
.encabezado-marca .nombre {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: 28px;
  background: linear-gradient(90deg, var(--cian-suave), #fff 40%, var(--atardecer));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.encabezado-marca .lema { color: var(--texto-tenue); font-size: 14px; }

/* ---------- Tarjetas ---------- */

.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  backdrop-filter: blur(18px);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.tarjeta.ancha { max-width: 720px; }
.tarjeta.super-ancha { max-width: 980px; }

/* ---------- Pestañas (login / registro) ---------- */

.pestanas {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}
.pestana {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--texto-tenue);
  transition: all .2s ease;
  user-select: none;
}
.pestana.activa {
  background: linear-gradient(90deg, var(--violeta), #7b3fe4);
  color: #fff;
  box-shadow: 0 4px 14px rgba(76,42,143,0.5);
}

/* ---------- Formularios ---------- */

.campo { margin-bottom: 14px; }
.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-tenue);
  margin-bottom: 6px;
}
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=date], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: rgba(0,0,0,0.25);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 70px; }
input::placeholder, textarea::placeholder { color: #6f6a97; }
input:focus, select:focus, textarea:focus {
  border-color: var(--cian);
  box-shadow: 0 0 0 3px rgba(41,214,230,0.18);
}
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .fila-2 { grid-template-columns: 1fr; } }

.check-linea {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--texto-tenue);
  margin: 14px 0;
}
.check-linea input { width: auto; margin-top: 3px; accent-color: var(--cian); }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  font-family: var(--fuente-cuerpo);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primario {
  background: linear-gradient(90deg, var(--violeta), #7b3fe4 60%, var(--cian));
  color: #fff;
  box-shadow: 0 8px 24px rgba(76,42,143,0.45);
}
.btn-acento {
  background: linear-gradient(90deg, var(--atardecer), #ff5c8a);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255,122,61,0.35);
}
.btn-fantasma {
  background: transparent;
  border: 1px solid var(--borde);
  color: var(--texto);
}
.btn-chico { width: auto; padding: 8px 16px; font-size: 13px; }

/* ---------- Mensajes de estado ---------- */

.mensaje { margin-top: 14px; font-size: 13.5px; font-weight: 600; text-align: center; min-height: 18px; }
.mensaje.ok { color: var(--exito); }
.mensaje.error { color: var(--error); }

/* ---------- Nodo / rama (motivo visual del logo) ---------- */

.progreso-nodos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}
.progreso-nodos .nodo {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: all .25s ease;
}
.progreso-nodos .linea {
  width: 30px; height: 2px;
  background: rgba(255,255,255,0.18);
}
.progreso-nodos .nodo.activo { background: var(--cian); box-shadow: 0 0 10px var(--cian); }
.progreso-nodos .nodo.hecho { background: var(--atardecer); }
.progreso-nodos .linea.hecho { background: var(--atardecer); }

/* ---------- Preguntas de encuesta ---------- */

.pregunta-bloque {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--borde);
}
.pregunta-bloque:last-child { border-bottom: none; }
.pregunta-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(41,214,230,0.15);
  color: var(--cian-suave);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}
.pregunta-texto { font-weight: 600; font-size: 15.5px; display: inline; }

.opcion-linea {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--borde);
  margin-top: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.opcion-linea:hover { border-color: var(--cian); }
.opcion-linea input { accent-color: var(--cian); width: auto; }
.opcion-linea span { font-size: 14px; }

/* ---------- Chat ---------- */

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 78vh;
}
.chat-mensajes {
  flex: 1;
  overflow-y: auto;
  padding: 6px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.burbuja {
  max-width: 78%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.burbuja.ia {
  align-self: flex-start;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--borde);
  border-bottom-left-radius: 4px;
}
.burbuja.alumno {
  align-self: flex-end;
  background: linear-gradient(120deg, var(--violeta), #7b3fe4);
  border-bottom-right-radius: 4px;
}
.chat-entrada {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.chat-entrada textarea { flex: 1; min-height: 46px; max-height: 120px; }
.chat-entrada .btn { width: auto; padding: 0 20px; }
.escribiendo { font-size: 13px; color: var(--texto-tenue); font-style: italic; }

/* ---------- Admin ---------- */

.barra-admin {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.pestillas-admin { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.pestillas-admin .pestana { flex: none; padding: 8px 18px; }

table.tabla-datos { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tabla-datos th {
  text-align: left; padding: 10px 12px; color: var(--texto-tenue);
  border-bottom: 1px solid var(--borde); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}
table.tabla-datos td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
table.tabla-datos tr:hover td { background: rgba(255,255,255,0.03); }

.tarjeta-metrica {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 18px 20px;
}
.tarjeta-metrica .valor { font-family: var(--fuente-titulo); font-size: 30px; font-weight: 800; }
.tarjeta-metrica .etiqueta { font-size: 12.5px; color: var(--texto-tenue); }

.grid-metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }

.barra-conteo { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.barra-conteo .etq { width: 140px; font-size: 12.5px; color: var(--texto-tenue); flex-shrink: 0; }
.barra-conteo .pista { flex: 1; height: 10px; background: rgba(255,255,255,0.07); border-radius: 6px; overflow: hidden; }
.barra-conteo .relleno { height: 100%; background: linear-gradient(90deg, var(--cian), var(--violeta)); border-radius: 6px; }
.barra-conteo .num { width: 30px; text-align: right; font-size: 12.5px; font-weight: 700; }

.enlace-discreto { font-size: 13px; text-align: center; margin-top: 16px; }
.enlace-discreto a { color: var(--cian-suave); text-decoration: none; }
.enlace-discreto a:hover { text-decoration: underline; }
option {
  background-color: var(--noche);
  color: var(--texto);
}

/* Estilos aislados para el modal de privacidad */
.modal-privacidad {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-contenido {
  background-color: #ffffff;
  color: #333333;
  margin: 10vh auto;
  padding: 25px 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  font-family: sans-serif;
}
.modal-contenido h3 { margin-top: 0; color: #222; }
.modal-contenido p { font-size: 14px; line-height: 1.6; text-align: justify; margin-bottom: 15px; }
.modal-contenido a { color: #0056b3; text-decoration: underline; }
.cerrar-modal {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #888;
  line-height: 1;
}
.cerrar-modal:hover { color: #111; }
.separador-modal { border: 0; border-top: 1px solid #dddddd; margin: 20px 0; }