/* ===== Colores y medidas: cámbialos aquí ===== */
:root {
  --navy: #2b3240;
  --navy-dark: #222834;
  --primary: #ff513a;      /* títulos, botones, números */
  --primary-dark: #e63e28;
  --accent: #ffb81c;       /* franja de las tarjetas, pestaña activa, marco del vídeo */
  --accent-soft: #fff1d1;
  --bg: #fdfbf7;
  --card: #ffffff;
  --text: #333a45;
  --muted: #6b7280;
  --line: #ece7de;
  --box: #eef1f5;
  --ok: #2e9e5b;
  --bad: #d64545;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  /* Fuentes del propio dispositivo: no se descarga nada de Google ni de otros */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ===== Cabecera ===== */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy);
  color: #fff;
}
.header__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 0 16px; height: 60px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; letter-spacing: .3px; white-space: nowrap; }
.logo__img { width: 36px; height: 36px; object-fit: contain; }
.nav { display: flex; gap: 22px; font-weight: 600; font-size: .9rem; margin-left: auto; }
.nav a { opacity: .9; }
.nav a:hover, .nav a.active { color: var(--accent); opacity: 1; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ===== Contenido ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 6px 0; }
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.page-title {
  color: var(--primary); font-size: 1.9rem; font-weight: 800; line-height: 1.25;
  margin: 4px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.intro { color: var(--muted); margin: -8px 0 20px; }

.panel { background: #f5f2ec; border-radius: var(--radius); padding: 16px; }

/* ===== Rejilla de tarjetas ===== */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
/* Columnas fijas por página: 3 en listening y tests, 2 en vídeos */
.grid.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid--2 .card__title { font-size: 1.05rem; }
@media (max-width: 900px) { .grid.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.grid--3, .grid.grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.card:hover .card__title { color: var(--primary); }
.card__title { padding: 14px 16px 18px; color: var(--muted); transition: color .15s; }

/* Miniatura: la imagen de YouTube o, si no hay vídeo, un fondo de color con emoji */
.thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--thumb, linear-gradient(135deg, #5b7db1, #9cc3e6));
  display: flex; align-items: flex-end;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb__emoji {
  position: absolute; inset: 0 0 34px; display: grid; place-items: center;
  font-size: 3.4rem;
}
.thumb__level {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: .72rem; font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.thumb__band {
  position: relative; width: 100%;
  background: var(--accent); color: var(--navy);
  font-weight: 800; text-transform: uppercase; font-size: .8rem; letter-spacing: .3px;
  padding: 6px 10px 6px 40px;
}
.thumb__icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: .6rem;
}

/* ===== Página de test ===== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

.tabs { display: flex; gap: 6px; }
.tab {
  border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem;
  padding: 10px 22px; border-radius: 10px 10px 0 0; background: var(--card); color: var(--text);
}
.tab.active { background: var(--accent); color: var(--navy); }
.tab:not(.active):hover { background: var(--accent-soft); }

.sheet { background: var(--card); border-radius: 0 var(--radius) var(--radius) var(--radius); box-shadow: var(--shadow); padding: 24px; }
.sheet.sheet--solo { border-radius: var(--radius); }
.sheet h2 { color: var(--primary); font-size: 1.1rem; margin: 0 0 14px; }

.instructions { background: var(--box); border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; }

.video { border: 3px solid var(--accent); border-radius: 6px; overflow: hidden; margin-bottom: 26px; background: #000; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video video { display: block; width: 100%; max-height: 70vh; background: #000; }
.audio-box {
  display: flex; align-items: center; gap: 14px; margin-bottom: 26px;
  padding: 16px; border-radius: 12px; background: var(--accent-soft); border: 2px solid var(--accent);
}
.audio-box__icon {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); font-size: 1.4rem;
}
.audio-box audio { width: 100%; min-width: 0; }
.video--empty {background: var(--box); color: var(--muted); padding: 40px 20px; text-align: center; border-style: dashed; }

.question { margin-bottom: 22px; }
.question__text { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: .8rem;
  display: grid; place-items: center;
}
.question select {
  margin-left: 34px; min-width: 220px; max-width: calc(100% - 34px);
  padding: 8px 10px; border: 1px solid #dcdfe4; border-radius: 6px;
  background: #fafafa; font: inherit; color: var(--text);
}
.question select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.question.ok select { border-color: var(--ok); background: #eaf7ef; }
.question.bad select { border-color: var(--bad); background: #fdeeee; }
.question .fix { margin-left: 34px; font-size: .85rem; color: var(--ok); margin-top: 4px; }

.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.btn {
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  padding: 10px 22px; border-radius: 8px; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--box); color: var(--text); }
.btn--ghost:hover { background: #dfe4ea; }
.score { font-weight: 700; }

.transcript p { margin: 0 0 12px; }
.transcript b { color: var(--primary); }

.sidebar { background: #f5f2ec; border-radius: var(--radius); padding: 16px; }
.sidebar h3 { font-size: .95rem; margin: 0 0 12px; font-weight: 600; }
.sidebar .grid { grid-template-columns: 1fr; }

/* ===== Portada (index.html) ===== */
.hero {
  position: relative; color: #fff; text-align: center;
  min-height: min(70vh, 560px);
  display: grid; place-items: center; padding: 60px 16px;
  background: url("../img/hero.jpg") center 30% / cover no-repeat;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(20, 24, 33, .5); }
.hero__inner { position: relative; max-width: 760px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 800; margin: 0; line-height: 1.1; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero__line { width: 110px; height: 6px; background: var(--accent); margin: 18px auto; border-radius: 3px; }
.hero__place { font-weight: 700; font-size: 1.15rem; margin: 0; }
.hero__tag { text-transform: uppercase; letter-spacing: 2px; font-size: .9rem; opacity: .9; margin: 6px 0 26px; }
.hero__buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn--light { background: #fff; color: var(--navy); }
.btn--light:hover { background: var(--accent); }

.section-title {
  text-align: center; color: var(--navy); font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800;
  margin: 48px 0 6px;
}
.section-title + .hero__line { margin: 12px auto 32px; }

/* Accesos: filas de tres, y uno debajo de otro en el móvil */
.access-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1200px; margin: 0 auto;
}
.access__img.access__img--listening { background: linear-gradient(135deg, #ff513a, #ffb81c); }
.access__img.access__img--videos    { background: linear-gradient(135deg, #2b3240, #ff513a); }
.access__img.access__img--tests     { background: linear-gradient(135deg, #ffb81c, #ffe08a); }
.access {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.access:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0, 0, 0, .14); }
.access__img { aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.access__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.access:hover .access__img img { transform: scale(1.05); }
.access__icon { width: 100%; height: 100%; display: grid; place-items: center; font-size: 5rem; }
.access__body { padding: 18px 22px 22px; border-top: 5px solid var(--accent); flex: 1; display: flex; flex-direction: column; }
.access__body h3 { margin: 0 0 6px; font-size: 1.2rem; color: var(--navy); }
.access__body p { margin: 0 0 14px; color: var(--muted); font-size: .95rem; }
.access__more { margin-top: auto; color: var(--primary); font-weight: 700; }
.access:hover .access__more { text-decoration: underline; }

@media (max-width: 900px) {
  .access-grid { gap: 16px; }
  .access__body { padding: 14px 16px 18px; }
  .access__body h3 { font-size: 1.05rem; }
  .access__icon { font-size: 3.6rem; }
}
@media (max-width: 680px) {
  .access-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero { min-height: 60vh; }
}

/* ===== Quién soy (quien-soy.html) ===== */
.hero--small { min-height: min(46vh, 380px); background-image: url("../img/quien-soy-fondo.jpg"); background-position: center 40%; }
.hero--small::before { background: rgba(20, 24, 33, .35); }

.about {
  max-width: 1050px; margin: -70px auto 0; position: relative;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  display: grid; grid-template-columns: 240px 1fr; overflow: hidden; align-items: start;
}
.about__photo { padding: 32px 0 32px 32px; }
.about__photo img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 25%; display: block;
  border-radius: 12px; border-bottom: 5px solid var(--accent);
}
.about__text { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }
.about__text h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--navy); }
.about__role { color: var(--primary); font-weight: 700; margin: 4px 0 0; }
.about__text .hero__line { margin: 16px 0 20px; }
.about__text p { margin: 0 0 14px; font-size: 1.05rem; line-height: 1.65; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 24px; }
.stat { background: var(--accent-soft); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; color: var(--primary); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--text); }

@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; margin-top: -50px; }
  .about__photo { padding: 24px 20px 0; display: flex; justify-content: center; }
  .about__photo img { width: 160px; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--accent); object-position: center 20%; }
  .about__text { text-align: center; }
  .about__text p:not(.about__role) { text-align: left; }
  .about__text .hero__line { margin: 16px auto 20px; }
  .about .hero__buttons { justify-content: center !important; }
  .about__text { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
}

/* ===== Pie ===== */
.footer { background: var(--navy-dark); color: #c9ced8; text-align: center; padding: 24px 16px; margin-top: 40px; font-size: .85rem; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 10px; }
.footer__links a:hover, .linklike:hover { color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ===== Aviso de cookies ===== */
.cookies { position: fixed; inset: auto 0 0 0; z-index: 50; padding: 16px; display: flex; justify-content: center; pointer-events: none; }
.cookies__box {
  pointer-events: auto; width: 100%; max-width: 720px;
  background: #fff; color: var(--text); border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25); border-top: 5px solid var(--accent);
  padding: 20px 22px;
}
.cookies h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--navy); }
.cookies p { margin: 0 0 14px; font-size: .92rem; }
.cookies a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.cookies__settings { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; background: var(--box); border-radius: 10px; font-size: .9rem; }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch input { margin-top: 3px; accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.cookies__buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cookies__buttons .btn { min-width: 120px; }
@media (max-width: 520px) { .cookies__buttons .btn { flex: 1 1 100%; } }

.video--empty .btn { margin: 4px 0 8px; }
.video--empty p { margin: 6px 0; }
.video--empty a { color: var(--primary); text-decoration: underline; }

/* ===== Páginas legales ===== */
.legal { max-width: 820px; margin: 0 auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.legal h2 { color: var(--navy); font-size: 1.15rem; margin: 28px 0 8px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { font-size: .97rem; }
.legal a { color: var(--primary); text-decoration: underline; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 10px 0; }
.legal th, .legal td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.legal th { background: var(--box); }
.legal .table-wrap { overflow-x: auto; }
.legal .updated { color: var(--muted); font-size: .85rem; }
.fill { background: #fff1d1; outline: 1px dashed var(--accent); border-radius: 3px; padding: 0 3px; }
@media (max-width: 680px) { .legal { padding: 20px 16px; } }

/* ===== Móvil ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; margin-left: auto; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--navy); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; }
  .page-title { font-size: 1.5rem; }
  .sheet { padding: 16px; }
}
