/* ============================================================
   ACADEMIA JOYASOFT — Sistema de diseño
   Paleta y tipografía compartidas con el sitio (ver JOYASOFT-PROJECT-SPEC §4)
   ============================================================ */
:root {
  --blue: #2b579a;
  --blue-dark: #1e3f73;
  --blue-light: #dfe7f7;
  --blue-lighter: #eef2fb;
  --blue-glow: rgba(43, 87, 154, 0.08);
  --gold: #e7b464;
  --gold-dark: #d4a04e;
  --green: #4d9f7d;
  --red: #ca4b31;
  --gray: #787878;
  --gray-border: #e2e2e2;
  --gray-bg: #f7f8fa;
  --black: #1a1a2e;
  --text: #3a3a4a;
  --text-light: #5a5a6a;
  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--gray-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
}

/* ---------- Navbar ---------- */
.ac-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-border);
  box-shadow: 0 1px 12px rgba(26, 26, 46, 0.04);
}
.ac-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.ac-logo img {
  height: 42px;
  width: auto;
}
.ac-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ac-user {
  font-size: 0.88rem;
  color: var(--text-light);
}
.ac-user strong {
  color: var(--black);
  font-weight: 600;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.25s;
}
.btn-primary {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 4px 18px rgba(231, 180, 100, 0.35);
}
.btn-primary:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(231, 180, 100, 0.45);
}
.btn-ghost {
  background: #fff;
  border-color: var(--gray-border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-glow);
}
.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
}
.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Layout principal ---------- */
.ac-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ---------- Banner (encabezado de página) ---------- */
.ac-banner {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  position: relative;
  overflow: hidden;
  padding: 3rem 2rem;
}
.ac-banner::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark), var(--gold));
}
.ac-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 70%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(231, 180, 100, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.ac-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.ac-banner .breadcrumb {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.75rem;
}
.ac-banner .breadcrumb a {
  color: var(--gold);
  text-decoration: none;
}
.ac-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}
.ac-banner p {
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
  max-width: 640px;
  margin: 0.6rem 0 0;
}

/* ---------- Tarjetas de curso ---------- */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.ac-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 1.75rem;
  transition: all 0.3s ease;
}
.ac-card:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 40px rgba(43, 87, 154, 0.12);
  transform: translateY(-3px);
}
.ac-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--blue-lighter);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.ac-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--black);
  margin: 0 0 0.5rem;
}
.ac-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex: 1;
}

/* ---------- Barra de progreso ---------- */
.ac-progress {
  margin: 0 0 1.5rem;
}
.ac-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}
.ac-progress-bar {
  height: 8px;
  border-radius: 100px;
  background: var(--gray-border);
  overflow: hidden;
}
.ac-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: width 0.5s ease;
}
/* Variante sobre el banner azul */
.ac-progress--banner {
  margin: 1.25rem 0 0;
  max-width: 460px;
}
.ac-progress--banner .ac-progress-head {
  color: rgba(255, 255, 255, 0.85);
}
.ac-progress--banner .ac-progress-bar {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Módulos y lecciones ---------- */
.ac-modulo {
  margin-bottom: 2rem;
}
.ac-modulo-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--black);
  margin: 0 0 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--blue-light);
}
.ac-lecciones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ac-leccion {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  transition: all 0.2s;
}
.ac-leccion:hover {
  border-color: var(--blue);
  background: var(--blue-glow);
}
.ac-leccion a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}
.ac-leccion a::before {
  content: "▶";
  color: var(--blue);
  font-size: 0.7rem;
  flex-shrink: 0;
}
.ac-leccion.done {
  border-color: var(--green);
  background: rgba(77, 159, 125, 0.06);
}
.ac-leccion.done a::before {
  content: "✓";
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}
.ac-leccion .tag {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  background: var(--blue-lighter);
  color: var(--blue);
}

/* ---------- Video / lección ---------- */
.ac-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--black);
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 40px rgba(26, 26, 46, 0.18);
}
.ac-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ac-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 720px;
}
.ac-prose p {
  margin: 0 0 1.1rem;
}

/* ---------- Acciones de lección ---------- */
.ac-leccion-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-border);
}
.ac-completar .check {
  color: var(--green);
  font-weight: 700;
}

/* ---------- Login ---------- */
.ac-login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.ac-login-card {
  width: 100%;
  max-width: 410px;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 20px 60px rgba(26, 26, 46, 0.08);
}
.ac-login-card .logo-top {
  display: block;
  margin: 0 auto 1.5rem;
  height: 50px;
}
.ac-login-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--black);
  text-align: center;
  margin: 0 0 0.4rem;
}
.ac-login-card .subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0 0 1.75rem;
}
.ac-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.35rem;
}
.ac-form input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--gray-border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 1.1rem;
  transition: border-color 0.2s;
}
.ac-form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.ac-form .helptext,
.ac-form ul {
  font-size: 0.78rem;
  color: var(--gray);
}
.ac-alert {
  background: #fdecea;
  border: 1px solid #f3c3ba;
  color: var(--red);
  font-size: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.ac-login-alt {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 1.1rem 0 0;
}
.ac-login-alt a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.ac-login-alt a:hover {
  text-decoration: underline;
}

/* ---------- Estado vacío ---------- */
.ac-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.ac-empty h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 0.5rem;
}
.ac-empty .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ---------- Footer ---------- */
.ac-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  color: var(--gray);
  border-top: 1px solid var(--gray-border);
  background: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .ac-navbar {
    padding: 0.75rem 1.25rem;
  }
  .ac-main {
    padding: 1.75rem 1.25rem 3rem;
  }
  .ac-banner {
    padding: 2.25rem 1.25rem;
  }
}
