/* ============================================================
   UIFCE · Cursos Libres — pantalla de acceso
   Sistema de tokens propio de esta pantalla (deliberadamente
   distinto del resto del sitio): réplica fiel de un lenguaje
   visual de login/landing institucional — olive + teal, tarjeta
   flotante, header curvo, insignia circular, botón píldora.
   ============================================================ */

:root {
  /* Paleta */
  --brand-olive: #677d29;
  --brand-olive-deep: #4c5c1e;
  --text-title: #003241;
  --text-subtitle: #005e6f;
  --overlay-tint: #00566f80;
  --surface-card: #fafafa;
  --surface-page: #f6f6f6;
  --border-muted: #a7a7a7;
  --text-body: #262626;

  /* Semánticos (estado, no marca) */
  --success-1: #19784b;
  --success-2: #36b377;
  --warning-1: #d49d00;
  --warning-2: #f2bf2e;
  --error-1: #aa0c00;
  --error-2: #ff1200;
  --info-1: #016d84;
  --info-2: #2bb4cb;

  --font-brand: "Ancizar Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

a { color: var(--text-subtitle); }

:focus-visible {
  outline: 2px solid var(--brand-olive);
  outline-offset: 2px;
}

/* ============================================================
   Lienzo de pantalla completa
   ============================================================ */

.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Fondo fotográfico + overlay de color al 50% de alpha.
   Sustituye por una imagen real de campus con:
   background-image: linear-gradient(var(--overlay-tint), var(--overlay-tint)), url("tu-foto.jpg");
   Mientras tanto, un degradado en la misma paleta simula la
   atmósfera sin usar una fotografía de origen desconocido. */
.bg-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--overlay-tint), var(--overlay-tint)),
    radial-gradient(120% 90% at 15% 0%, #3a5f6b 0%, transparent 55%),
    radial-gradient(120% 100% at 100% 100%, var(--brand-olive-deep) 0%, transparent 60%),
    linear-gradient(160deg, #0d3b47 0%, #14303a 45%, #1c2b22 100%);
}

/* ============================================================
   Header curvo
   ============================================================ */

.header-zone {
  position: relative;
  z-index: 1;
}

.header-curve {
  background: var(--brand-olive);
  border-radius: 0 0 40px 0;
  padding: 34px 24px 74px;
  margin-bottom: -34px;
}

.header-curve-inner {
  max-width: 600px;
  margin: 0 auto;
  padding-left: 116px;
}

.header-kicker {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.header-name {
  margin: 2px 0 0;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
}

.badge-circle {
  position: absolute;
  top: -20px;
  left: 24px;
  z-index: 3;
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-circle img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

/* ============================================================
   Tarjeta central
   ============================================================ */

.card-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Uifcito, la mascota de la UIFCE: saluda anclada al borde derecho
   de la franja superior, fuera de la tarjeta, para no tapar
   información. Se posiciona respecto a .screen (no al viewport),
   así que se desplaza junto con la página en vez de quedar fija
   sobre el contenido al hacer scroll. Solo aparece cuando hay
   espacio de sobra a los lados (escritorio amplio); en
   tablet/móvil, donde la tarjeta ocupa casi todo el ancho, se
   oculta por completo. */
.mascot {
  display: none;
}

@media (min-width: 1024px) {
  .mascot {
    display: block;
    position: absolute;
    top: 4px;
    right: 28px;
    z-index: 3;
    width: 110px;
    height: auto;
    transform: rotate(-8deg);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
  }
}

@media (min-width: 1280px) {
  .mascot {
    right: 56px;
    width: 130px;
  }
}

.card {
  width: 100%;
  max-width: 600px;
  background: var(--surface-card);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

@media (min-width: 640px) {
  .card { padding: 28px; }
}

.card h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.25px;
  color: var(--text-title);
  text-wrap: balance;
}

.card .subtitle {
  margin: -6px 0 0;
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  color: var(--text-subtitle);
  text-wrap: balance;
}

.card p.body-text {
  margin: 4px 0 0;
  max-width: 46ch;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-body);
}

/* ============================================================
   Tarjeta ancha del hub (index) — mismos tokens, más contenido
   ============================================================ */

.card.hub-card {
  max-width: 1040px;
  align-items: stretch;
  gap: 28px;
}

.hub-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-tile {
  background: var(--surface-page);
  border: 1px solid var(--border-muted);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-tile .n {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-olive-deep);
}

.stat-tile .l {
  font-size: 13px;
  color: var(--text-body);
  opacity: 0.75;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.launch-card {
  position: relative;
  background: var(--surface-page);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  padding: 18px 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  text-decoration: none;
  color: var(--text-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.launch-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-olive);
}

.launch-card.special::before { background: var(--text-subtitle); }
.launch-card.map::before     { background: var(--text-title); }

.launch-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-olive);
  box-shadow: var(--shadow-card);
}

.launch-card:active {
  transform: translateY(0) scale(0.99);
}

.launch-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-body);
  opacity: 0.6;
}

.launch-card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.25;
}

.launch-dates {
  margin: -4px 0 0;
  font-size: 13px;
  color: var(--text-body);
  opacity: 0.75;
}

