/* =========================================================================================
   TEMA OSCURO + NEÓN ROJO — APUNTES / GUÍAS
   Archivo: estilos-extendidos.css (aprox. 650 líneas)
   Importante: Conserva todos los selectores originales. Solo cambia estética.
   ========================================================================================= */

/* ======================= VARIABLES ======================= */
:root {
  --primary: #d9bed8;
  --dark-bg: #212529;
  --accent: #ff4d4d;
  --radius: 0.375rem;
  --red: #ff4d4d;
  --color-claro: #1e90ff;
  --color-oscuro: #ff4d4d;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --blue: #1e90ff;

  /* Extras para el tema */
  --panel-bg: #0f1013;
  --panel-grad-1: rgba(255, 77, 77, 0.08);
  --panel-grad-2: rgba(255, 77, 77, 0.02);
  --input-bg: #0b0c0f;
  --input-border: #2a2d36;
  --input-border-hover: #3a3f4d;
  --text-strong: #f1f1f1;
  --text-soft: #c9c9c9;
  --placeholder: #7a7f8a;
  --ring: rgba(255, 77, 77, 0.55);
  --ring-soft: rgba(255, 77, 77, 0.25);
  --shadow-soft: rgba(0, 0, 0, 0.55);
  --glow-red: 0 0 15px rgba(255, 77, 77, 0.8), 0 0 30px rgba(255, 77, 77, 0.6);
  --card-bg: #111215;
  --card-border: rgba(255, 77, 77, 0.28);
  --muted: #9aa0aa;
  --muted-2: #7c818c;
}

/* ======================= BASE ======================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  padding-top: 100px; /* alto del encabezado */
  padding-bottom: 150px; /* alto del footer */
}

body {
  font-family: "Arial", sans-serif;
  background-color: var(--dark-bg);
  color: var(--primary);
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--color-claro);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2 {
  text-align: center;
}

/* ================= BOTÓN REGRESAR ================= */

.btn.regresar {
  position: relative; /* quitar fixed */
  bottom: auto;
  left: auto;
  transform: none;
  margin-left: 10px; /* espacio entre botones */
  box-shadow: none; /* opcional: quitar sombra si quieres uniforme */

  /* estilos que ya definiste */
  background: linear-gradient(180deg, #ff4d4d, #d63333);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.8), 0 0 20px rgba(255, 77, 77, 0.6);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn.regresar:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.03);
  box-shadow: 0 0 15px rgba(255, 77, 77, 1), 0 0 30px rgba(255, 77, 77, 0.8);
}

/* ================= ENCABEZADO ================= */
.encabezado {
  background: #161618;
  width: 100%;
  z-index: 999;
  top: 0;
  left: 0;
  position: fixed;
  transition: background 0.4s ease;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 77, 77, 0.18);
  box-shadow: none;
}

.auth-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.usuario-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.usuario-info .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.usuario-info .correo {
  color: var(--primary);
  font-weight: bold;
  font-size: 0.95rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background-color: var(--color-claro);
  color: white;
  font-weight: bold;
  transition: filter 0.2s ease, transform 0.06s ease, box-shadow 0.2s ease;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn.cerrar-sesion {
  background-color: var(--accent);
}

.btn.guardar {
  background: linear-gradient(180deg, var(--red), #e84141);
  border: 1px solid rgba(255, 77, 77, 0.8);
  color: #fff;
  margin-top: 1.5rem;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.25),
    0 8px 22px rgba(255, 77, 77, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.btn.guardar:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.35),
    0 12px 30px rgba(255, 77, 77, 0.55);
}
.btn.guardar:active {
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.25),
    0 6px 18px rgba(255, 77, 77, 0.35) inset;
}

/* ================= FORMULARIO (ORIGINAL + TEMA CAPTURA) ================= */
.formulario {
  width: 90%;
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid rgba(255, 77, 77, 0.25);
  border-radius: 14px;
  background: radial-gradient(
      1200px 380px at 50% -120px,
      var(--panel-grad-1),
      transparent
    ),
    radial-gradient(900px 260px at 110% 10%, var(--panel-grad-2), transparent),
    var(--panel-bg);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
    0 0 22px rgba(255, 77, 77, 0.18), 0 15px 35px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
  color: var(--text-strong);
  backdrop-filter: blur(2px);
}

