/* ===================================================================
   Edifik — Páginas legales (estética dark ALVEA)
   bg #050505 · accent #2563EB · Manrope / Cabinet Grotesk
   Hoja propia: NO depende de site.css. Incluye estilos del cookie banner.
   =================================================================== */

/* Fuentes self-hosteadas (sin CDN de Google): LFPDPPP + CSP font-src 'self'. */
@import url("/static/fonts.css");

:root {
  --bg:        #050505;
  --bg-2:      #0b0c0e;
  --surface:   #111317;
  --surface-2: #16181d;
  --border:    #23262e;
  --border-2:  #2d3038;
  --accent:    #2563eb;
  --accent-2:  #3b82f6;
  --accent-soft: rgba(37, 99, 235, .14);
  --text:      #e8eaed;
  --text-dim:  #a4a9b3;
  --text-mute: #6f7682;
  --ok:        #22c55e;
  --warn:      #f59e0b;
  --err:       #ef4444;
  --radius:    14px;
  --radius-sm: 10px;
  --max:       54rem;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Cabinet Grotesk", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 540px at 78% -8%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 500px at 8% 4%, rgba(37,99,235,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.7;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 50;
  background: var(--surface); color: var(--text);
  padding: .55rem 1rem; border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* ---------- Header ---------- */
.legal-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(5,5,5,.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.legal-header nav {
  max-width: var(--max); margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
}
.legal-header .brand {
  font-family: var(--font-head);
  font-weight: 800; font-size: 1.3rem;
  letter-spacing: -.02em; color: var(--text);
}
.legal-header .brand:hover { text-decoration: none; color: var(--accent-2); }
.legal-header ul {
  display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap;
}
.legal-header a:not(.brand) { color: var(--text-dim); font-size: .92rem; font-weight: 500; }
.legal-header a:not(.brand):hover { color: var(--text); text-decoration: none; }

/* ---------- Layout ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.2rem 1.25rem 5rem;
}

.breadcrumb {
  font-size: .82rem; color: var(--text-mute);
  margin-bottom: 1.4rem; display: flex; gap: .4rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--text-dim); }
.breadcrumb span[aria-current] { color: var(--text-dim); }

.legal-hero { margin-bottom: 2.2rem; }
.legal-eyebrow {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(37,99,235,.3);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.legal-meta { color: var(--text-mute); font-size: .85rem; margin-top: .5rem; }
.legal-meta strong { color: var(--text-dim); font-weight: 600; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text); line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: .1em 0 .35em; font-weight: 800; }
h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.65rem); font-weight: 700;
  margin: 2.6rem 0 .8rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.6rem 0 .5rem; color: var(--text); }
h4 { font-size: .98rem; font-weight: 600; margin: 1.1rem 0 .4rem; color: var(--text-dim); }
p { margin: .7rem 0; color: var(--text-dim); }
strong { color: var(--text); font-weight: 600; }
ul, ol { color: var(--text-dim); padding-left: 1.4rem; }
li { margin: .35rem 0; }
abbr { text-decoration-color: var(--text-mute); cursor: help; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .1rem .4rem; border-radius: 6px; color: var(--text);
}

/* numbered legal sections */
.legal-section { scroll-margin-top: 5rem; }
.legal-section h2 .sec-num {
  display: inline-block; min-width: 1.9rem;
  color: var(--accent-2); font-weight: 800;
}

/* ---------- TOC ---------- */
.legal-toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.8rem 0 2.4rem;
}
.legal-toc h2 {
  border: none; padding: 0; margin: 0 0 .7rem;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-mute);
  font-family: var(--font-body); font-weight: 700;
}
.legal-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc;
  display: grid; gap: .15rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.legal-toc li { counter-increment: toc; margin: 0; }
.legal-toc a {
  display: block; padding: .35rem .2rem; color: var(--text-dim); font-size: .92rem;
  border-radius: 6px;
}
.legal-toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.legal-toc a::before { content: counter(toc) ". "; color: var(--accent-2); font-weight: 700; }

/* ---------- Callout boxes ---------- */
.callout {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--warn); }
.callout--ok { border-left-color: var(--ok); }

.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 1.4rem 0;
}
.contact-card dl { margin: 0; display: grid; gap: .55rem; grid-template-columns: max-content 1fr; }
.contact-card dt { color: var(--text-mute); font-size: .85rem; font-weight: 600; }
.contact-card dd { margin: 0; color: var(--text); }

/* ---------- Tables ---------- */
.legal-table-wrap { overflow-x: auto; margin: 1.2rem 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.legal-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 32rem; }
table.legal-table th, table.legal-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
table.legal-table thead th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
table.legal-table tbody tr:last-child td { border-bottom: none; }
table.legal-table tbody tr:hover { background: rgba(255,255,255,.015); }
table.legal-table td { color: var(--text-dim); }

