/* ============================================================
   COLECCIONES DIGITALES — Área de Miembros
   Tema oscuro cálido · Paleta del logo (charcoal + dorado + lomos)
   ============================================================ */
:root {
  --bg: #1c1a24;          /* charcoal cálido del logo */
  --bg-2: #232028;
  --card: #29262f;
  --card-2: #312e39;
  --card-3: #383442;
  --border: #3a3644;
  --border-2: #494455;
  --text: #f2eff5;
  --muted: #a6a1b1;
  --muted-2: #837e90;
  --accent: #f4a82c;      /* dorado del "+" */
  --accent-2: #ffc25a;    /* dorado claro */
  --accent-ink: #2a1d05;  /* tinta oscura sobre dorado */
  --danger: #e8492b;      /* rojo de los lomos */
  --ok: #6b8e3d;          /* verde de los lomos */
  --lock: #f4a82c;
  /* Acentos secundarios (lomos de libros) */
  --c-red: #E8492B;
  --c-orange: #E8871E;
  --c-lime: #9BBE3C;
  --c-green: #6B8E3D;
  --c-blue: #3B4A9E;
  --c-indigo: #3D4278;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 12px 34px rgba(0,0,0,.42);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --glow: 0 0 0 1px rgba(244,168,44,.16), 0 14px 40px rgba(244,168,44,.12);
  --ring: 0 0 0 3px rgba(244,168,44,.22);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  /* Capas (de arriba hacia abajo): brillo dorado, brillo azul,
     velo oscuro para legibilidad, PATRÓN (public/bg.png), color base. */
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 50% -14%, rgba(244,168,44,.13) 0%, rgba(244,168,44,0) 55%),
    radial-gradient(760px 420px at 88% 8%, rgba(59,74,158,.10) 0%, rgba(59,74,158,0) 60%),
    linear-gradient(rgba(20,18,26,.55), rgba(20,18,26,.68)),
    url("/bg.png");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center;
  background-attachment: fixed, fixed, fixed, fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-2); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: rgba(244,168,44,.35); color: #fff; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: padding-box; }

.hidden { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 22px;
  background: linear-gradient(180deg, rgba(28,26,36,.92), rgba(28,26,36,.72));
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -18px rgba(0,0,0,.8);
}
.topbar .brand { font-weight: 800; letter-spacing: .2px; display: flex; align-items: center; gap: 12px; }
.topbar .brand .logo {
  width: 40px; height: 40px; flex: none; display: block; object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.5));
}
.topbar .brand .brand-txt { display: flex; flex-direction: column; line-height: 1.08; }
.topbar .brand .brand-txt .b1 { font-size: 15.5px; font-weight: 800; }
.topbar .brand .brand-txt .b2 { font-size: 10px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); margin-top: 1px; }
.topbar .spacer { flex: 1; }
@media (max-width: 520px) { .topbar .brand .brand-txt .b2 { display: none; } .topbar { padding: 12px 16px; } }
.topbar .user {
  color: var(--text); font-size: 13.5px; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); cursor: pointer;
  transition: border-color .15s;
}
.topbar .user:hover { border-color: var(--accent); }
.topbar .user::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.container { max-width: 1180px; margin: 0 auto; padding: 30px 22px 96px; }
@media (max-width: 520px) { .container { padding: 22px 16px 80px; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--card-2); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 700;
  transition: transform .12s ease, border-color .15s, background .15s, box-shadow .15s; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: var(--accent-ink);
  box-shadow: 0 10px 26px -10px rgba(244,168,44,.7), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 14px 30px -8px rgba(244,168,44,.8), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(232,73,43,.4); color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: rgba(232,73,43,.08); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.wa { background: #25D366; border: none; color: #05270f; box-shadow: 0 10px 24px -10px rgba(37,211,102,.7); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card {
  position: relative; width: 100%; max-width: 410px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 34px 30px 30px;
  animation: rise .5s cubic-bezier(.2,.8,.2,1);
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 21px; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(244,168,44,.5), rgba(244,168,44,0) 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Marca en login ---------- */
.brand-hero { text-align: center; margin-bottom: 22px; }
.brand-hero .logo {
  width: 112px; height: 112px; margin: 0 auto 16px; display: block; object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(244,168,44,.28));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.brand-hero .name { font-size: 23px; font-weight: 800; letter-spacing: .2px; margin: 0; }
.brand-hero .name b { color: var(--accent); font-weight: 800; }
.brand-hero .kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); margin: 7px 0 0; }
.login-card .divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-2), transparent); margin: 2px 0 20px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; font-weight: 600; letter-spacing: .2px; }
.input, textarea, select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 13px; border-radius: var(--radius-sm); font-size: 14px; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, textarea::placeholder { color: var(--muted-2); }
.input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); background: #26232c; }
select { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }
.forgot-row { text-align: center; margin-top: 14px; }
.linklike {
  background: none; border: none; color: var(--accent-2); cursor: pointer;
  font-size: 13.5px; font-weight: 600; font-family: inherit; padding: 4px; text-decoration: none;
}
.linklike:hover { color: var(--accent); text-decoration: underline; }
.form-ok { color: var(--ok); font-size: 13px; margin-top: 8px; }

