/* ==========================================================================
   Aviso de Privacidad — estilos propios de aviso-de-privacidad/.
   Fuente, tokens, navbar, footer y barra de scroll están en site.css.
   ========================================================================== */

/* ===== BASE ===== */
body { line-height: 1.7; }
main { position: relative; z-index: 1; }
main a { color: var(--primary-text); text-underline-offset: 3px; }
main a:hover { color: var(--primary-dark); }
[data-theme="dark"] main a:hover { color: #86efac; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Fondo decorativo */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
  background: radial-gradient(circle, var(--primary), transparent 70%);
}
.glow-1 { width: min(520px, 90vw); height: min(520px, 90vw); top: -120px; right: -160px; }
.glow-2 { width: min(380px, 70vw); height: min(380px, 70vw); bottom: 5%; left: -140px; opacity: 0.15; }
[data-theme="dark"] .glow { opacity: 0.15; }

/* ===== HERO ===== */
.page-hero {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  background: var(--tint);
  border: 1px solid var(--tint-border);
  color: var(--primary-text);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.page-hero h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-hero h1 span { color: var(--primary); }
[data-theme="dark"] .page-hero h1 span { color: #4ade80; }
.page-hero .lead {
  max-width: 680px;
  margin: 1.1rem auto 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.meta-row span { display: inline-flex; align-items: center; gap: 0.45rem; }
.meta-row .svg-icon { color: var(--primary); }

/* ===== RESUMEN ===== */
.summary {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, border-color 0.3s;
}
.summary-card:hover { transform: translateY(-4px); border-color: var(--primary); color: inherit; }
.summary-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}
.summary-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.summary-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }

/* ===== LAYOUT ===== */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

/* Índice */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 0.8rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--nav-h) - 2.5rem);
  overflow-y: auto;
}
.toc summary {
  list-style: none;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.6rem 0.6rem;
  pointer-events: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding-top: 0.08rem;
}
.toc a:hover { background: var(--tint); color: var(--text-primary); }
.toc a.active { background: var(--tint); color: var(--primary-text); font-weight: 600; }
.toc a.active::before { color: var(--primary-text); }

/* Contenido */
.content { display: flex; flex-direction: column; gap: 1.25rem; }
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.section-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.section-num {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  border: 1px solid var(--tint-border);
  color: var(--primary-text);
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.section h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
}
.section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.4rem;
  color: var(--text-primary);
}
.section p, .section li { color: var(--text-secondary); font-size: 0.97rem; }
.section p + p { margin-top: 0.75rem; }
.section ul { margin: 0.6rem 0 0.2rem; padding-left: 0; list-style: none; }
.section ul li { position: relative; padding-left: 1.6rem; margin: 0.35rem 0; }
.section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 0.85rem;
  height: 0.85rem;
  background-color: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
strong { color: var(--text-primary); font-weight: 600; }

