:root {
  --sd-azul: #4f46e5;
  --sd-indigo: #6366f1;
  --sd-violeta: #8b5cf6;
  --sd-rosa: #ec4899;
  --sd-naranja: #f97316;
  --sd-fondo: #f5f6ff;
  --sd-texto: #1e293b;
  --sd-suave: #818cf8;
}

body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  background: var(--sd-fondo);
  color: var(--sd-texto);
}

.font-display {
  font-family: "Poppins", system-ui, sans-serif;
}

/* ===== Navbar ===== */
.navbar-sumaday {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(79, 70, 229, 0.12);
}

.navbar-sumaday .navbar-brand {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  background: linear-gradient(135deg, var(--sd-indigo), var(--sd-rosa));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.35rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sd-indigo), var(--sd-rosa));
  color: #fff;
  font-size: 1.1rem;
  margin-right: 8px;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
  color: #fff;
  border-radius: 24px;
  padding: 3.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -120px;
  right: -80px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  bottom: -90px;
  left: 10%;
}

.btn-gradiente {
  background: linear-gradient(135deg, var(--sd-indigo), var(--sd-rosa));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.65rem 1.6rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradiente:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.btn-outline-blanco {
  border: 2px solid #fff;
  color: #fff;
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
}

.btn-outline-blanco:hover {
  background: #fff;
  color: var(--sd-indigo);
}

/* ===== Cards ===== */
.card-funcion {
  border: none;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  height: 100%;
}

.card-funcion:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.16);
}

.icono-funcion {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
}