/* ---------- Grupos de áreas (colecciones) ---------- */
.group-block { margin-bottom: 54px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); position: relative; flex-wrap: wrap; }
.group-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 68px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px rgba(244,168,44,.55); }
.group-title {
  margin: 0; font-size: 26px; font-weight: 800; letter-spacing: .2px;
  display: inline-flex; align-items: center; gap: 12px;
}
.group-title::before {
  content: "📚"; font-size: 20px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.4));
}
.group-title.unlocked-title::before { content: "🔓"; }
.group-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.group-areas { display: flex; flex-direction: column; gap: 26px; }
@media (max-width: 520px) { .group-title { font-size: 22px; } }

/* ---------- Áreas / secciones ---------- */
.area-block { margin-bottom: 46px; }
.area-block.in-group { margin-bottom: 0; }
.area-block.in-group .area-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.area-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.area-head h2 { margin: 0; font-size: 21px; letter-spacing: .2px; }
.area-head .subtitle { color: var(--muted); font-size: 14px; }
.area-head + .area-sep { height: 1px; background: linear-gradient(90deg, var(--border-2), transparent); margin: 12px 0 18px; }
.badge {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
}
.badge.locked { background: rgba(244,168,44,.14); color: var(--lock); border: 1px solid rgba(244,168,44,.32); }
.badge.locked::before { content: "🔒"; font-size: 10px; }

.section-title { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .9px; margin: 22px 0 14px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 15px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); flex: none; box-shadow: 0 0 12px rgba(244,168,44,.5); }

