/* =================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   =================================================================== */
:root {
  --color-primary: #223f8d;      /* Azul principal */
  --color-accent: #ed5f1f;       /* Naranja corporativo (CTAs) */
  --color-dark: #0e1a3b;         /* Azul sombra / Oscuro profundo */
  --color-body-bg: #0e1a3b;      /* Fondo general limpio y elegante */
  
  --color-danger: #eb1c22;
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-header-text: #ffffff;

  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  background-color: var(--color-body-bg);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--color-text);
}

/* =================================================================
   2. HEADER, FOOTER Y NAVEGACIÓN
   =================================================================== */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-primary);
  color: var(--color-header-text);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.global-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header.site-header a,
header.site-header a:link,
header.site-header a:visited,
footer a,
footer a:link,
footer a:visited {
  color: inherit;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--color-header-text);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.logo-desktop { display: none; }
.logo-mobile { display: block; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.profile-link-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ccc;
  vertical-align: middle;
}

/* Iconos de navegación más grandes y visibles */
.nav-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
}

/* Footer elegante con márgenes en escritorio */
footer {
  max-width: 750px;
  margin: 3rem auto;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* =================================================================
   3. FORMULARIOS, CONTENEDORES Y ALERTAS
   =================================================================== */
main, .container, form:not(.form-con-scroll) {
  max-width: 750px;
  margin: 1.5rem auto 3rem auto;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  margin: 20px 0;
}

.auth-form input,
input, select, textarea {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

button[type="submit"] {
  background-color: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.85rem 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

button[type="submit"]:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.alert-error,
.alert-success {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

/* =================================================================
   4. SECCIÓN HERO
   =================================================================== */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin: 3rem auto;
  max-width: 900px;
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  margin-top: 0;
  color: var(--color-primary);
  font-size: 2.2rem;
}

.hero-content h2 {
  font-size: 1.3rem;
  color: var(--color-text);
}

.hero-content p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.hero-image img {
  max-width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =================================================================
   5. MEDIA QUERIES (ADAPTACIÓN MÓVIL Y ESCRITORIO)
   =================================================================== */
@media (max-width: 768px) {
  main, .container, form:not(.form-con-scroll) {
    max-width: 750px;
    margin: 1.5rem auto 3rem auto;
    padding: 0.2rem;
  }
  .auth-form input,
  input, select, textarea {
    width: unset;
  }
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
  }

  .nav-links.active {
    display: flex;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Footer fijo compacto solo en móvil para aprovechar pantalla */
  footer {
    /*position: fixed;*/
    bottom: 0;
    left: 0;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    z-index: 1000;
    background-color: var(--color-dark);
    color: #fff;
    text-align: center;
    padding: 0.75rem;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.3);
  }

  body {
    padding-bottom: 60px;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
    margin: 0.1rem;
  }

  .hero-image {
    display: none;
  }
}

@media (min-width: 769px) {
  .logo-desktop { display: block; }
  .logo-mobile { display: none; }

  .nav-links {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: static;
    background: transparent;
    box-shadow: none;
    width: auto;
    max-height: none;
    overflow-y: visible;
  }
}


@media (max-width: 768px) {
    body.menu-open footer {
        display: none;
    }
    .nav-links.active {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-image {
        display: block;
        width: 100%;
        margin-top: 20px;
    }
    .hero-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }
}
.card-icon-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #fdf3ef;
    color: #ed5f1f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-badge svg {
    width: 14px;
    height: 14px;
    fill: #ed5f1f;
}

.card-badge-nivel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: #ed5f1f;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: auto; /* Empuja el nivel hacia el extremo derecho de la barra */
}
body.modal-open footer {
    display: none;
}