.formulario input,
.formulario textarea,
.formulario select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-strong);
  font-size: 1rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease, transform 0.06s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  caret-color: var(--red);
}

.formulario label {
  font-weight: 600;
  margin-top: 0.5rem;
  display: block;
  color: var(--text-soft);
  letter-spacing: 0.2px;
}

.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-upload-label {
  display: inline-block;
  background-color: var(--input-bg);
  color: var(--text-soft);
  padding: 0.75rem;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-color 0.2s ease;
  border: 1px dashed rgba(255, 77, 77, 0.6);
  margin-top: 0.5rem;
  width: 100%;
}
input[type="file"] {
  display: none;
}

.file-upload-label:hover {
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--ring-soft), 0 0 0 4px var(--ring);
}

.formulario input:hover,
.formulario textarea:hover,
.formulario select:hover {
  border-color: var(--input-border-hover);
}

.formulario input:focus,
.formulario textarea:focus,
.formulario select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--ring-soft), 0 0 0 4px var(--ring);
  transform: translateY(-1px);
}

.formulario input::placeholder,
.formulario textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.formulario textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row,
.formulario .fila,
.formulario .grupo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 640px) {
  .form-row,
  .formulario .fila,
  .formulario .grupo {
    grid-template-columns: 1fr;
  }
}

/* ================= FILTROS ================= */
.filtros {
  max-width: 700px;
  margin: 120px auto 2rem; /* Ajusta 120px según necesites */
  padding: 0 1rem;
  text-align: center;
}
@media (max-width: 768px) {
  .filtros {
    margin-top: 260px; /* antes 100px, ahora más abajo */
  }
}

@media (max-width: 480px) {
  .filtros {
    margin-top: 240px; /* antes 80px, ahora más abajo */
  }
}

.filtros select {
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-strong);
  width: 300px;
  margin-top: 0.5rem;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.filtros select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--ring-soft), 0 0 0 4px var(--ring);
}

/* ================= TARJETAS ================= */
.contenedor-apuntes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem;
}

.tarjeta {
  flex: 0 1 220px; /* fuerza ancho uniforme */
  max-width: 240px;
}

.tarjeta {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  width: 200px;
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
    0 0 20px rgba(255, 77, 77, 0.18);
  text-align: center;
  border: 1px solid var(--card-border);
  transition: transform 0.2s, box-shadow 0.25s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  word-wrap: break-word;
}
.tarjeta[style*="display: none"] {
  display: none !important;
}
.tarjeta:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.18),
    0 0 28px rgba(255, 77, 77, 0.28);
}
.tarjeta h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--red);
  font-weight: 800;
}

.tarjeta img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 10px;
  margin: 0.4rem 0;
}

.tarjeta p {
  font-size: 0.85rem;
  margin: 0.2rem 0;
  color: #cfcfd4;
}

.tarjeta pre {
  background-color: #0f1216;
  color: #8affd4;
  padding: 0.6rem;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  text-align: left;
  overflow-x: auto;
  font-size: 0.78rem;
  margin: 0.4rem 0;
  border: 1px solid #2b303b;
}

.tarjeta .acciones {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.boton-editar,
.boton-eliminar {
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  transition: filter 0.2s ease, transform 0.06s ease, box-shadow 0.2s ease;
}
.boton-editar {
  background-color: #2d89ff;
}
.boton-eliminar {
  background-color: var(--red);
}
.boton-editar:hover,
.boton-eliminar:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tarjeta .autor {
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 0.5rem;
}

/* ================= COLORES ================= */
.tarjeta.rojo {
  border-color: var(--red);
}
.tarjeta.azul {
  border-color: var(--blue);
}
.tarjeta.verde {
  border-color: var(--green);
}
.tarjeta.amarillo {
  border-color: var(--yellow);
}

.tarjeta.rojo h3 {
  color: var(--red);
}
.tarjeta.azul h3 {
  color: var(--blue);
}
.tarjeta.verde h3 {
  color: var(--green);
}
.tarjeta.amarillo h3 {
  color: var(--yellow);
}

/* ================= MODAL ================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-contenido {
  background: #111;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
  color: #fff;
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
    0 0 20px rgba(255, 77, 77, 0.18), 0 16px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 77, 77, 0.25);
}

.titulo-modal {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 15px;
  color: var(--red);
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.45);
}

.descripcion-tarjeta,
.descripcion-modal {
  text-align: justify;
  line-height: 1.6;
  margin: 10px 0;
  white-space: pre-line; /* respeta los saltos de línea del textarea */
}