.launch-stats {
  display: flex;
  gap: 18px;
  margin-top: 2px;
}

.launch-stats div {
  display: flex;
  flex-direction: column;
}

.launch-stats .n {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-olive-deep);
}

.launch-stats .l {
  font-size: 11px;
  color: var(--text-body);
  opacity: 0.65;
}

.launch-cta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-subtitle);
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Checkbox de términos
   ============================================================ */

.consent {
  width: 100%;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}

.consent input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--brand-olive);
}

.consent label {
  font-size: 13px;
  color: var(--text-body);
}

.consent a {
  color: var(--text-subtitle);
  text-decoration: underline;
}

/* ============================================================
   Botón principal (píldora)
   ============================================================ */

.btn-pill {
  margin-top: 4px;
  height: 44px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border: 0.8px solid var(--border-muted);
  border-radius: 999px;
  color: var(--text-body);
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.btn-pill:hover:not(:disabled) {
  border-color: var(--brand-olive);
}

.btn-pill:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-pill svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* ============================================================
   Footer
   ============================================================ */

.footer-login {
  position: relative;
  z-index: 1;
  margin-top: auto;
  background: var(--brand-olive-deep);
  color: #fff;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  font-size: 13px;
  font-weight: 400;
}

.footer-inner h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}

.footer-inner p,
.footer-inner ul {
  margin: 0;
  opacity: 0.92;
}

.footer-inner ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-inner a {
  color: #fff;
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* ============================================================
   Banner institucional
   ============================================================ */

.banner-institucional {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

/* ============================================================
   Enlace de regreso
   ============================================================ */

.back-link {
  align-self: flex-start;
  margin: 0;
  font-size: 13px;
}

.back-link a {
  color: var(--text-subtitle);
  text-decoration: none;
  font-weight: 500;
}

.back-link a:hover {
  text-decoration: underline;
}

/* ============================================================
   Filtros (páginas de catálogo)
   ============================================================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.toolbar input[type="search"],
.toolbar select {
  font-family: var(--font-brand);
  font-size: 14px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  background: #fff;
  color: var(--text-body);
}

.toolbar input[type="search"] {
  flex: 1 1 220px;
}

.toolbar select {
  flex: 0 1 190px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-body);
  padding: 0 6px;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-olive);
}

.result-count {
  margin: 0;
  width: 100%;
  font-size: 13px;
  color: var(--text-body);
  opacity: 0.7;
}

/* ============================================================
   Cuadrícula de cursos
   ============================================================ */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.course-card {
  position: relative;
  background: var(--surface-page);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  padding: 18px 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.course-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-olive);
}

.course-card[data-area="Programación y Ciencia de Datos"]::before { background: var(--error-1); }
.course-card[data-area="Sistemas Empresariales y Contables"]::before { background: var(--info-1); }
.course-card[data-area="Base de Datos"]::before { background: var(--warning-1); }

.card-eyebrow {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.area-tag,
.level-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.area-tag {
  background: var(--brand-olive);
  color: #fff;
}

.area-prog { background: var(--error-1); color: #fff; }
.area-sys  { background: var(--info-1); color: #fff; }
.area-db   { background: var(--warning-1); color: var(--text-body); }

.level-tag {
  color: var(--text-body);
  opacity: 0.75;
  border-color: var(--border-muted);
  background: transparent;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-title);
  line-height: 1.3;
}

.card-mode {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--text-body);
  opacity: 0.65;
  min-height: 1.1em;
}

.card-code {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border-muted);
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--text-body);
  opacity: 0.8;
}

.card-meta {
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-muted);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.card-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.card-meta dt {
  color: var(--text-body);
  opacity: 0.6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex: 0 0 auto;
  padding-top: 1px;
}

.card-meta dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
  color: var(--text-body);
}

.card-meta dd.mono {
  font-variant-numeric: tabular-nums;
}

.card-meta .meta-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.card-meta .meta-stack dd {
  text-align: left;
}

.no-results {
  width: 100%;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: var(--text-body);
  opacity: 0.75;
  background: var(--surface-page);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
}

/* ============================================================
   Mapa de rutas
   ============================================================ */

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
}

.track {
  background: var(--surface-page);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  padding: 16px 18px;
  text-align: left;
}

.track-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-title);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-muted);
}

.track-bi    { border-bottom-color: var(--brand-olive); }
.track-prog  { border-bottom-color: var(--error-1); }
.track-sys   { border-bottom-color: var(--info-1); }
.track-db    { border-bottom-color: var(--warning-1); }
.track-other { border-bottom-color: var(--border-muted); }

.track-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.track-level-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-body);
  opacity: 0.6;
  margin-bottom: 3px;
}

.track-level ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.track-level li {
  font-size: 13px;
  color: var(--text-body);
}

.track-empty {
  opacity: 0.5;
}

.map-note {
  margin: 0;
  width: 100%;
  font-size: 13px;
  color: var(--text-body);
  opacity: 0.75;
  text-align: left;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .header-curve-inner {
    padding-left: 0;
    padding-top: 56px;
  }
}
