/* ============================================================
   EA Estudio — Estilos globales
   Paleta: azul principal #1A6FA8, azul claro #E8F3FB, texto #1a1a2e
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul: #1A6FA8;
  --azul-oscuro: #135485;
  --azul-claro: #E8F3FB;
  --azul-medio: #4A9FD4;
  --texto: #1a1a2e;
  --texto-suave: #555e72;
  --fondo: #f5f7fa;
  --blanco: #ffffff;
  --error: #d93025;
  --exito: #1e8a3c;
  --borde: #dce3ed;
  --radio: 10px;
  --sombra: 0 2px 12px rgba(26, 111, 168, 0.10);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Cabecera ---- */
header.cabecera {
  background: var(--blanco);
  border-bottom: 1px solid var(--borde);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 100;
}

header.cabecera .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--azul);
  text-decoration: none;
}

header.cabecera .logo img { height: 36px; }

nav.cabecera-nav { display: flex; gap: 1rem; align-items: center; }

.cabecera-bienvenido {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  padding-right: 0.75rem;
  border-right: 1px solid var(--borde);
}

nav.cabecera-nav a {
  color: var(--texto-suave);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

nav.cabecera-nav a:hover,
nav.cabecera-nav a.activo {
  background: var(--azul-claro);
  color: var(--azul);
}

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radio);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--azul); color: var(--blanco); }
.btn-primary:hover { background: var(--azul-oscuro); }

.btn-outline {
  background: transparent;
  color: var(--azul);
  border: 2px solid var(--azul);
}
.btn-outline:hover { background: var(--azul-claro); }

.btn-peligro { background: var(--error); color: var(--blanco); }
.btn-peligro:hover { background: #b5261e; }

.btn-google {
  background: var(--blanco);
  color: var(--texto);
  border: 1.5px solid var(--borde);
  font-weight: 500;
}
.btn-google:hover { background: var(--fondo); }
.btn-google img { width: 18px; height: 18px; }

.btn-full { width: 100%; }

/* ---- Formularios ---- */
.campo { display: flex; flex-direction: column; gap: 6px; }

.campo label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.campo input,
.campo select,
.campo textarea {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  font-size: 0.95rem;
  color: var(--texto);
  background: var(--blanco);
  transition: border-color 0.15s;
  width: 100%;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--azul);
}

.campo textarea { resize: vertical; min-height: 80px; }

.campo-input {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  font-size: 0.95rem;
  color: var(--texto);
  background: var(--blanco);
  width: 100%;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
.campo-input:focus { outline: none; border-color: var(--azul); }

/* Checkboxes y radios personalizados */
.opciones-grupo { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.opcion-chip input[type="checkbox"],
.opcion-chip input[type="radio"] { display: none; }

.opcion-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid var(--borde);
  border-radius: 20px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  user-select: none;
}

.opcion-chip:hover {
  border-color: var(--azul);
  color: var(--azul);
}

.opcion-chip:has(input:checked) {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--blanco);
}

/* ---- Tarjeta ---- */
.tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
  border: 1px solid var(--borde);
}

/* ---- Alertas ---- */
.alerta {
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  font-size: 0.9rem;
  display: none;
}

.alerta-error { background: #fce8e6; color: var(--error); border: 1px solid #f5c6c3; }
.alerta-exito { background: #e6f4ea; color: var(--exito); border: 1px solid #b7dfc2; }
.alerta-info  { background: var(--azul-claro); color: var(--azul); border: 1px solid #b3d4ed; }

/* ---- Divisor ---- */
.divisor {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--texto-suave);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.divisor::before,
.divisor::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--borde);
}

/* ---- Badges de estado ---- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-activo  { background: #e6f4ea; color: var(--exito); }
.badge-grupal    { background: #dbeafe; color: #1a5a9a; }
.badge-nutricion { background: #e6f4ea; color: #1e8a3c; }
.badge-personal { background: #fde8df; color: #b85030; }
.badge-duo      { background: #e65100; color: #fff; }
.badge-bloqueado { background: #fce8e6; color: var(--error); }
.badge-espera  { background: #fff3e0; color: #e65100; }

/* ---- Utilidades ---- */
.centrado { text-align: center; }
.texto-suave { color: var(--texto-suave); font-size: 0.9rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-2 { gap: 1rem; }

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(26,58,92,0.2);
  border-top-color: #1A3A5C;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Footer ---- */
footer.pie {
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.75rem;
  color: var(--texto-suave);
  border-top: 1px solid var(--borde);
  margin-top: 2rem;
}
footer.pie a {
  color: var(--texto-suave);
  text-decoration: underline;
}
footer.pie a:hover { color: var(--azul); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  header.cabecera { padding: 0 1rem; }
  header.cabecera .logo-texto { display: none; }
  .cabecera-bienvenido { display: none; }
  nav.cabecera-nav a { text-align: center; }
}