.descripcion-modal {
  font-size: 1rem;
  line-height: 1.5;
  margin: 10px 0;
  color: #e6e6e6;

  text-align: justify;
  line-height: 1.6;
  margin: 15px 0;
}

.bloque-comando {
  background-color: #0f1216;
  padding: 12px;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  margin: 15px 0;
  overflow-x: auto;
  color: #8affd4;
  border: 1px solid #2b303b;
}

.fuente-modal a {
  color: #3399ff;
  word-break: break-all;
}
.fuente-modal,
.sistema-modal,
.fecha-modal {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #ccc;
}

.imagen-modal {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
  border-radius: 10px;
  cursor: zoom-in;
}

/* Aplica color al borde según clase */
.modal-contenido.rojo {
  border-color: #e74c3c;
}
.modal-contenido.verde {
  border-color: #2ecc71;
}
.modal-contenido.azul {
  border-color: #3498db;
}
.modal-contenido.amarillo {
  border-color: #f1c40f;
}
.modal-contenido.morado {
  border-color: #9b59b6;
}

.modal-contenido h3 {
  font-size: 1.3rem;
  margin: 0.5rem 0;
  text-align: center;
}

.modal-contenido img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto;
}

.modal-contenido p,
.modal-contenido pre,
.modal-contenido a {
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal-contenido pre {
  background-color: #333;
  color: #00ffcc;
  padding: 0.5rem;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  overflow-x: auto;
  white-space: pre-wrap;
}

.cerrar-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #333;
}
.cerrar-modal:hover {
  color: red;
}

.oculto {
  display: none;
}

/* ================= NOTIFICACIONES ================= */
.notificacion {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e90ff;
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 77, 77, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.notificacion.mostrar {
  opacity: 1;
  pointer-events: auto;
}
.notificacion.error {
  background-color: #e74c3c;
}

/* ================= VISOR DE IMAGEN ================= */
.visor-imagen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.imagen-grande-contenedor {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.imagen-grande-contenedor img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.cerrar-visor {
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  background: red;
  border-radius: 50%;
  padding: 0 12px;
  line-height: 1.2;
}

/* ================= NUEVA SECCIÓN: APUNTES / GUÍAS (DISEÑO CAPTURA) ================= */
.seccion-guias {
  text-align: center;
  margin: 3rem auto;
  padding: 1rem;
}
.seccion-guias h2 {
  color: var(--red);
  font-size: clamp(2rem, 4.4vw, 2.8rem);
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.55);
  letter-spacing: 0.6px;
}
.seccion-guias p {
  color: #ccc;
  font-size: 1rem;
  margin-bottom: 2rem;
}

.contenedor-guias {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.tarjeta-guia {
  background: #111;
  border: 2px solid var(--red);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(420px, 92vw);
  color: white;
  text-align: center;
  box-shadow: var(--glow-red);
  transition: transform 0.3s ease, box-shadow 0.25s ease;
}
.tarjeta-guia:hover {
  transform: translateY(-5px) scale(1.02);
}

.tarjeta-guia h3 {
  color: var(--red);
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}
.tarjeta-guia img {
  max-width: 110px;
  margin: 0.5rem auto 0.6rem;
}
.tarjeta-guia p {
  font-size: 0.98rem;
  color: #d7d7d9;
  margin-bottom: 1.5rem;
}
.btn-guia {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--red);
  color: white;
  font-weight: bold;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s ease;
  border: 1px solid var(--red);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.25),
    0 8px 22px rgba(255, 77, 77, 0.35);
}
.btn-guia:hover {
  background: #e84141;
  transform: scale(1.05);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.35),
    0 12px 30px rgba(255, 77, 77, 0.55);
}

/* ================= TITULARES PRINCIPALES ================= */
h1.titulo-principal,
h2.titulo-principal {
  color: var(--red);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 1.8rem 0 0.6rem;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 77, 77, 0.55);
  letter-spacing: 0.6px;
}
.subtitulo-principal {
  text-align: center;
  color: var(--text-soft);
  margin-bottom: 1.6rem;
}