/* ---------- Grid de posters 3:4 ---------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
/* En mobile: siempre 2 columnas para poder ir bajando cómodo */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .poster .meta { padding: 9px 10px 11px; }
  .poster .meta .t { font-size: 13px; line-height: 1.22; }
  .poster .meta .c { font-size: 11px; }
  .poster .lock-ico { width: 30px; height: 30px; font-size: 14px; top: 8px; right: 8px; }
}
.poster {
  position: relative; cursor: pointer; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--card);
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
  box-shadow: 0 6px 18px -8px rgba(0,0,0,.6);
}
.poster:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--glow), 0 18px 40px -16px rgba(0,0,0,.7); }
.poster .thumb {
  position: relative; aspect-ratio: 3 / 4; width: 100%; object-fit: cover; overflow: hidden;
  display: grid; place-items: center;
  font-size: 52px; font-weight: 800; color: rgba(255,255,255,.92);
  text-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.poster .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.poster:hover .thumb img { transform: scale(1.06); }
.poster .thumb::after { /* sheen sutil arriba */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 28%, rgba(0,0,0,.18));
}
/* Lomos de libros: colores de marca rotando en placeholders */
.grid .poster:nth-child(6n+1) .thumb { background: linear-gradient(150deg, var(--c-blue), #2a2735); }
.grid .poster:nth-child(6n+2) .thumb { background: linear-gradient(150deg, var(--c-red), #2a2735); }
.grid .poster:nth-child(6n+3) .thumb { background: linear-gradient(150deg, var(--c-lime), #2a2735); }
.grid .poster:nth-child(6n+4) .thumb { background: linear-gradient(150deg, var(--c-orange), #2a2735); }
.grid .poster:nth-child(6n+5) .thumb { background: linear-gradient(150deg, var(--c-green), #2a2735); }
.grid .poster:nth-child(6n+6) .thumb { background: linear-gradient(150deg, var(--c-indigo), #2a2735); }
.poster .meta { padding: 12px 13px 14px; background: var(--card); }
.poster .meta .t { font-size: 14px; font-weight: 700; line-height: 1.28; }
.poster .meta .c { color: var(--muted); font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; }
.poster .meta .c::before { content: "▶"; font-size: 8px; color: var(--accent); }
.poster.area-poster .meta .c::before { content: "📚"; font-size: 10px; }
.poster .meta .s2 { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.3; }
.poster.locked .thumb { filter: saturate(.5) brightness(.7); }
.poster.locked::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,26,.45), rgba(20,18,26,.68)); backdrop-filter: blur(1px);
}
.poster .lock-ico {
  position: absolute; top: 11px; right: 11px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(28,26,36,.7); border: 1px solid rgba(244,168,44,.55); font-size: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
}

/* ---------- Vista clase / módulo ---------- */
.back-row { margin-bottom: 22px; }
.view-head { margin-bottom: 8px; }
.view-head h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: .2px; }
.view-head .sub { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.class-list { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; }
.class-item {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 13px;
  transition: transform .14s ease, border-color .15s, background .15s;
  overflow: hidden;
}
.class-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.class-item:hover { border-color: var(--accent); transform: translateX(3px); background: var(--card-2); }
.class-item:hover::before { opacity: 1; }
.class-item .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); font-size: 18px; flex: none; border: 1px solid var(--border); }
.class-item .t { font-weight: 700; }
.class-item .s { color: var(--muted); font-size: 13px; margin-top: 2px; }

.class-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin: 16px 0; box-shadow: var(--shadow); }
.body-text { line-height: 1.75; color: #dcd8e4; white-space: pre-wrap; margin: 18px 0; font-size: 15.5px; }

.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.video-frame iframe, .video-frame video, .video-frame > div { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }

.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

/* ---------- Popup ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(12,10,16,.72); backdrop-filter: blur(6px); padding: 20px;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 430px;
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 30px 28px; text-align: center;
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.modal .lock-big {
  width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; background: radial-gradient(circle at 50% 35%, rgba(244,168,44,.28), rgba(244,168,44,.08));
  border: 1px solid rgba(244,168,44,.4);
}
.modal h3 { margin: 0 0 10px; font-size: 21px; }
.modal p { color: var(--muted); margin: 0 0 22px; line-height: 1.6; }
.modal .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* Portada del área (poster 3:4) a todo color dentro del popup de bloqueo */
.lock-cover {
  display: block; width: 190px; max-width: 62%; aspect-ratio: 3 / 4; object-fit: cover;
  margin: 0 auto 18px; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* Modal Mi cuenta */
.account-modal { max-width: 440px; }
.account-modal .acct-avatar {
  width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; background: radial-gradient(circle at 50% 35%, rgba(244,168,44,.28), rgba(244,168,44,.08));
  border: 1px solid rgba(244,168,44,.4);
}
.account-modal .acct-section { font-weight: 700; text-align: left; margin: 4px 0 14px; }
.account-modal .field { text-align: left; }
.account-modal .form-error { text-align: left; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.tab { padding: 10px 18px; cursor: pointer; color: var(--muted); border-radius: 10px; font-weight: 700; font-size: 14px; transition: color .15s, background .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px -10px rgba(244,168,44,.7); }
.panel-card { background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: 0 8px 24px -14px rgba(0,0,0,.6); }
.panel-card h3 { margin: 0 0 18px; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.panel-card h3::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); flex: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row, .row-3 { grid-template-columns: 1fr; } }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.list-item:hover { border-color: var(--border-2); background: #26232c; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow .t { font-weight: 700; }
.list-item .grow .s { color: var(--muted); font-size: 13px; word-break: break-word; margin-top: 2px; }
.pill { font-size: 12px; background: var(--card-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.pill.id { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent-2); border-color: rgba(244,168,44,.3); background: rgba(244,168,44,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chip { font-size: 12.5px; background: var(--card-2); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); color: var(--accent-2); background: rgba(244,168,44,.1); }
.chip.area { display: inline-flex; align-items: center; gap: 7px; }
.chip.area .x { color: var(--danger); font-weight: 800; cursor: pointer; }

.cover-preview { width: 92px; aspect-ratio: 3/4; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); background: var(--card-2); flex: none; }
.uploading { color: var(--accent-2); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.hint b { color: var(--muted); }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(0);
  background: var(--card-2); border: 1px solid var(--border-2); padding: 13px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 100; font-size: 14px; max-width: 90vw; font-weight: 600;
  animation: toastIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.toast.ok { border-color: var(--ok); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(107,142,61,.3); }
.toast.err { border-color: var(--danger); color: #ffb9ab; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Editor de texto enriquecido (admin) ---------- */
.rte { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.rte-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; background: var(--card-2); border-bottom: 1px solid var(--border);
}
.rte-btn {
  border: 1px solid var(--border-2); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 11px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  line-height: 1; transition: border-color .15s, background .15s;
}
.rte-btn:hover { border-color: var(--accent); background: #26232c; }
.rte-btn:active { transform: translateY(1px); }
.rte-select {
  border: 1px solid var(--border-2); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 9px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  line-height: 1; width: auto; min-width: 92px;
}
.rte-select:hover { border-color: var(--accent); }
.rte-sep { width: 1px; height: 20px; background: var(--border-2); margin: 0 3px; }
.rte-area {
  min-height: 140px; max-height: 460px; overflow-y: auto;
  padding: 13px 15px; font-size: 14px; line-height: 1.65; color: var(--text); outline: none;
}
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted-2); }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(244,168,44,.22); }
.rte-area img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; cursor: pointer; }
.rte-area img.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.rte-area a { color: var(--accent-2); }

/* ---------- Descripción de módulo (cliente) ---------- */
.module-h { font-size: 19px; margin: 24px 0 8px; }
.module-desc { line-height: 1.7; color: #d9d3e2; font-size: 15px; margin: 8px 0 28px; word-break: break-word; }
.module-desc :first-child { margin-top: 0; }
.module-desc :last-child { margin-bottom: 0; }
.module-desc p { margin: 0 0 12px; }
.module-desc b, .module-desc strong { color: var(--text); font-weight: 800; }
.module-desc img {
  max-width: 100%; height: auto; border-radius: 14px; margin: 14px 0;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.module-desc a { color: var(--accent-2); }

/* ---------- Área "paquete" (acceso a todo el grupo) ---------- */
.poster { position: relative; }
.bundle-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .2px;
  color: var(--accent-ink); padding: 5px 9px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(244,168,44,.8);
  max-width: calc(100% - 20px);
}
.area-poster.locked .bundle-badge { z-index: 3; }

/* Casilla de opción en formularios del admin */
label.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text); }
label.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; }
