/* ==========================================================================
   Aula virtual FORUM — aula.forumpolicianacional.es
   Estilo propio (distinto de la app de test): cabecera azul con pestañas,
   Barlow Condensed para titulares y Source Sans 3 para el texto.
   ========================================================================== */

:root {
  --navy: #14213D;
  --navy-2: #1D2D50;
  --navy-3: #2B3A5C;
  --ivory: #F5F3EE;
  --paper: #FAF9F6;
  --white: #FFFFFF;
  --ink: #1B1F2A;
  --muted: #5B6170;
  --soft: #C9D1E3;
  --line: #E3DFD6;
  --line-2: #EEEBE4;
  --gold: #E0A84A;
  --gold-d: #8A5A12;
  --gold-bg: #F6E7C8;
  --gold-ink: #6B4410;
  --red: #B3372F;
  --ok-bg: #DCEBE6;
  --ok-ink: #1F4D40;
  --r: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--ivory);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--navy); }
a:hover { color: var(--gold-d); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.disp { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 700; letter-spacing: .2px; }
.muted { color: var(--muted); }

/* ---------- Cabecera ---------- */
.top { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 20; }
.top-in {
  max-width: 1280px; margin: 0 auto; min-height: 72px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--white); flex-shrink: 0; }
.brand img { height: 48px; width: auto; display: block; }
.brand-sep { width: 1px; height: 32px; background: var(--navy-3); }
.brand-txt { font-size: 15px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.brand:hover { color: var(--white); }

.nav { display: flex; gap: 4px; }
.nav a {
  min-height: 44px; padding: 0 18px; border-radius: 22px; display: flex; align-items: center;
  font-size: 16px; font-weight: 600; color: var(--white); text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: var(--navy-2); color: var(--white); }
.nav a.on { background: var(--white); color: var(--navy); }
.nav .count { margin-left: 6px; background: var(--gold); color: var(--navy); font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }

.me { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.to-app { color: #F3D9A8; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.to-app:hover { color: var(--white); }
.to-app-s { display: none; }
.me-txt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.me-txt b { font-size: 15px; }
.me-txt small { font-size: 13px; color: var(--soft); }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--navy-3); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.salir { background: none; border: 1px solid var(--navy-3); color: var(--soft); border-radius: 20px; min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.salir:hover { color: var(--white); border-color: var(--soft); }

/* ---------- Estructura ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.h1 { margin: 0; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 700; font-size: 44px; line-height: 1.05; color: var(--navy); }
.lead { margin: 6px 0 0; font-size: 18px; color: var(--muted); }
.lead strong { color: var(--navy); }
.h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 24px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.card-navy { background: var(--navy); color: var(--white); border-radius: var(--r); padding: 24px; }
.card-gold { border: 2px solid var(--gold); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

/* ---------- Botones y formularios ---------- */
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--navy); background: var(--white); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:hover { background: var(--ivory); color: var(--navy); }
.btn-p { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-p:hover { background: var(--navy-2); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: #d59a39; color: var(--navy); }
.btn-lg { min-height: 50px; font-size: 16px; padding: 0 26px; }
.btn-sm { min-height: 38px; font-size: 14px; padding: 0 12px; border-color: var(--line); }
.btn-danger { color: var(--red); border-color: var(--line); }
.btn[disabled] { opacity: .7; cursor: default; }

.label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field, select.field, textarea.field {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #CFC9BC; border-radius: 10px;
  background: var(--white); font-size: 16px; color: var(--ink);
}
textarea.field { padding: 12px 14px; line-height: 1.5; min-height: 96px; resize: vertical; }
.field:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(20,33,61,.12); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--navy); }
.error-box { background: #FBEDEC; color: var(--red); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.ok-box { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 12px 14px; font-size: 15px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 42px; padding: 0 16px 0 12px; border-radius: 21px; border: 1px solid #CFC9BC; background: var(--white);
  font-size: 15px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink);
}
.pill::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #9A968C; flex-shrink: 0; }
.pill.on { border: 2px solid var(--navy); background: #E4E9F2; font-weight: 600; }
.pill.on::before { border: 4px solid var(--navy); background: var(--white); }
.pill.plain::before { display: none; }
.pill.plain { padding: 0 16px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--navy); background: var(--white); color: var(--navy); font-size: 15px; font-weight: 600; }
.tabs button.on { background: var(--navy); color: var(--white); }

.drop {
  border: 2px dashed #CFC9BC; border-radius: 14px; background: var(--paper); padding: 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
}
.drop.over { border-color: var(--navy); background: #EEF1F7; }
.drop input { max-width: 100%; font-size: 14px; }

/* ---------- Progreso ---------- */
.bar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.card-navy .bar { background: var(--navy-3); height: 6px; }
.card-navy .bar > span { background: var(--white); }
.bar.gold > span { background: var(--gold); }
.big-pct { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 72px; line-height: 1; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--navy-2); border-radius: 12px; padding: 14px; }
.tile small { display: block; font-size: 13px; color: var(--soft); }
.tile b { font-family: 'Barlow Condensed', sans-serif; font-size: 32px; font-weight: 700; }

/* ---------- Listas de contenidos ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-2);
  width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: var(--ink);
  text-decoration: none;
}
.list > .row:first-child { border-top: 0; }
button.row:hover .fake-btn, a.row:hover .fake-btn { background: var(--ivory); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.row-meta { font-size: 14px; color: var(--muted); }
.fake-btn { min-height: 44px; padding: 0 18px; border: 1px solid var(--navy); border-radius: 10px; display: inline-flex; align-items: center; font-weight: 600; font-size: 15px; color: var(--navy); flex-shrink: 0; }

.chip {
  width: 112px; flex-shrink: 0; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  padding: 7px 0; border-radius: 6px; text-transform: uppercase;
}
.badge { font-size: 12px; font-weight: 700; border-radius: 10px; padding: 3px 10px; white-space: nowrap; flex-shrink: 0; }
.badge-new { color: var(--gold-ink); background: var(--gold-bg); }
.badge-upd { color: var(--white); background: var(--gold-d); }
.badge-off { color: #555; background: #ECECEC; }
.badge-prog { color: #1D3E7A; background: #E4E9F2; }
.badge-line { color: var(--muted); border: 1px solid #D6D1C6; font-weight: 600; }

.visto {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid #D6D1C6; background: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.visto.on { background: var(--navy); border-color: var(--navy); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; background: var(--gold-bg); color: var(--gold-ink); border-radius: 12px; font-size: 16px; line-height: 1.45; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Semana */
.week { display: flex; align-items: center; gap: 18px; padding: 14px 16px; background: var(--ivory); border-radius: 12px; text-decoration: none; color: var(--ink); }
.week + .week { margin-top: 10px; }
.week:hover { background: #EEEBE4; color: var(--ink); }

/* Temario */
.tema-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.tema-card:hover { border-color: var(--navy); color: var(--ink); }
.tema-card.vacio { opacity: .55; }
.tema-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px; color: var(--gold-d); }

/* Dudas */
.duda { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.duda:first-child { border-top: 0; padding-top: 0; }
.duda-q { font-size: 15px; font-weight: 600; line-height: 1.4; }
.duda-a { background: var(--ivory); border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.duda-meta { font-size: 13px; color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 9fr); }
.login-side { background: var(--navy); color: var(--white); padding: 64px 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-side ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 19px; color: #E6EAF3; line-height: 1.4; }
.login-side li { display: flex; gap: 12px; }
.login-side li::before { content: '—'; color: var(--gold); font-weight: 700; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-form { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }

/* Visor */
.visor-page { width: 100%; display: block; background: var(--white); border-radius: 6px; box-shadow: 0 2px 10px rgba(20,33,61,.10); }

.progress { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.btn:not(.btn-p) .spinner { border-color: rgba(20,33,61,.25); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Móvil y tableta ---------- */
@media (max-width: 1100px) {
  .me-txt { display: none; }
  .to-app-l { display: none; }
  .to-app-s { display: inline; }
}
@media (max-width: 900px) {
  .top-in { flex-wrap: wrap; padding: 10px 16px 0; gap: 10px; min-height: 0; }
  .brand img { height: 40px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { min-height: 40px; padding: 0 14px; font-size: 15px; }
  .salir span { display: none; }
  .wrap { padding: 20px 16px 48px; gap: 18px; }
  .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .span2 { grid-column: auto; }
  .stack { gap: 18px; }
  .h1 { font-size: 34px; }
  .lead { font-size: 16px; }
  .card, .card-navy { padding: 18px; }
  .big-pct { font-size: 56px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 28px 20px; gap: 18px; }
  .login-side ul { display: none; }
  .login-side .login-foot { display: none; }
  .login-main { padding: 28px 16px 48px; align-items: flex-start; }
}
@media (max-width: 560px) {
  .brand-sep, .brand-txt { display: none; }
  .row { gap: 12px; }
  .chip { width: 78px; padding: 5px 0; font-size: 10px; letter-spacing: .2px; }
  .row .fake-btn, .row .badge-new { display: none; }
  .row-title { font-size: 15px; }
  .h1 { font-size: 30px; }
}
@media (max-width: 560px) {
  .week .fake-btn { display: none; }
  .week { padding: 12px 14px; }
}

/* ---------- Fichas 3D ---------- */
.scene { perspective: 1400px; width: 100%; max-width: 760px; height: clamp(300px, 52vh, 420px); margin: 0 auto; }
.flipper { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; cursor: pointer; }
.flipper.girada { transform: rotateY(180deg); }
.cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; padding: clamp(22px, 4vw, 40px) clamp(22px, 5vw, 48px); display: flex; flex-direction: column; justify-content: space-between; gap: 14px; overflow: auto; }
.cara-a { background: var(--white); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(20,33,61,.12); }
.cara-b { background: var(--navy); color: var(--white); transform: rotateY(180deg); }
.cara-pista { margin: 0; font-size: clamp(20px, 3.2vw, 28px); line-height: 1.3; font-weight: 600; color: var(--navy); }
.cara-resp { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: clamp(36px, 7vw, 60px); line-height: 1.02; }
.cara-dato { margin: 0; font-size: 17px; line-height: 1.45; color: #E6EAF3; }
.ctrl { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ctrl .btn { min-height: 52px; font-size: 16px; padding: 0 24px; }
.btn-fallo { border-color: var(--gold-d); color: var(--gold-d); }
.btn-fallo:hover { color: var(--gold-d); }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; max-width: 760px; margin: 0 auto; }
.dots span { width: 22px; height: 6px; border-radius: 3px; background: #D6D1C6; }
.dots span.ok { background: var(--navy); }
.dots span.ko { background: var(--gold); }
.dots span.act { outline: 2px solid var(--navy); outline-offset: 2px; }
.mazo-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.mazo-card:hover { border-color: var(--navy); color: var(--ink); }

/* Editor de fichas (panel del preparador) */
.ed-fila { display: grid; grid-template-columns: 28px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.ed-fila textarea.field { min-height: 48px; padding: 10px 12px; font-size: 15px; }
.ed-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; color: var(--gold-d); padding-top: 12px; }
.ed-quitar { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--red); font-size: 20px; line-height: 1; margin-top: 4px; }
.ed-stat { grid-column: 2 / -1; font-size: 13px; color: var(--muted); margin-top: -2px; }
@media (max-width: 900px) {
  .ed-fila { grid-template-columns: 24px minmax(0, 1fr) 40px; }
  .ed-fila .ed-r, .ed-fila .ed-d { grid-column: 2 / 3; }
  .ed-stat { grid-column: 2 / 3; }
}

.grid2 > .ancho { grid-column: 1 / -1; }
