/* =============================================================
   AnonimizaPDF — 1. Tokens
   ============================================================= */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #16232f;
  --muted: #5b6b7d;
  --line: #dfe6ee;
  --navy: #0d2440;
  --navy-2: #123154;
  --accent: #0b5cab;
  --accent-d: #084a8f;
  --accent-soft: #e7f0f9;
  --ok: #1c7c4d;
  --ok-soft: #e6f4ec;
  --warn: #8a5a00;
  --warn-soft: #fdf3dd;
  --danger: #b3261e;
  --danger-soft: #fbe9e8;
  --radius: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 10px 30px rgba(13, 36, 64, 0.10);
  --topbar-h: 64px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--ink);
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.015em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem;
  background: var(--navy); color: #fff; z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8rem;
}
.lead { color: var(--muted); font-size: clamp(1.02rem, 1.4vw, 1.2rem); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* Reveal on scroll (subtle, never hides content without JS — see .no-js) */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-family: var(--serif); font-weight: 560; font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
.h1-look { font-family: var(--serif); font-weight: 560; line-height: 1.12; letter-spacing: -0.015em; color: var(--navy); }
h2 { font-family: var(--serif); font-weight: 560; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.12rem; font-weight: 700; }
.display-accent { color: var(--accent); }

/* =============================================================
   5. Components — buttons, badges, notices
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 10px; font-weight: 700; font-size: .98rem;
  transition: transform .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out);
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(11, 92, 171, .28); }
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: .5rem .95rem; font-size: .88rem; border-radius: 8px; }

.demo-badge {
  position: fixed; z-index: 2000; left: 50%; bottom: 12px; transform: translateX(-50%);
  background: #2b2113; color: #ffd98a; border: 1px solid #8a6a2a;
  font-size: .82rem; font-weight: 600; padding: .5rem 1rem; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; max-width: calc(100vw - 2rem);
  overflow: hidden; text-overflow: ellipsis;
}
.notice {
  border-radius: 10px; padding: .8rem 1rem; font-size: .92rem; border: 1px solid var(--line);
  background: var(--accent-soft); color: var(--navy); margin: .9rem 0;
}
.notice.warn { background: var(--warn-soft); color: #5f4200; border-color: #ecd9a8; }
.notice.ok { background: var(--ok-soft); color: #14532d; border-color: #bfe3cf; }
.notice.bad { background: var(--danger-soft); color: #7a1a14; border-color: #f0c4c1; }

/* Toasts (in-page, never alert()) */
#toasts { position: fixed; z-index: 3000; right: 16px; bottom: 56px; display: grid; gap: .6rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast {
  background: var(--navy); color: #fff; border-radius: 10px; padding: .8rem 1rem;
  font-size: .92rem; box-shadow: var(--shadow); display: flex; gap: .6rem; align-items: flex-start;
  animation: toastIn .3s var(--ease-out);
}
.toast.ok { background: #14532d; }
.toast.bad { background: #7a1a14; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* =============================================================
   6. Nav + footer
   ============================================================= */
.topnav {
  position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  background-color: rgba(255,255,255,.92);
}
.topnav-inner { display: flex; align-items: center; gap: 1rem; height: var(--topbar-h); }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff;
  display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; left: 4px; right: 4px; top: 55%; height: 5px; background: #fff; border-radius: 2px; }
.nav-links { display: flex; gap: 1.3rem; margin-left: auto; font-size: .95rem; color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--accent); }
.nav-cta { display: flex; gap: .6rem; margin-left: 1rem; align-items: center; }
.credits-pill {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .88rem;
  background: var(--navy); color: #fff; border-radius: 999px; padding: .42rem .9rem;
  transition: transform .2s var(--ease-out);
}
.credits-pill.bump { transform: scale(1.08); }
.credits-pill.low { background: var(--danger); }
.nav-toggle { display: none; margin-left: auto; font-size: 1.4rem; padding: .4rem .6rem; }
.footer { background: var(--navy); color: #c9d4e2; padding: 3rem 0 5rem; font-size: .93rem; }
.footer a { color: #e8eef6; }
.footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: .5rem; }
.footer-cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .7rem; }
.footer ul { list-style: none; padding: 0; display: grid; gap: .45rem; }
.footer-bottom { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* =============================================================
   7. Landing — hero, example, steps, pricing, faq
   ============================================================= */
.hero { background: linear-gradient(180deg, #0d2440 0%, #123154 70%, #16406e 100%); color: #fff; overflow: clip; }
.hero-inner { display: grid; gap: 2.5rem; padding: clamp(2.5rem, 6vw, 4.5rem) 0; align-items: center; }
.hero h1 { max-width: 16ch; }
.hero .lead { color: #c9d4e2; }
.hero-points { display: grid; gap: .55rem; margin: 1.4rem 0 1.8rem; color: #e8eef6; font-size: .97rem; }
.hero-points li { list-style: none; display: flex; gap: .6rem; align-items: flex-start; }
.hero-points svg { flex: none; margin-top: .2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-note { margin-top: 1rem; font-size: .88rem; color: #a9bcd4; }
.hero-visual {
  background: #fff; color: var(--ink); border-radius: 18px; padding: 1.2rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); display: grid; gap: 1rem;
}
.doc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.doc-mock {
  border: 1px solid var(--line); border-radius: 10px; padding: .9rem .95rem; font-size: .72rem;
  line-height: 1.7; background: #fbfcfe; color: #33465c; position: relative;
}
.doc-mock h5 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.doc-mock .ln { height: .62em; border-radius: 3px; background: #e3e9f1; margin: .34em 0; }
.doc-mock .ln.w60 { width: 60%; } .doc-mock .ln.w80 { width: 80%; } .doc-mock .ln.w45 { width: 45%; }
.redact { background: #101418; color: transparent; border-radius: 3px; padding: 0 .3em; user-select: none; }
.hero-visual-cap { font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }

.steps-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 2rem; }
.step { padding: 1.4rem; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: .8rem;
}
.audience-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 2rem; }
.audience { padding: 1.5rem; }
.audience h3 { margin-bottom: .4rem; }
.audience p { color: var(--muted); font-size: .95rem; }

.pricing { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 2rem; align-items: stretch; }
.price-card { padding: 1.8rem 1.6rem; display: flex; flex-direction: column; gap: .6rem; position: relative; }
.price-card.featured { border: 2px solid var(--accent); }
.price-flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800;
  padding: .2rem .8rem; border-radius: 999px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.price-name { font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.price-amount { font-family: var(--serif); font-size: 2.1rem; color: var(--navy); }
.price-cycle { color: var(--muted); font-size: .9rem; }
.price-list { list-style: none; padding: 0; display: grid; gap: .45rem; font-size: .93rem; color: #33465c; margin: .6rem 0 1.2rem; }
.price-list li { display: flex; gap: .5rem; align-items: flex-start; }
.price-list svg { flex: none; margin-top: .25rem; }
.faq-list { margin-top: 1.6rem; display: grid; gap: .8rem; }
.faq { padding: 1.2rem 1.3rem; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.faq p { margin-top: .6rem; color: var(--muted); font-size: .95rem; }
.trust-strip { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.6rem; color: var(--muted); font-size: .9rem; }
.final-cta { text-align: center; }
.final-cta .card { padding: clamp(2rem, 5vw, 3.5rem); background: var(--navy); color: #fff; border: 0; }
.final-cta h2 { color: #fff; }
.final-cta p { color: #c9d4e2; margin: .8rem auto 1.6rem; max-width: 56ch; }

/* =============================================================
   8. App — topbar, tool card, viewer
   ============================================================= */
.app-body { background: #eef1f6; }
.app-topbar {
  position: sticky; top: 0; z-index: 1000; background: var(--navy); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.app-topbar .topnav-inner { height: var(--topbar-h); }
.app-topbar .brand { color: #fff; }
.app-topbar .account-link { color: #c9d4e2; font-size: .9rem; font-weight: 600; }
.app-topbar .account-link:hover { color: #fff; }
.app-main { padding: 1.6rem 0 6rem; display: grid; gap: 1.2rem; }
.tool-card { padding: clamp(1.2rem, 3vw, 2rem); }
.tool-card h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-family: var(--serif); color: var(--navy); }
.dropzone {
  margin-top: 1.2rem; border: 2px dashed #b9c6d6; border-radius: var(--radius);
  padding: 2.2rem 1.5rem; text-align: center; background: #f8fafc;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] { display: block; margin: 1rem auto 0; }
.progress { height: 8px; background: #e3e9f1; border-radius: 99px; overflow: hidden; margin-top: 1rem; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s var(--ease-out); }
.status-line { margin-top: .8rem; font-size: .92rem; color: var(--muted); min-height: 1.5em; }
.workbench { display: grid; gap: 1.2rem; margin-top: 1.2rem; }
.page-view { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.page-view canvas.base { width: 100%; height: auto; }
.redact-layer { position: absolute; inset: 0; }
.redact-box { position: absolute; background: #101418; border-radius: 2px; cursor: pointer; border: 1px solid rgba(255,255,255,.25); }
.redact-box.off { background: rgba(16,20,24,.18); border: 1px dashed rgba(16,20,24,.6); }
.redact-box.manual { background: #101418; }
.redact-box.preview-flash { outline: 2px solid var(--accent); }
.page-view.drawing .redact-layer { cursor: crosshair; touch-action: none; }
.draft-box { position: absolute; background: rgba(11,92,171,.25); border: 2px solid var(--accent); }
.detections { display: grid; gap: .5rem; margin-top: 1rem; }
.detection {
  display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .9rem;
}
.detection input[type="checkbox"] { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--accent); flex: none; }
.detection .tipo {
  flex: none; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--navy); color: #fff; border-radius: 6px; padding: .15rem .5rem; margin-top: .15rem;
}
.detection .tipo.manual { background: var(--accent); }
.detection .tipo.unplaced { background: var(--warn); }
.detection .txt { color: #33465c; word-break: break-word; }
.detection .del { margin-left: auto; color: var(--danger); font-weight: 700; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.cost-line { font-size: .92rem; color: var(--muted); margin-top: .8rem; }
.cost-line strong { color: var(--navy); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2500; background: rgba(13,36,64,.55);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 460px; width: 100%; padding: 1.8rem; box-shadow: var(--shadow); }
.modal h3 { color: var(--navy); font-size: 1.25rem; margin-bottom: .4rem; }
.modal .fake-card {
  background: #f1f4f8; border: 1px dashed #b9c6d6; border-radius: 10px; padding: .8rem 1rem;
  font-family: ui-monospace, monospace; margin: 1rem 0; color: var(--muted);
}

/* Forms */
.form { display: grid; gap: .9rem; margin-top: 1.2rem; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; color: var(--navy); }
.field input {
  width: 100%; padding: .75rem .9rem; border-radius: 10px; border: 1px solid #b9c6d6;
  font: inherit; background: #fff;
}
.field input:focus { border-color: var(--accent); outline: 2px solid rgba(11,92,171,.25); }
.form-error { color: var(--danger); font-size: .9rem; min-height: 1.4em; }
.auth-switch { margin-top: 1rem; font-size: .92rem; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }
.auth-wrap { max-width: 480px; margin: 0 auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .8rem; }
.history-table th, .history-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.history-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.kv-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 1.2rem 0; }
.kv { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.kv .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.kv .v { font-size: 1.25rem; font-weight: 800; color: var(--navy); }

/* Legal */
.legal { max-width: 780px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--navy); margin-bottom: 1rem; }
.legal h2 { font-size: 1.25rem; color: var(--navy); margin: 1.8rem 0 .5rem; font-family: var(--sans); }
.legal p, .legal li { color: #33465c; }
.legal ul { padding-left: 1.3rem; }

/* =============================================================
   9. Responsive
   ============================================================= */
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.05fr .95fr; }
  .workbench.has-results { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .footer-grid { grid-template-columns: 1.2fr 2fr; }
}
@media (max-width: 959px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-block; }
  .topnav-inner .nav-cta .btn-ghost { display: none; }
  .topnav-inner.open { flex-wrap: wrap; height: auto; padding: .8rem 0; }
  .topnav-inner.open .nav-links { display: grid; flex-basis: 100%; gap: .7rem; margin: 1rem 0 0; }
  .doc-pair { grid-template-columns: 1fr; }
}

/* =============================================================
   10. Reduced-motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { animation: none; }
}
