/* ==========================================================
   SSi-Licencias - Cookies y Páginas Legales
   ========================================================== */

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 140%);
  width: min(960px, calc(100% - 2rem));
  z-index: 1000;
  background: rgba(12, 24, 36, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(94, 231, 255, 0.25);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(94, 231, 255, 0.08);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-text, #d6e4f0);
  font-family: 'Inter', sans-serif;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner.show { transform: translate(-50%, 0); }

.cookie-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(94, 231, 255, 0.1);
  color: var(--color-cyan, #5ee7ff);
}
.cookie-banner-icon svg { width: 24px; height: 24px; }

.cookie-banner-text { flex: 1; font-size: 0.875rem; line-height: 1.55; }
.cookie-banner-text strong { display: block; color: #fff; font-size: 0.95rem; margin-bottom: 0.25rem; }
.cookie-banner-text a { color: var(--color-cyan, #5ee7ff); text-decoration: underline; }

.cookie-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; flex-shrink: 0; }

.cookie-btn {
  border-radius: 9999px;
  padding: 0.6rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-line, #1b3144);
  background: transparent;
  color: var(--color-text, #d6e4f0);
  transition: all 0.25s ease;
  font-family: inherit;
}
.cookie-btn:hover { border-color: var(--color-cyan, #5ee7ff); color: var(--color-cyan, #5ee7ff); }
.cookie-btn-primary {
  background: linear-gradient(135deg, #5ee7ff, #3b9dff);
  color: #04121d;
  border-color: transparent;
}
.cookie-btn-primary:hover { color: #04121d; box-shadow: 0 0 18px rgba(94, 231, 255, 0.45); transform: translateY(-1px); }

/* ---------- Modal de preferencias ---------- */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(2, 8, 14, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-modal-overlay.show { display: flex; animation: cookieFade 0.3s ease; }

.cookie-modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-panel, #0c1824);
  border: 1px solid var(--color-line, #1b3144);
  border-radius: 18px;
  padding: 1.75rem;
  color: var(--color-text, #d6e4f0);
  font-family: 'Inter', sans-serif;
  animation: cookieRise 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-modal h2 { color: #fff; font-size: 1.25rem; margin: 0 0 0.5rem; }
.cookie-modal > p { font-size: 0.875rem; color: var(--color-muted, #8aa0b4); margin: 0 0 1.25rem; line-height: 1.55; }

.cookie-category {
  border: 1px solid var(--color-line, #1b3144);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.cookie-category-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-category-head strong { color: #fff; font-size: 0.92rem; }
.cookie-category p { font-size: 0.8rem; color: var(--color-muted, #8aa0b4); margin: 0.45rem 0 0; line-height: 1.5; }
.cookie-always { font-size: 0.75rem; color: var(--color-cyan, #5ee7ff); font-weight: 600; }

/* Interruptor */
.cookie-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.cookie-switch input { opacity: 0; width: 0; height: 0; }
.cookie-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #1b3144; border-radius: 9999px; transition: 0.25s;
}
.cookie-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.25s;
}
.cookie-switch input:checked + .cookie-slider { background: var(--color-cyan, #5ee7ff); }
.cookie-switch input:checked + .cookie-slider::before { transform: translateX(20px); }
.cookie-switch input:focus-visible + .cookie-slider { outline: 2px solid #fff; outline-offset: 2px; }

.cookie-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }

@keyframes cookieFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cookieRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Enlaces legales del footer ---------- */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0.5rem 0 0;
}
.legal-links a, .legal-links button {
  color: var(--color-muted, #8aa0b4);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.legal-links a:hover, .legal-links button:hover { color: var(--color-cyan, #5ee7ff); }

/* ---------- Consentimiento en formulario ---------- */
.form-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--color-muted, #8aa0b4);
  line-height: 1.5;
  margin: 0.25rem 0 1rem;
}
.form-consent input { margin-top: 0.2rem; accent-color: var(--color-cyan, #5ee7ff); width: 16px; height: 16px; flex-shrink: 0; }
.form-consent a { color: var(--color-cyan, #5ee7ff); text-decoration: underline; }
.form-legal-info {
  font-size: 0.72rem;
  color: var(--color-muted, #8aa0b4);
  line-height: 1.5;
  margin-top: 1rem;
  opacity: 0.85;
}

/* ---------- Páginas legales ---------- */
.legal-page { padding: 4rem 0 5rem; position: relative; }
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  background: rgba(12, 24, 36, 0.6);
  border: 1px solid var(--color-line, #1b3144);
  border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
  line-height: 1.7;
  color: var(--color-text, #d6e4f0);
}
.legal-content h1 { color: #fff; font-size: clamp(1.75rem, 4vw, 2.4rem); margin: 0 0 0.5rem; }
.legal-updated { color: var(--color-muted, #8aa0b4); font-size: 0.85rem; margin-bottom: 2rem; }
.legal-content h2 {
  color: var(--color-cyan, #5ee7ff);
  font-size: 1.15rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line, #1b3144);
}
.legal-content h3 { color: #fff; font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.legal-content p, .legal-content li { font-size: 0.93rem; }
.legal-content ul { padding-left: 1.25rem; }
.legal-content a { color: var(--color-cyan, #5ee7ff); }
.legal-content .pending { background: rgba(255, 190, 70, 0.15); color: #ffcf7a; padding: 0 0.35rem; border-radius: 4px; }

.legal-table-wrap { overflow-x: auto; margin: 1rem 0; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.legal-table th, .legal-table td { border: 1px solid var(--color-line, #1b3144); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
.legal-table th { background: rgba(94, 231, 255, 0.08); color: #fff; }

.legal-nav { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.legal-nav a {
  font-size: 0.8rem; padding: 0.45rem 1rem; border-radius: 9999px;
  border: 1px solid var(--color-line, #1b3144); color: var(--color-muted, #8aa0b4); text-decoration: none;
  transition: all 0.25s;
}
.legal-nav a:hover, .legal-nav a.active { border-color: var(--color-cyan, #5ee7ff); color: var(--color-cyan, #5ee7ff); }

@media (max-width: 768px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: left; gap: 1rem; bottom: 0.75rem; }
  .cookie-banner-icon { display: none; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .cookie-btn { flex: 1; }
}
