/* =========================================================
   Bernabeu Integra · Cursos
   Misma marca que la web principal:
   Azul petróleo #0E3D45 · Verde #5FA08F · Ámbar #F2A33A · Gris claro #E8EDEB · Manrope
   ========================================================= */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --petrol: #0E3D45; --petrol-700: #15535D; --petrol-900: #0A2E34;
  --green: #5FA08F; --green-text: #2F6E5E; --green-soft: #9FD0C2; --green-bg: #E4F1ED;
  --amber: #F2A33A; --amber-hover: #F5B358; --amber-bg: #FDF1DF;
  --grey: #E8EDEB; --bg: #F7F9F8; --white: #FFFFFF;
  --ink: #12262A; --ink-2: #34484C; --muted: #4A5D61; --line: #E1E8E6; --on-dark: #C9D6D3;
  --danger: #B3261E; --danger-bg: #FCE8E6;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px; --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--petrol); }
a:hover { color: var(--green-text); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; background: var(--grey); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--amber); color: var(--petrol); padding: 12px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 16px; }

.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-text); }
.h1 { margin-top: 6px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; font-weight: 800; color: var(--petrol); }
.h2 { margin: 40px 0 16px; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; color: var(--petrol); }
.h3 { font-size: 19px; font-weight: 800; color: var(--petrol); }
.h4 { margin: 20px 0 10px; font-size: 15px; font-weight: 800; color: var(--ink-2); }
.lead { margin-top: 12px; font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 760px; }
.muted { color: var(--muted); }
.pequeno { font-size: 14px; }
.migas { margin-bottom: 16px; font-size: 15px; }
.migas a { text-decoration: none; font-weight: 600; }

/* ---------- Botones (como en la web principal) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 10px; font-family: var(--font); font-weight: 700; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; text-align: center; }
.btn:hover { transform: translateY(-1px); }
.btn--amber { background: var(--amber); color: var(--petrol); }
.btn--amber:hover { background: var(--amber-hover); color: var(--petrol); }
.btn--petrol { background: var(--petrol); color: var(--white); }
.btn--petrol:hover { background: var(--petrol-700); color: var(--white); }
.btn--line { background: var(--white); color: var(--petrol); border: 1.5px solid #C5D3CF; }
.btn--line:hover { border-color: var(--petrol); color: var(--petrol); }
.btn--peligro { background: var(--danger); color: var(--white); }
.btn--peligro:hover { background: #8F1E18; color: var(--white); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 15px; }

/* ---------- Cabecera y pie ---------- */
.header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--petrol); flex: none; }
.brand__logo { height: 48px; width: auto; }
.brand__tag { font-weight: 700; font-size: 14px; color: var(--green-text); border-left: 1.5px solid var(--line); padding-left: 12px; }
.nav { display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 2px; }
.nav a:hover { color: var(--green-text); }
.nav__salir { margin: 0; }

