/* ==================================================================
   ROWAN · Cookie banner + modal de modos + páginas legales
   Hereda variables del tema activo (--surface, --text, --muted, --accent).
   ================================================================== */

/* ---------- COOKIE BANNER ---------- */
.rwn-cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999;
  max-width: 720px; margin: 0 auto;
  background: var(--surface, #1e2130);
  border: 1px solid var(--line, #2a2e3d);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 13.5px; color: var(--text, #f2efe8);
  display: none;
  animation: rwn-cookie-in .35s cubic-bezier(.2,.7,.3,1);
}
.rwn-cookie.show { display: block }
@keyframes rwn-cookie-in {
  from { transform: translateY(20px); opacity: 0 }
  to   { transform: translateY(0); opacity: 1 }
}
.rwn-cookie__title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px;
  margin: 0 0 6px; letter-spacing: -.01em;
}
.rwn-cookie__body {
  color: var(--muted, #b9bbcc); line-height: 1.5; margin: 0 0 14px;
}
.rwn-cookie__body a {
  color: var(--accent, #e5b56b); text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent, #e5b56b) 40%, transparent);
}
.rwn-cookie__body a:hover { color: var(--accent, #e5b56b) }
.rwn-cookie__actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.rwn-cookie__btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line, #2a2e3d);
  background: transparent; color: var(--muted, #b9bbcc);
  transition: all .15s;
}
.rwn-cookie__btn:hover { color: var(--text, #f2efe8); border-color: var(--accent, #e5b56b) }
.rwn-cookie__btn--primary {
  background: var(--accent, #e5b56b); color: #0a0b10;
  border-color: var(--accent, #e5b56b);
}
.rwn-cookie__btn--primary:hover { filter: brightness(1.08); color: #0a0b10 }
.rwn-cookie__small { font-size: 11.5px; color: var(--muted, #8b8da3); margin-left: auto }
.rwn-cookie__small a {
  color: var(--accent, #e5b56b);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent, #e5b56b) 40%, transparent);
  padding-bottom: 1px;
}
.rwn-cookie__small a:hover { color: var(--accent, #e5b56b); filter: brightness(1.1) }

.rwn-cookie__details {
  display: none; margin: 14px 0 16px; padding: 14px;
  background: color-mix(in oklab, var(--text, #f2efe8) 5%, transparent);
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--text, #f2efe8) 14%, transparent);
}
.rwn-cookie__details.open { display: block }
.rwn-cookie__row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--line, #2a2e3d) 60%, transparent);
}
.rwn-cookie__row:last-child { border-bottom: 0 }
.rwn-cookie__row label { flex: 1; font-size: 13px }
.rwn-cookie__row .desc { display: block; color: var(--muted, #8b8da3); font-size: 12px; margin-top: 2px }
.rwn-cookie__row input[type=checkbox] {
  appearance: none; width: 36px; height: 20px; border-radius: 999px;
  background: #444a5e; position: relative; cursor: pointer; transition: background .15s;
  flex-shrink: 0;
}
.rwn-cookie__row input[type=checkbox]:checked { background: var(--accent, #e5b56b) }
.rwn-cookie__row input[type=checkbox]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.rwn-cookie__row input[type=checkbox]:checked::after { transform: translateX(16px) }
.rwn-cookie__row input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed }

@media (max-width: 540px) {
  .rwn-cookie { left: 10px; right: 10px; bottom: 10px; padding: 16px }
  .rwn-cookie__actions { flex-direction: column; align-items: stretch }
  .rwn-cookie__btn { width: 100% }
  .rwn-cookie__small { margin-left: 0; text-align: center; order: -1; margin-bottom: 4px }
}

/* ---------- MODAL MODOS DE VISUALIZACIÓN ---------- */
.rwn-modes-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: none; align-items: center; justify-content: center;
  background: rgba(5,6,10,.78);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  padding: 24px;
  animation: rwn-fade-in .25s ease-out;
}
[data-theme="light"] .rwn-modes-modal { background: rgba(28,29,35,.62) }
.rwn-modes-modal.show { display: flex }
@keyframes rwn-fade-in { from{opacity:0} to{opacity:1} }
.rwn-modes-modal__box {
  background: var(--surface, #1e2130);
  border: 1px solid var(--line, #2a2e3d);
  border-radius: 18px;
  max-width: 720px; width: 100%;
  padding: 36px 40px 28px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.7);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  color: var(--text, #f2efe8);
  position: relative;
  animation: rwn-modal-up .35s cubic-bezier(.2,.7,.3,1);
}
@keyframes rwn-modal-up {
  from { transform: translateY(30px) scale(.97); opacity: 0 }
  to   { transform: translateY(0) scale(1); opacity: 1 }
}
.rwn-modes-modal__tag {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  background: #0a0b10; color: var(--accent, #e5b56b);
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px;
}
.rwn-modes-modal__title {
  font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1.15; margin: 0 0 8px;
}
.rwn-modes-modal__lead {
  color: var(--text-dim, #cdd2e2);
  font-size: 14.5px; line-height: 1.55; margin: 0 0 22px;
  opacity: .92;
}
.rwn-modes-modal__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 22px;
}
@media (max-width: 540px) {
  .rwn-modes-modal__box { padding: 26px 22px 20px }
  .rwn-modes-modal__grid { grid-template-columns: 1fr }
}
.rwn-mode {
  border: 1px solid color-mix(in oklab, var(--text, #f2efe8) 14%, transparent);
  border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; transition: all .15s;
  background: color-mix(in oklab, var(--text, #f2efe8) 6%, transparent);
}
.rwn-mode:hover {
  border-color: var(--accent, #e5b56b);
  background: color-mix(in oklab, var(--accent, #e5b56b) 12%, transparent);
}
.rwn-mode__ico {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  display: grid; place-items: center; color: var(--accent, #e5b56b);
  background: color-mix(in oklab, var(--accent, #e5b56b) 12%, transparent);
}
.rwn-mode__ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: .92 }
.rwn-mode__name {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14.5px;
  color: var(--text, #f2efe8);
  margin: 0 0 5px;
}
.rwn-mode__desc {
  /* Antes usaba var(--muted) — apenas se distinguía del fondo oscuro del
     modal en moderno. Forzamos un gris más claro garantizando contraste. */
  color: var(--text-dim, #cdd2e2);
  font-size: 13px; line-height: 1.45; margin: 0;
  opacity: .92;
}
.rwn-modes-modal__progress {
  position: relative; height: 3px; background: rgba(255,255,255,.06);
  border-radius: 2px; overflow: hidden; margin: 0 0 18px;
}
.rwn-modes-modal__progress::after {
  content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent, #e5b56b), color-mix(in oklab, var(--accent, #e5b56b) 50%, transparent));
  animation: rwn-progress var(--rwn-modal-timeout, 8s) linear forwards;
}
@keyframes rwn-progress { from{width:0%} to{width:100%} }
.rwn-modes-modal__progress.paused::after { animation-play-state: paused }
.rwn-modes-modal__actions {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
.rwn-modes-modal__btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line, #2a2e3d); background: transparent;
  color: var(--muted, #b9bbcc); transition: all .15s;
}
.rwn-modes-modal__btn:hover { color: var(--text, #f2efe8); border-color: var(--accent, #e5b56b) }
.rwn-modes-modal__btn--primary {
  background: var(--accent, #e5b56b); color: #0a0b10;
  border-color: var(--accent, #e5b56b);
}
.rwn-modes-modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line, #2a2e3d);
  color: var(--muted, #b9bbcc); display: grid; place-items: center;
  font-size: 18px; line-height: 1; padding: 0;
}
.rwn-modes-modal__close:hover { color: var(--text, #f2efe8); border-color: var(--accent, #e5b56b) }

/* ---------- FOOTER GLOBAL ---------- */
.rwn-footer {
  border-top: 1px solid var(--line, #2a2e3d);
  /* Fondo que respeta el tema activo en vez de ser oscuro fijo */
  background: var(--surface, #12141c);
  padding: 32px 24px 22px;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 12.5px; color: var(--muted, #b9bbcc);
}
.rwn-footer__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px;
}
@media (max-width: 820px) { .rwn-footer__inner { grid-template-columns: 1fr 1fr; gap: 24px } }
@media (max-width: 480px) { .rwn-footer__inner { grid-template-columns: 1fr; gap: 20px } }

/* Encabezados de columna: capitalize (no full uppercase) y más sutiles */
.rwn-footer h4 {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 11.5px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--accent, #e5b56b);
  margin: 0 0 10px; font-weight: 700;
}

/* Logo en lugar del wordmark de texto. Dos versiones según tema. */
.rwn-footer__brand {
  display: inline-flex; align-items: center;
  margin: 0 0 10px; text-decoration: none;
}
.rwn-footer__logo {
  height: 24px; width: auto; display: block;
}
.rwn-footer__logo--light { display: none }
[data-theme="light"] .rwn-footer__logo--dark { display: none }
[data-theme="light"] .rwn-footer__logo--light { display: block }

.rwn-footer__lead {
  color: var(--muted, #b9bbcc); font-size: 12.5px; line-height: 1.5;
  margin: 0 0 10px; max-width: 38ch;
}
.rwn-footer__contact { font-size: 12.5px; margin: 0; line-height: 1.7 }

.rwn-footer ul { list-style: none; padding: 0; margin: 0 }
.rwn-footer li { margin: 0 0 5px }
.rwn-footer a {
  display: inline-block;
  color: var(--muted, #b9bbcc); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color .15s, border-bottom-color .15s;
  font-size: 12.5px;
}
.rwn-footer a:hover { color: var(--text, #f2efe8); border-bottom-color: var(--accent, #e5b56b) }
.rwn-footer__bottom {
  max-width: 1200px; margin: 22px auto 0; padding-top: 16px;
  border-top: 1px solid color-mix(in oklab, var(--line, #2a2e3d) 60%, transparent);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: 11.5px; color: var(--muted, #8b8da3);
}
.rwn-footer__bottom a { font-size: 11.5px }

/* ---------- PÁGINAS LEGALES ---------- */
.legal-page {
  max-width: 760px; margin: 0 auto; padding: 60px 24px 80px;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  color: var(--text, #f2efe8); line-height: 1.65;
}
.legal-page__tag {
  display: inline-block; padding: 4px 12px; border-radius: 4px;
  background: rgba(229,181,107,.12); color: var(--accent, #e5b56b);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; margin: 0 0 18px;
}
.legal-page h1 {
  font-family: 'Syne', sans-serif; font-size: clamp(34px, 5vw, 48px);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 16px;
}
.legal-page__updated {
  color: var(--muted, #8b8da3); font-size: 13px; margin: 0 0 36px;
  padding-bottom: 24px; border-bottom: 1px solid var(--line, #2a2e3d);
}
.legal-page h2 {
  font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700;
  margin: 36px 0 12px; letter-spacing: -.01em;
}
.legal-page h3 {
  font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700;
  margin: 24px 0 8px;
}
.legal-page p, .legal-page li { color: var(--text, #f2efe8); font-size: 15px }
.legal-page ul, .legal-page ol { padding-left: 24px; margin: 12px 0 }
.legal-page li { margin: 6px 0 }
.legal-page a {
  color: var(--accent, #e5b56b); text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent, #e5b56b) 40%, transparent);
}
.legal-page a:hover { color: var(--accent, #e5b56b); filter: brightness(1.1) }
.legal-page table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 14px;
}
.legal-page th, .legal-page td {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line, #2a2e3d); vertical-align: top;
}
.legal-page th {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  color: var(--muted, #b9bbcc); background: rgba(0,0,0,.18);
}
.legal-page__nav {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 36px;
}
.legal-page__nav a {
  font-size: 12.5px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--line, #2a2e3d);
  color: var(--muted, #b9bbcc); border-bottom-color: var(--line, #2a2e3d);
}
.legal-page__nav a:hover { border-color: var(--accent, #e5b56b); color: var(--text, #f2efe8) }
.legal-page__nav a.is-current {
  border-color: var(--accent, #e5b56b); color: var(--accent, #e5b56b);
  background: rgba(229,181,107,.08);
}