/* ---------- Forms (ARCO) ---------- */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.7rem; margin: 1.5rem 0;
}
.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text-dim); }
.field .req { color: var(--accent-2); }
.field .hint { font-size: .78rem; color: var(--text-mute); margin: 0; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: .95rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: .7rem .85rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 7rem; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236f7682' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.4rem;
}
.checkbox-field { display: flex; gap: .65rem; align-items: flex-start; }
.checkbox-field input[type="checkbox"] {
  width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.checkbox-field label { font-weight: 400; color: var(--text-dim); font-size: .9rem; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .75rem 1.4rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.form-status {
  margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .92rem; display: none;
}
.form-status.is-visible { display: block; }
.form-status--ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.35); color: #86efac; }
.form-status--err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }
.form-status code { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }

.divider { border: none; border-top: 1px solid var(--border); margin: 2.6rem 0; }

/* ---------- Footer ---------- */
.legal-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.legal-footer .inner {
  max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center;
}
.legal-footer .links { display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.legal-footer a { color: var(--text-dim); font-size: .88rem; }
.legal-footer a:hover { color: var(--text); text-decoration: none; }
.legal-footer .copy { color: var(--text-mute); font-size: .82rem; }
.legal-footer button.linklike {
  background: none; border: none; color: var(--text-dim); font-size: .88rem; font-family: inherit; cursor: pointer; padding: 0;
}
.legal-footer button.linklike:hover { color: var(--text); }

@media (max-width: 40rem) {
  .legal-header nav { flex-direction: column; align-items: flex-start; }
  .contact-card dl { grid-template-columns: 1fr; gap: .15rem 0; }
  .contact-card dl dt { margin-top: .5rem; }
}

/* ===================================================================
   COOKIE BANNER (port del patrón mytiq) — namespaced edifik
   =================================================================== */
.cookie-banner {
  position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 1000;
  width: min(360px, calc(100vw - 2.5rem));
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 1.3rem 1.4rem 1.2rem;
  box-shadow: 0 18px 50px -12px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02);
  font-family: var(--font-body);
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .3s ease, transform .3s ease;
}
.cookie-banner.is-in { opacity: 1; transform: translateY(0) scale(1); }
.cookie-banner[hidden] { display: none; }
.cookie-banner__close {
  position: absolute; top: .8rem; right: .8rem;
  background: none; border: none; color: var(--text-mute); cursor: pointer;
  padding: .25rem; line-height: 0; border-radius: 6px;
}
.cookie-banner__close:hover { color: var(--text); background: var(--surface-2); }
.cookie-banner__title {
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 700;
  margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; color: var(--text);
  border: none; padding: 0;
}
.cookie-banner__icon { font-size: 1.15rem; }
.cookie-banner__text { font-size: .86rem; color: var(--text-dim); margin: 0 0 1rem; line-height: 1.55; }
.cookie-banner__text a { color: var(--accent-2); }
.cookie-banner__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-banner__actions--prefs { margin-top: 1rem; }
.cookie-banner__btn {
  flex: 1 1 auto; font-family: var(--font-body); font-weight: 600; font-size: .82rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-dim);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.cookie-banner__btn:hover { background: var(--bg-2); color: var(--text); }
.cookie-banner__btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; flex-basis: 100%; }
.cookie-banner__btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.cookie-banner__prefs { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.cookie-banner__prefs[hidden] { display: none; }
.cookie-pref { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem 0; }
.cookie-pref input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin-top: .2rem; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.cookie-pref input:disabled { opacity: .6; cursor: not-allowed; }
.cookie-pref__body { flex: 1; }
.cookie-pref__name { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .88rem; font-weight: 600; color: var(--text); }
.cookie-pref__required { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); background: var(--surface-2); padding: .12rem .45rem; border-radius: 999px; }
.cookie-pref__desc { font-size: .78rem; color: var(--text-mute); margin-top: .15rem; line-height: 1.45; }

.cookie-fab {
  position: fixed; left: 1.25rem; bottom: 1.25rem; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border-2); cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
  transition: color .15s, transform .15s, border-color .15s;
}
.cookie-fab:hover { color: var(--accent-2); border-color: var(--accent); transform: translateY(-2px); }
.cookie-fab[hidden] { display: none; }

@media (max-width: 40rem) {
  .cookie-banner { left: .75rem; right: .75rem; bottom: .75rem; width: auto; }
  .cookie-fab { left: .75rem; bottom: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner, .cookie-fab, html { transition: none !important; scroll-behavior: auto; }
}

/* Botón Google "fuente preferida": centrado al pie, con aire para no chocar con el FAB de cookies. */
.preferred-source { display: flex; justify-content: center; padding: 24px 16px 32px; }