.bg-azul { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.bg-rosa { background: linear-gradient(135deg, #ec4899, #f97316); }
.bg-verde { background: linear-gradient(135deg, #10b981, #14b8a6); }
.bg-naranja { background: linear-gradient(135deg, #f97316, #ef4444); }

.badge-proximo {
  background: #fff3e0;
  color: #e65100;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ===== Cards de autenticación ===== */
.card-auth {
  border: none;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(79, 70, 229, 0.12);
  padding: 2.2rem 2rem;
}

.form-control, .form-select {
  border-radius: 12px;
  padding: 0.65rem 1rem;
  border: 1.5px solid #e2e8f0;
}

.form-control:focus, .form-select:focus {
  border-color: var(--sd-indigo);
  box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.15);
}

/* ===== Tarjeta de racha (dashboard) ===== */
.card-racha {
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #1e1b4b, #4f46e5);
  color: #fff;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.num-racha {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.llama {
  font-size: 2.2rem;
  animation: flotar 2.5s ease-in-out infinite;
  display: inline-block;
}

@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== Modal onboarding ===== */
.nivel-opcion {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  height: 100%;
}

.nivel-opcion:hover {
  border-color: var(--sd-indigo);
  background: #eef2ff;
}

.nivel-opcion.seleccionado {
  border-color: var(--sd-indigo);
  background: #eef2ff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}

/* ===== Lista de objetivos ===== */
.objetivo-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1.5px solid #eef0fb;
  border-radius: 18px;
  margin-bottom: 0.8rem;
  background: #fff;
  transition: all 0.25s;
}

.objetivo-item:hover {
  border-color: #c7ccf9;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
  transform: translateX(4px);
}

.objetivo-item.completado {
  background: #f3f6ff;
  opacity: 0.85;
}

.objetivo-check input {
  width: 1.7rem;
  height: 1.7rem;
  cursor: pointer;
  border-radius: 8px;
}

.objetivo-check input:checked {
  background-color: #10b981;
  border-color: #10b981;
}

.objetivo-titulo {
  font-weight: 800;
  font-size: 1.05rem;
  word-break: break-word;
}

.objetivo-item.completado .objetivo-titulo {
  text-decoration: line-through;
  color: #64748b;
}

.objetivo-descripcion {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.objetivo-check-badge {
  font-size: 0.72rem;
}

.objetivo-acciones {
  opacity: 0;
  transition: opacity 0.2s;
}

.objetivo-item:hover .objetivo-acciones {
  opacity: 1;
}

.lista-objetivos {
  min-height: 140px;
}

/* Reducción de tamaño del spinner del checkbox al marcar */
.objetivo-check input:disabled {
  opacity: 0.4;
  cursor: progress;
}

/* ===== Viñetas del planificador ===== */
.vineta-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid #eef0fb;
  border-left: 5px solid var(--vineta-color, #6366f1);
  border-radius: 14px;
  margin-bottom: 0.6rem;
  background: #fff;
  transition: all 0.25s;
}

.vineta-item:hover {
  border-color: #c7ccf9;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
  transform: translateX(3px);
}

.vineta-item.completado {
  background: #f3f6ff;
  opacity: 0.8;
}

.vineta-check-label input {
  width: 1.35rem;
  height: 1.35rem;
  cursor: pointer;
  border-radius: 6px;
}

.vineta-check-label input:checked {
  background-color: #10b981;
  border-color: #10b981;
}

.vineta-titulo {
  font-weight: 700;
  word-break: break-word;
}

.vineta-item.completado .vineta-titulo {
  text-decoration: line-through;
  color: #64748b;
}

.vineta-descripcion {
  font-size: 0.85rem;
  color: #64748b;
}

/* ===== Paleta de colores ===== */
.color-swatches {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.color-swatches:hover {
  transform: scale(1.15);
}

.color-swatches.activo {
  border-color: #fff;
  outline: 2px solid #4f46e5;
  transform: scale(1.15);
}

/* ===== Cámara / verificación ===== */
.camara-contenedor {
  background: #0f172a;
  border-radius: 14px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.camara-vacio {
  color: #94a3b8;
  text-align: center;
  padding: 2rem;
}

.camara-contenedor video,
.camara-contenedor img {
  max-height: 320px;
  object-fit: cover;
}

/* ===== Study Hub ===== */
.card-metodo {
  border: 1.5px solid #eef0fb;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-metodo:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

/* ===== Top mundial ===== */
.blur-row {
  filter: blur(5px);
  color: #94a3b8;
  user-select: none;
}

.bg-top-gradiente {
  background: linear-gradient(120deg, #4f46e5, #8b5cf6, #ec4899);
  border: none;
}

/* ===== Planes ===== */
.card-plan-popular {
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.18);
}

#tiempoPomodoro {
  font-variant-numeric: tabular-nums;
}

/* ===== Footer ===== */
.footer-sumaday {
  border-top: 1px solid rgba(79, 70, 229, 0.12);
  background: #fff;
}

/* ===== Study Hub: Laboratorio ===== */
.nav-pills-sm .nav-link {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 50rem;
}
.nav-pills-sm .nav-link.active {
  background: linear-gradient(120deg, #4f46e5, #8b5cf6);
}
#chipsActividades .badge {
  font-size: 0.78rem;
}

/* Plantilla Cornell */
.plantilla-cornell textarea {
  border: 1px dashed #c7d2fe;
  background: #fff;
}
.plantilla-cornell .col-4 textarea {
  background: #f8faff;
}

/* Mapa mental */
.mapa-mental {
  background: #f8faff;
  border: 1px dashed #c7d2fe;
  min-height: 120px;
}
.mapa-mental .badge {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Tarjetas de método */
.card-metodo .btn-practicar {
  white-space: nowrap;
}
.card-metodo .card-body {
  padding: 1.25rem 1.25rem 1.4rem;
}

/* Laboratorio: contenido con aire */
#cardLaboratorio {
  scroll-margin-top: 84px;
}
.laboratorio-contenido {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}
.laboratorio-contenido textarea.form-control {
  font-size: 0.95rem;
}
.laboratorio-contenido #contenidoActividad > div:last-child {
  padding: 0.25rem 0;
}

/* Actividad: tarjetas Leitner */
#actPregActual {
  min-height: 2.2rem;
  font-size: 1.05rem;
}

/* Estadísticas del Laboratorio */
.barra-estadistica {
  width: 100%;
  max-width: 42px;
  margin: 0 auto 4px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  min-height: 8px;
  font-size: 0.72rem;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 2px;
}
.barra-estadistica.barra-vacia {
  background: #e5e7eb;
}
.barra-estadistica-item {
  flex: 1;
}

/* ===== Modo oscuro ===== */
[data-tema="oscuro"] {
  --sd-fondo: #0f172a;
  --sd-texto: #e2e8f0;
}
[data-tema="oscuro"] body {
  background: #0f172a;
  color: #e2e8f0;
}
[data-tema="oscuro"] .card-funcion,
[data-tema="oscuro"] .card,
[data-tema="oscuro"] .card-auth {
  background: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
[data-tema="oscuro"] .card-funcion:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
[data-tema="oscuro"] .navbar-sumaday {
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}
[data-tema="oscuro"] .navbar-sumaday .nav-link,
[data-tema="oscuro"] .navbar-sumaday .dropdown-menu {
  color: #e2e8f0;
}
[data-tema="oscuro"] .navbar-sumaday .dropdown-menu {
  background: #1e293b;
  color: #e2e8f0;
}
[data-tema="oscuro"] .navbar-sumaday .dropdown-item {
  color: #e2e8f0;
}
[data-tema="oscuro"] .navbar-sumaday .dropdown-item:hover {
  background: #334155;
  color: #fff;
}
[data-tema="oscuro"] .navbar-sumaday .nav-link.active {
  color: var(--sd-suave);
}
[data-tema="oscuro"] .navbar-sumaday .text-muted {
  color: #94a3b8 !important;
}
[data-tema="oscuro"] .navbar-sumaday .bi-lock-fill {
  color: #f59e0b;
}
[data-tema="oscuro"] .text-secondary {
  color: #94a3b8 !important;
}
[data-tema="oscuro"] .form-control,
[data-tema="oscuro"] .form-select {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
[data-tema="oscuro"] .form-control::placeholder {
  color: #64748b;
}
[data-tema="oscuro"] .input-group-text {
  background: #1e293b !important;
  border-color: #334155;
  color: #94a3b8;
}
[data-tema="oscuro"] .card-auth .form-label {
  color: #e2e8f0;
}
[data-tema="oscuro"] .card-auth h1,
[data-tema="oscuro"] .card-auth .font-display {
  color: #f1f5f9;
}
[data-tema="oscuro"] .btn-light {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
[data-tema="oscuro"] .border,
[data-tema="oscuro"] .border-top,
[data-tema="oscuro"] .border-bottom,
[data-tema="oscuro"] .border-end,
[data-tema="oscuro"] .border-start {
  border-color: #334155 !important;
}
[data-tema="oscuro"] .mapa-mental,
[data-tema="oscuro"] .plantilla-cornell,
[data-tema="oscuro"] .plantilla-cornell .col-4 textarea {
  background: #0f172a;
  border-color: #334155;
}
[data-tema="oscuro"] .barra-estadistica.barra-vacia {
  background: #334155;
}
[data-tema="oscuro"] .badge.text-bg-light {
  background: #334155 !important;
  color: #e2e8f0 !important;
}
[data-tema="oscuro"] .btn-outline-primary {
  color: var(--sd-suave);
  border-color: #485569;
}
[data-tema="oscuro"] .btn-outline-secondary {
  color: #94a3b8;
  border-color: #334155;
}
[data-tema="oscuro"] .btn-outline-danger {
  color: #fca5a5;
  border-color: #7f1d1d;
}
[data-tema="oscuro"] .modal-content {
  background: #1e293b;
  color: #e2e8f0;
}
[data-tema="oscuro"] .toast {
  background: #1e293b;
}

/* ===== Barra de navegación inferior (móvil) ===== */
.navbar-superior-inferior {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(79, 70, 229, 0.12);
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}
[data-tema="oscuro"] .navbar-superior-inferior {
  background: rgba(15, 23, 42, 0.92);
  border-top-color: rgba(99, 102, 241, 0.25);
}
.navbar-superior-inferior .item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0;
  border-radius: 12px;
}
.navbar-superior-inferior .item i {
  font-size: 1.15rem;
}
.navbar-superior-inferior .item.activo {
  color: var(--sd-indigo);
}
.navbar-superior-inferior .item.activo i {
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.4));
}
.navbar-superior-inferior .item.text-muted {
  color: #94a3b8;
}
@media (max-width: 991.98px) {
  body {
    padding-bottom: 62px;
  }
}

/* ===== Aviso de instalación PWA (móvil) ===== */
.aviso-instalar-pwa {
  position: fixed;
  bottom: 70px;
  left: 12px;
  right: 12px;
  z-index: 1060;
  background: #fff;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.18);
  padding: 0.75rem 1rem;
  animation: subirAviso 0.35s ease;
}
[data-tema="oscuro"] .aviso-instalar-pwa {
  background: #1e293b;
  border-color: #334155;
}
@keyframes subirAviso {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
