/* =========================================================
   legal-ui.css
   UI de confianza / legal / cookies, coherente con Dark Glassmorphism.
   Se carga en todas las páginas (banner de cookies global).
   Incluye: microcopy del formulario, enlaces legales del footer,
   banner de cookies y modal de preferencias.
   ========================================================= */

/* ---------- Microcopy de confianza (bajo el formulario) ---------- */
.form__privacy {
  margin-top: var(--space-4, 1rem);
  text-align: center;
  font-size: var(--fs-xs, 0.78rem);
  color: var(--text-dim, rgba(255, 255, 255, 0.55));
  letter-spacing: 0.01em;
}

/* ---------- Footer legal ---------- */
.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1rem;
}
.footer__legal-links a,
.footer__cookies-btn {
  font-size: var(--fs-sm, 0.9rem);
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
  transition: color 0.2s;
}
.footer__legal-links a:hover,
.footer__cookies-btn:hover { color: var(--c-cyan); }
.footer__cookies-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__cookies-btn:focus-visible,
.footer__legal-links a:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; border-radius: 3px; }

.footer__disclaimer {
  max-width: 640px;
  margin: 0 auto 0.85rem;
  text-align: center;
  font-size: var(--fs-xs, 0.78rem);
  line-height: 1.5;
  color: var(--text-dim, rgba(255, 255, 255, 0.55));
}
.footer__copy {
  text-align: center;
  font-size: var(--fs-sm, 0.9rem);
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
}

/* =========================================================
   BANNER DE COOKIES (primera visita) — abajo, cristal oscuro
   ========================================================= */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  transform: translateX(-50%) translateY(0);
  z-index: 1200;
  width: min(680px, calc(100vw - 1.5rem));
  padding: clamp(1rem, 0.8rem + 1vw, 1.4rem);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
    rgba(10, 13, 24, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #fff;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-banner.is-visible { opacity: 1; }
.cc-banner[hidden] { display: none; }

.cc-banner__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}
.cc-banner__text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 1rem;
}
.cc-banner__text a { color: var(--c-cyan); text-decoration: underline; }
.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Botones del banner/modal */
.cc-btn {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1;
}
.cc-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cc-btn--primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(25, 212, 255, 0.22);
  margin-left: auto;
}
.cc-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(25, 212, 255, 0.32); }
.cc-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}
.cc-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.cc-btn--link {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.6rem 0.4rem;
}
.cc-btn--link:hover { color: #fff; }

/* =========================================================
   MODAL DE PREFERENCIAS
   ========================================================= */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cc-modal[hidden] { display: none; }
.cc-modal.is-open { opacity: 1; }
.cc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 16, 0.80);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cc-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: clamp(1.3rem, 1rem + 2vw, 2rem);
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%),
    rgba(10, 13, 24, 0.95);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  backdrop-filter: blur(22px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-modal.is-open .cc-modal__dialog { transform: scale(1); }
.cc-modal__title { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; margin: 0 0 0.25rem; }
.cc-modal__subtitle { font-size: 0.85rem; color: rgba(255, 255, 255, 0.72); margin: 0 0 1.25rem; }

.cc-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  align-items: start;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cc-option__name { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; }
.cc-option__desc { grid-column: 1 / 2; font-size: 0.8rem; color: rgba(255, 255, 255, 0.68); line-height: 1.5; }
.cc-option__state { font-size: 0.72rem; color: var(--c-cyan); font-weight: 600; }

/* Interruptor (toggle) accesible */
.cc-switch { position: relative; width: 44px; height: 26px; flex: none; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-switch__track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  transition: background 0.2s;
  pointer-events: none;
}
.cc-switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-switch input:checked + .cc-switch__track { background: var(--grad-accent); border-color: transparent; }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(18px); }
.cc-switch input:focus-visible + .cc-switch__track { outline: 2px solid #fff; outline-offset: 2px; }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-switch__track { opacity: 0.6; }

.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.4rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .cc-banner__actions { flex-direction: column; align-items: stretch; }
  .cc-btn--primary { margin-left: 0; }
  .cc-btn { width: 100%; text-align: center; }
  .cc-modal__actions .cc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal, .cc-modal__dialog, .cc-switch__track::after, .cc-btn { transition: none; }
  .cc-modal__dialog { transform: none; }
}