/* ================= ESTADOS DE FORMULARIO ================= */
.is-valid,
.formulario .is-valid {
  border-color: rgba(46, 204, 113, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25) !important;
}
.is-invalid,
.formulario .is-invalid {
  border-color: rgba(231, 76, 60, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.25) !important;
}

.formulario .help,
.formulario .ayuda,
.formulario small {
  display: block;
  margin-top: 0.4rem;
  color: var(--placeholder);
  font-size: 0.85rem;
}

.formulario .divider,
.formulario hr {
  border: none;
  height: 1px;
  margin: 1.25rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 77, 77, 0.35),
    transparent
  );
}
.formulario .subtitulo {
  color: var(--red);
  font-weight: 700;
  margin: 0.75rem 0 0.5rem;
}

/* ================= UTILIDADES (no rompen funcionalidad) ================= */
.hide {
  display: none !important;
}
.center {
  text-align: center !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 0.25rem !important;
}
.mt-2 {
  margin-top: 0.5rem !important;
}
.mt-3 {
  margin-top: 1rem !important;
}
.mt-4 {
  margin-top: 1.5rem !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 1rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}
.p-0 {
  padding: 0 !important;
}
.p-1 {
  padding: 0.25rem !important;
}
.p-2 {
  padding: 0.5rem !important;
}
.p-3 {
  padding: 1rem !important;
}
.p-4 {
  padding: 1.5rem !important;
}
.round {
  border-radius: 10px !important;
}
.round-2 {
  border-radius: 14px !important;
}
.shadow-soft {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

/* ================= ANIMACIONES SUAVES ================= */
@keyframes pop-in {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
      0 0 18px rgba(255, 77, 77, 0.18);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.18),
      0 0 30px rgba(255, 77, 77, 0.32);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
      0 0 18px rgba(255, 77, 77, 0.18);
  }
}
.tarjeta-guia,
.tarjeta {
  animation: pop-in 0.2s ease-out;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .contenedor-guias {
    gap: 1.5rem;
  }
  .tarjeta {
    width: 180px;
  }
}
@media (max-width: 768px) {
  .encabezado {
    padding: 0.8rem;
  }
  .seccion-guias h2 {
    font-size: 2rem;
  }
  .tarjeta {
    width: 46%;
    min-width: 220px;
  }
}
@media (max-width: 560px) {
  .contenedor-apuntes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  .tarjeta {
    width: 100%; /* que ocupen toda la columna */
    max-width: 100%;
  }
}

/* ================= MODO ALTO CONTRASTE (opcional) ================= */
@media (prefers-contrast: more) {
  .formulario,
  .tarjeta,
  .tarjeta-guia,
  .modal-contenido {
    border-width: 2px;
  }
}

/* ================= REDUCCIÓN DE MOVIMIENTO ================= */
@media (prefers-reduced-motion: reduce) {
  .formulario *,
  .btn,
  .tarjeta,
  .tarjeta-guia,
  .file-upload-label {
    transition: none !important;
    animation: none !important;
  }
}

/* ================= PRINT (por si exportas) ================= */
@media (max-width: 768px) {
  body {
    padding-top: 100px;
    padding-bottom: 70px;
  }
}

/* ================= EXTRAS VISUALES PARA LA SECCIÓN (NO ROMPEN NADA) ================= */
.badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 77, 77, 0.14);
  color: var(--red);
  border: 1px solid rgba(255, 77, 77, 0.3);
}
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.divisor-luminoso {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 77, 77, 0.5),
    transparent
  );
  margin: 1.25rem 0;
}

/* ================= VARIANTES DE TARJETA (COHERENTES CON TU SISTEMA DE COLORES) ================= */
.tarjeta.variant-red {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(255, 77, 77, 0.12),
    0 0 22px rgba(255, 77, 77, 0.22);
}
.tarjeta.variant-blue {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(30, 144, 255, 0.12),
    0 0 22px rgba(30, 144, 255, 0.22);
}
.tarjeta.variant-green {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.12),
    0 0 22px rgba(46, 204, 113, 0.22);
}
.tarjeta.variant-yellow {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.12),
    0 0 22px rgba(241, 196, 15, 0.22);
}

/* ================= BOTONES PEQUEÑOS UNIFORMES ================= */
.btn-xs {
  padding: 0.28rem 0.5rem;
  font-size: 0.72rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: rgba(255, 77, 77, 0.8);
}
.btn-danger:hover {
  filter: brightness(1.05);
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.05);
}