/* Tarjeta destacada */
.callout {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--tint);
  border: 1px solid var(--tint-border);
}
.callout .svg-icon { color: var(--primary-text); font-size: 1.15rem; margin-top: 0.2rem; }
.callout p { font-size: 0.93rem; margin: 0; }
.callout.warn { background: rgba(234, 179, 8, 0.09); border-color: rgba(234, 179, 8, 0.35); }
.callout.warn .svg-icon { color: #a16207; }
[data-theme="dark"] .callout.warn .svg-icon { color: #facc15; }

/* Ficha del responsable */
.identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.identity div {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.identity dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.identity dd { margin-top: 0.2rem; color: var(--text-primary); font-weight: 500; font-size: 0.95rem; overflow-wrap: anywhere; }

/* Tabla de datos */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 1rem; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: 0.8rem 1rem; vertical-align: top; }
.data-table thead th {
  background: var(--tint);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table thead th:first-child { border-radius: 12px 0 0 12px; }
.data-table thead th:last-child { border-radius: 0 12px 12px 0; }
.data-table tbody td { border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.data-table tbody td:first-child { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td .svg-icon { color: var(--primary); width: 1.2rem; margin-right: 0.35rem; }

/* Finalidades */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.purpose {
  border-radius: 16px;
  padding: 1.2rem 1.25rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.purpose .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  margin-bottom: 0.5rem;
}
.purpose.primary .tag { background: var(--tint); color: var(--primary-text); border: 1px solid var(--tint-border); }
.purpose.secondary .tag { background: rgba(58, 85, 128, 0.1); color: var(--text-secondary); border: 1px solid rgba(58, 85, 128, 0.25); }
.purpose h3 { margin-top: 0; }

/* Derechos ARCO */
.arco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.arco {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 1.2rem 1.1rem 1.1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.arco h3 { display: flex; align-items: center; margin: 0 0 0.4rem; font-size: 1rem; }
.arco h3::before {
  content: attr(data-letter);
  content: attr(data-letter) / ""; /* decorativo: los lectores de pantalla no lo leen */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.5rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.85rem;
}
.arco p { position: relative; font-size: 0.88rem; line-height: 1.55; }

/* Pasos */
.steps { list-style: none; counter-reset: step; margin-top: 1.1rem; position: relative; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.3rem 3.4rem;
  color: var(--text-secondary);
}
.section .steps li::before {
  content: counter(step);
  font-family: inherit;
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.steps li::after {
  content: '';
  position: absolute;
  left: 1.12rem;
  top: 2.4rem;
  bottom: 0.2rem;
  width: 2px;
  background: var(--tint-border);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; margin-bottom: 0.1rem; }

/* Contacto */
.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(18, 186, 56, 0.12), rgba(18, 186, 56, 0.04));
  border: 1px solid var(--tint-border);
}
.contact-card p { margin: 0; }
.contact-card .mail { font-size: 1.1rem; font-weight: 700; }
.btn-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.3rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn-mail:hover { color: #fff; }
.section .after-card { margin-top: 1rem; }

/* Exclusión de la analítica */
.optout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 0.25rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.section .optout-status { margin: 0; }
.optout.is-off { border-color: var(--tint-border); background: var(--tint); }

.print-row { display: flex; justify-content: flex-end; }
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-print:hover { color: var(--primary-text); border-color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; padding: 0.4rem 0.6rem; }
  .toc summary {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 0.6rem;
  }
  .toc summary::after {
    content: '';
    width: 0.85rem;
    height: 0.85rem;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.3s;
  }
  .toc[open] summary::after { transform: rotate(180deg); }
  .toc[open] ol { padding-bottom: 0.5rem; }
}
@media (max-width: 600px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
  .data-table tbody tr:last-child { border-bottom: none; }
  .data-table tbody td { border: none; padding: 0.2rem 0; }
  .data-table tbody td:first-child { white-space: normal; }
  .steps li { padding-left: 3rem; }
}
@media (hover: none) {
  .summary-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ===== IMPRESIÓN ===== */
@media print {
  :root, [data-theme="dark"] {
    --bg-body: #fff; --surface: #fff; --surface-strong: #fff; --border: #ccc;
    --text-primary: #000; --text-secondary: #222; --text-muted: #444; --primary-text: #0a6b22;
    --shadow: none; --tint: #f2f7f3;
  }
  .navbar, .glow, .toc, .summary, .print-row, .btn-mail, .optout button { display: none !important; }
  .layout { display: block; padding: 0; }
  .page-hero { padding: 0 0 1rem; text-align: left; }
  .page-hero .lead, .meta-row { margin-left: 0; justify-content: flex-start; }
  .section { box-shadow: none; backdrop-filter: none; break-inside: avoid; margin-bottom: 0.8rem; }
  .footer { background: none; color: #444; padding: 1rem 0 0; }
  .footer img { display: none; }
  a { color: #000; }
}