.main { flex: 1; padding: 36px 0 64px; }
.footer { background: var(--petrol-900); color: var(--on-dark); padding: 28px 0; font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer a { color: var(--white); }

/* ---------- Avisos, tarjetas, chips ---------- */
.aviso { margin: 0 0 20px; padding: 14px 18px; border-radius: 10px; font-weight: 600; border: 1px solid; }
.aviso--ok { background: var(--green-bg); border-color: #BFDDD4; color: #1F5547; }
.aviso--error { background: var(--danger-bg); border-color: #F2C4C0; color: #8C1D17; }
.aviso--info { background: var(--amber-bg); border-color: #F4D6A8; color: #6B4508; }
.form .aviso { margin: 0; }

.tarjeta { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.tarjeta--centro { text-align: center; max-width: 560px; margin: 40px auto; display: grid; gap: 16px; justify-items: center; }
.tarjeta--enlace { display: grid; gap: 10px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; }
.tarjeta--enlace:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(14,61,69,.08); color: inherit; }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 24px; }
.dos-columnas { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip--ok { background: var(--green-bg); color: var(--green-text); }
.chip--off { background: var(--grey); color: var(--muted); }

/* ---------- Barra de progreso ---------- */
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--grey); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--grey); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.form--ancho { max-width: 640px; }
.form--fila { grid-template-columns: 1fr 1.4fr auto; align-items: end; margin-top: 12px; }
.form__acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.campo { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo > span, .campo > legend { font-weight: 700; font-size: 15px; color: var(--ink-2); padding: 0; }
.campo small { font-weight: 500; }
fieldset.campo { gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, input[type=file] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
  border: 1.5px solid #C5D3CF; border-radius: 10px; padding: 11px 14px; min-height: 48px;
}
input[type=file] { padding: 9px 10px; }
textarea { resize: vertical; min-height: 0; }
input:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(95,160,143,.25); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--petrol); flex: none; }
.en-linea { display: inline; margin: 0; }
.enlace-peligro { background: none; border: 0; color: var(--danger); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; text-decoration: underline; }
.peligro summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.peligro .form { margin-top: 14px; }
.clave { font-size: 16px; padding: 4px 10px; background: var(--white); }

/* ---------- Acceso ---------- */
.acceso { display: grid; place-items: center; padding: 24px 0; }
.acceso__caja { width: 100%; max-width: 440px; display: grid; gap: 16px; padding: 32px; }

/* ---------- Curso ---------- */
.curso-cab { display: grid; gap: 24px; grid-template-columns: 1fr minmax(240px, 320px); align-items: end; }
.progreso { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 10px; }
.progreso__texto { font-size: 16px; }
.progreso__texto strong { color: var(--petrol); }

.destacada { margin-top: 28px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "etq btn" "tit btn"; gap: 6px 20px; align-items: center; background: var(--petrol); color: var(--white); border-radius: var(--radius); padding: 24px 28px; text-decoration: none; transition: background .2s; }
a.destacada:hover { background: var(--petrol-700); color: var(--white); }
.destacada__etiqueta { grid-area: etq; color: var(--green-soft); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.destacada__titulo { grid-area: tit; font-size: clamp(19px, 2.2vw, 24px); font-weight: 800; line-height: 1.25; }
.destacada .btn { grid-area: btn; }
.destacada--fin { grid-template-columns: 1fr; grid-template-areas: "etq" "tit"; background: var(--green-text); }

.sesiones { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sesion-fila { display: flex; align-items: center; gap: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.sesion-fila:hover { border-color: var(--green); color: var(--ink); box-shadow: 0 6px 18px rgba(14,61,69,.06); }
.sesion-fila__estado { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--grey); color: var(--petrol); }
.sesion-fila__texto { flex: 1; display: grid; min-width: 0; }
.sesion-fila__num { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sesion-fila__titulo { font-weight: 700; font-size: 17px; }
.sesion-fila__marca { flex: none; font-size: 14px; font-weight: 700; color: var(--muted); }
.sesion-fila.is-hecha .sesion-fila__estado { background: var(--green); color: var(--white); }
.sesion-fila.is-hecha .sesion-fila__marca { color: var(--green-text); }
.sesion-fila.is-siguiente { border: 2px solid var(--amber); background: #FFFCF6; }
.sesion-fila.is-siguiente .sesion-fila__estado { background: var(--amber); color: var(--petrol); }
.sesion-fila.is-siguiente .sesion-fila__marca { color: #8A5509; }

/* ---------- Sesión ---------- */
.sesion-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.sesion-principal { display: grid; gap: 20px; min-width: 0; }
.reproductor { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.reproductor__video { width: 100%; height: 100%; background: #000; }
.reproductor__vacio, .reproductor__error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--on-dark); background: var(--petrol-900); font-weight: 600; }
.reproductor__error[hidden] { display: none; }
.completar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.completar__estado { flex: 1 1 260px; font-weight: 700; color: var(--petrol); }
.completar__total { flex-basis: 100%; font-size: 14px; }
.texto { font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.materiales__titulo { margin-top: 8px; }
.materiales { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.material { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.material:hover { border-color: var(--green); color: var(--ink); }
.material__icono { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-bg); color: #8A5509; font-weight: 800; font-size: 13px; }
.material__texto { flex: 1; display: grid; min-width: 0; }
.material__texto .muted { font-size: 14px; }
.material__accion { font-weight: 700; color: var(--petrol); font-size: 15px; }
.paginacion { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

.sesion-lateral { position: sticky; top: 96px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.sesion-lateral__titulo { font-weight: 800; color: var(--petrol); margin-bottom: 10px; }
.lista-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lista-mini a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 600; }
.lista-mini a:hover { background: var(--bg); }
.lista-mini a.is-actual { background: var(--grey); color: var(--petrol); }
.lista-mini__marca { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grey); font-size: 13px; font-weight: 800; }
.lista-mini a.is-actual .lista-mini__marca { background: var(--white); }
.lista-mini a.is-hecha .lista-mini__marca { background: var(--green); color: var(--white); }

/* ---------- Panel ---------- */
.cab-acciones { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.cab-acciones .muted { margin-top: 6px; }
.tabla-envoltorio { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabla { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tabla td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td progress { margin-top: 6px; max-width: 140px; }
.tabla tr.is-inactivo td { opacity: .6; }
.tabla a { text-decoration: none; }
.lista-progreso { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; font-size: 15px; }
.lista-progreso li { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lista-progreso li.is-hecha > span:first-child { color: var(--green-text); font-weight: 800; }
.dos-columnas .tarjeta { display: grid; gap: 14px; align-content: start; }
.dos-columnas hr { margin: 6px 0; }
.sesion-admin { margin-bottom: 16px; display: grid; gap: 12px; }
.sesion-admin__cab { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.sesion-admin .h4 { margin: 10px 0 0; }
.materiales-admin { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.materiales-admin li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
form.tarjeta { margin-bottom: 8px; }

/* ---------- Móvil y tableta ---------- */
@media (max-width: 960px) {
  .sesion-layout { grid-template-columns: 1fr; }
  .sesion-lateral { position: static; }
  .curso-cab { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .main { padding: 24px 0 48px; }
  .brand__logo { height: 38px; }
  .brand__tag { display: none; }
  .nav { gap: 4px 12px; }
  .nav a { font-size: 14px; }
  .nav__web { display: none; }
  .tarjeta, .acceso__caja { padding: 20px; }
  .destacada { grid-template-columns: 1fr; grid-template-areas: "etq" "tit" "btn"; padding: 20px; gap: 8px; }
  .destacada .btn { margin-top: 8px; width: 100%; }
  .sesion-fila { padding: 12px 14px; gap: 12px; }
  .sesion-fila__marca { display: none; }
  .reproductor { border-radius: 12px; margin: 0 -4px; }
  .form--fila { grid-template-columns: 1fr; }
  .paginacion .btn { flex: 1; padding: 12px; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .tabla td { padding: 4px 0; border: 0; }
  .tabla td[data-titulo]::before { content: attr(data-titulo) ": "; font-size: 13px; color: var(--muted); font-weight: 600; }
  .tabla td:first-child::before { content: none; }
  .dos-columnas { grid-template-columns: 1fr; }
}