/* ================= CABECERA DE SECCIÓN ================= */
.section-header {
  display: grid;
  place-items: center;
  margin: 2rem 0 1rem;
}
.section-header .title {
  color: var(--red);
  font-weight: 900;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
  text-shadow: 0 0 10px rgba(255, 77, 77, 0.45);
}
.section-header .subtitle {
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ================= ESTILOS SOBRESCRITOS SEGÚN TU CAPTURA ================= */
h1,
h2 {
  color: var(--primary);
}
h1.titulo-principal,
.seccion-guias h2,
.titulo-modal {
  color: var(--red);
}

/* ================= FOOTER ================= */
footer {
  background-color: #212529;
  color: var(--text-soft);
  text-align: center;
  padding: 0.5rem 0.5rem; /* más alto */
  border-top: 1px solid rgba(255, 77, 77, 0.25);
  box-shadow: 0 -4px 12px #212529;
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 1rem; /* un poquito más grande */
  font-weight: 500;
  z-index: 999;
}
footer p {
  margin: 0;
  letter-spacing: 0.5px; /* le da más aire al texto */
}
/* ================= RESPONSIVE ================= */

/* Tablet grande / desktop mediano */
@media (max-width: 1024px) {
  .contenedor-guias {
    gap: 1.5rem;
  }
  .tarjeta {
    flex: 1 1 min(200px, 100%);
    max-width: 100%;
  }
  .tarjeta-guia {
    width: min(220px, 92vw); /* ya tienes esto */
  }
}
@media (max-width: 640px) {
  .form-row,
  .formulario .fila,
  .formulario .grupo {
    grid-template-columns: 1fr;
  }
}
.contenedor-apuntes,
.contenedor-guias {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
/* Tablet / pantalla mediana */
@media (max-width: 768px) {
  .encabezado {
    padding: 0.8rem;
  }
  .seccion-guias h2 {
    font-size: 2rem;
  }
  .tarjeta {
    width: 46%;
    min-width: 200px;
  }
}

/* Smartphones / pantallas pequeñas */
@media (max-width: 560px) {
  .contenedor-apuntes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  .tarjeta {
    width: 100%; /* que ocupen toda la columna */
    max-width: 100%;
  }
  .form-row,
  .formulario .fila,
  .formulario .grupo {
    grid-template-columns: 1fr;
  }
}

/* Extra pequeño: muy móvil */
@media (max-width: 400px) {
  .btn,
  .btn-guia {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
  .tarjeta h3,
  .tarjeta-guia h3 {
    font-size: 1rem;
  }
}

/* BOTÓN REGRESAR CORRECTO */
.btn.regresar {
  .btn.regresar {
    position: relative; /* ya no fixed */
    bottom: auto;
    right: auto;
    margin-left: 10px; /* separación del botón de sesión */
    margin-top: -10px; /* súbelo un poquito */
    background: linear-gradient(180deg, #ff4d4d, #d63333);
    color: #fff;
    padding: 0.45rem 0.9rem; /* mismo tamaño que otros botones */
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.8), 0 0 20px rgba(255, 77, 77, 0.6);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
  }
}

.btn.regresar:hover {
  transform: scale(1.03);
  box-shadow: 0 0 15px rgba(255, 77, 77, 1), 0 0 30px rgba(255, 77, 77, 0.8);
}

.btn.regresar:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.03);
  box-shadow: 0 0 15px rgba(255, 77, 77, 1), 0 0 30px rgba(255, 77, 77, 0.8);
}

/* BOTÓN INICIAR SESIÓN / HEADER RESPONSIVE */
@media (max-width: 768px) {
  .auth-section {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: -3vh; /* empuja los botones hacia abajo del header */
  }
}

.filtros-publico {
  max-width: 700px;
  margin: 6rem 0 2rem 2rem; /* subimos de 3rem a 6rem */
  text-align: left;
}

/* Ajuste para el select */
.filtros-publico select {
  width: 250px; /* ancho del select */
  margin-top: 0.5rem; /* separación superior */
}

@media (max-width: 560px) {
  .filtros-publico {
    margin-left: 1rem;
    margin-top: 4rem; /* subimos de 2rem a 4rem */
    width: 95%;
  }
}
