/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #eef0f5;
  --ink: #12151c;
  --ink-muted: #5b6472;
  --ink-faint: #8b93a1;
  --border: #e2e5ec;
  --border-strong: #c9cedb;

  --accent: #3654ff;
  --accent-ink: #1b2e9c;
  --accent-soft: #e8ecff;
  --success: #16a34a;
  --success-soft: #e7f7ed;
  --warn: #d08b28;
  --warn-soft: #fbf1e2;
  --danger: #d1332f;
  --danger-soft: #fdeceb;

  --dark: #12151c;
  --dark-2: #1b2030;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Manrope", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 2px rgba(18, 21, 28, 0.06);
  --shadow: 0 8px 24px rgba(18, 21, 28, 0.08);
  --shadow-lg: 0 20px 48px rgba(18, 21, 28, 0.14);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video, canvas { 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 {
  font-family: var(--display);
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
}
ul, ol { list-style: none; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
::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(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.wrap--narrow { max-width: 860px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: .9rem;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease-out), background-color .25s var(--ease-out), box-shadow .25s var(--ease-out), color .25s var(--ease-out), border-color .25s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(54, 84, 255, .28); }
.btn--primary:hover { background: #2a45e0; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #262b39; }
.btn--outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--ink); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink-muted); }
.btn--ghost:hover { color: var(--ink); }
.btn--sm { padding: .6rem 1.1rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--danger-outline { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.btn--danger-outline:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* =============================================================
   5. Components
   ============================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
}
.badge--demo { background: var(--warn-soft); color: #8a5a10; }
.badge--ok { background: var(--success-soft); color: #12783a; }

.demo-banner {
  background: var(--warn-soft); color: #7a5410;
  border: 1px solid #f0dcb2;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
}

/* Site header */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(245, 246, 249, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.site-header.is-scrolled { border-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.1rem; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
}
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: .95rem;
}
.main-nav { display: flex; align-items: center; gap: 1.9rem; }
.main-nav a { font-size: .92rem; font-weight: 600; color: var(--ink-muted); transition: color .25s var(--ease-out); }
.main-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: 10px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  position: fixed; inset: 0; z-index: 300; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem;
  transform: translateY(-100%); opacity: 0; visibility: hidden;
  transition: transform .4s var(--ease-out), opacity .3s var(--ease-out), visibility .4s;
}
.mobile-nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-nav a { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }

/* =============================================================
   6. Sections — landing
   ============================================================= */
.hero { padding-top: clamp(3rem, 7vw, 5rem); }
.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero__title { font-size: clamp(2.3rem, 4.6vw, 3.6rem); margin-bottom: 1.1rem; }
.hero__title .hl { color: var(--accent); }
.hero__subtitle { font-size: 1.08rem; color: var(--ink-muted); max-width: 46ch; margin-bottom: 1.9rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.4rem; }
.hero__trust { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--ink-faint); }
.hero__trust svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* Mock PDF illustration — pure CSS/SVG, no real file needed */
.mock-doc {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.6rem 1.6rem 2.1rem;
  transform: rotate(1.2deg);
  overflow: hidden;
}
.mock-doc::before {
  content: "";
  position: absolute; inset: -40% -20% auto -20%; height: 70%;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-soft), transparent 70%);
  filter: blur(10px);
  z-index: 0;
}
.mock-doc__head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.mock-doc__head span { font-size: .75rem; font-weight: 700; color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase; }
.mock-doc__dots { display: flex; gap: 5px; }
.mock-doc__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: block; }
.mock-doc__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: .55rem; }
.mock-line { height: 11px; border-radius: 4px; background: var(--surface-2); }
.mock-line.w-90 { width: 90%; } .mock-line.w-80 { width: 80%; } .mock-line.w-60 { width: 60%; } .mock-line.w-40 { width: 40%; }
.mock-box {
  height: 11px; border-radius: 4px; background: var(--ink);
  position: relative; overflow: hidden;
}
.mock-box::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: mockShimmer 3.2s ease-in-out infinite;
}
@keyframes mockShimmer { 0% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
.mock-doc__watermark {
  position: absolute; z-index: 1; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.mock-doc__watermark span {
  transform: rotate(-28deg);
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .08em;
  color: rgba(18, 21, 28, .08);
  white-space: nowrap;
}
.mock-doc__foot { position: relative; z-index: 1; margin-top: 1.3rem; display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--success); font-weight: 700; }

/* How it works */
.steps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.3rem, 3vw, 2rem); }
.step { position: relative; }
.step__num {
  width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800;
  margin-bottom: 1.1rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.step p { color: var(--ink-muted); font-size: .95rem; }

/* Features */
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.feature { padding: 1.6rem; }
.feature__icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.feature p { font-size: .9rem; color: var(--ink-muted); }

/* Pricing */
.pricing__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; align-items: stretch; }
.plan { padding: 1.9rem; display: flex; flex-direction: column; position: relative; }
.plan--highlight { border-color: var(--accent); box-shadow: 0 16px 36px rgba(54, 84, 255, .16); }
.plan__tag {
  position: absolute; top: -13px; left: 1.9rem;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800;
  padding: .3rem .7rem; border-radius: 999px; letter-spacing: .03em;
}
.plan__name { font-size: 1.05rem; font-weight: 700; margin-bottom: .3rem; }
.plan__price { font-family: var(--display); font-size: 2.2rem; font-weight: 800; margin-bottom: .15rem; }
.plan__price small { font-size: .95rem; font-weight: 600; color: var(--ink-faint); }
.plan__credits { color: var(--ink-muted); font-size: .88rem; margin-bottom: 1.4rem; }
.plan__list { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.6rem; flex: 1; }
.plan__list li { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; color: var(--ink); }
.plan__list svg { width: 17px; height: 17px; color: var(--success); flex-shrink: 0; margin-top: 2px; }
.pricing__note { text-align: center; color: var(--ink-faint); font-size: .85rem; margin-top: 1.6rem; }

/* FAQ */
.faq__list { display: flex; flex-direction: column; gap: .7rem; max-width: 760px; margin-inline: auto; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.15rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-weight: 700; font-size: .98rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--ink-faint); flex-shrink: 0;
  transition: transform .25s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.4rem 1.3rem; color: var(--ink-muted); font-size: .93rem; }

/* Final CTA */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(2.4rem, 6vw, 4rem); text-align: center; }
.cta-band h2 { color: #fff; margin-bottom: .8rem; }
.cta-band p { color: rgba(255,255,255,.7); margin-bottom: 1.8rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 3rem; }
.footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.footer__brand p { color: var(--ink-muted); font-size: .88rem; max-width: 32ch; margin-top: .6rem; }
.footer__cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer__col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: .8rem; }
.footer__col a { display: block; font-size: .9rem; color: var(--ink-muted); padding-block: .3rem; }
.footer__col a:hover { color: var(--ink); }
.footer__bottom { padding-top: 1.6rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; font-size: .82rem; color: var(--ink-faint); }

/* =============================================================
   7. App shell (app.html / cuenta.html)
   ============================================================= */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.app-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.app-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.app-bar__right { display: flex; align-items: center; gap: .7rem; }
.credits-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: .5rem .9rem; border-radius: 999px; font-weight: 700; font-size: .88rem;
  transition: transform .3s var(--ease-out);
}
.credits-pill.is-pulsing { animation: pillPulse .5s var(--ease-out); }
@keyframes pillPulse { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.account-menu { position: relative; }
.account-menu__btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 190px; padding: .5rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out), visibility .2s;
}
.account-menu.is-open .account-menu__panel { opacity: 1; visibility: visible; transform: translateY(0); }
.account-menu__panel a, .account-menu__panel button {
  display: block; width: 100%; text-align: left; padding: .6rem .7rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
}
.account-menu__panel a:hover, .account-menu__panel button:hover { background: var(--surface-2); }

.app-main { flex: 1; padding-block: clamp(1.8rem, 4vw, 3rem); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 6vw, 3.4rem); text-align: center;
  background: var(--surface);
  transition: border-color .25s var(--ease-out), background-color .25s var(--ease-out);
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { width: 52px; height: 52px; margin-inline: auto 1rem; color: var(--accent); }
.dropzone h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.dropzone p { color: var(--ink-muted); font-size: .88rem; }
.dropzone[data-state="uploading"] .dropzone__idle,
.dropzone[data-state="idle"] .dropzone__busy { display: none; }
.dropzone[data-state="idle"] .dropzone__idle,
.dropzone[data-state="uploading"] .dropzone__busy { display: block; }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  margin-inline: auto 1rem; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .9rem; }
.progress-bar__fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease-out); width: 0%; }

/* Tool workspace */
.tool-workspace { display: grid; grid-template-columns: 1fr 340px; gap: 1.4rem; align-items: start; }
.tool-pages { display: flex; flex-direction: column; gap: 1.3rem; }
.page-card { padding: 1rem; }
.page-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; font-size: .85rem; font-weight: 700; color: var(--ink-muted); }
.page-card__canvas-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: #fff; }
.page-card__canvas-wrap canvas { width: 100%; display: block; }
.page-card__overlay { position: absolute; inset: 0; cursor: crosshair; }
.redbox { position: absolute; background: rgba(18, 21, 28, 0.86); border-radius: 2px; }
.redbox.is-off { background: rgba(209, 51, 47, 0.18); outline: 1.5px dashed var(--danger); }
.redbox.is-manual { outline: 1.5px solid var(--accent); }

.side-panel { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1rem; }
.side-panel .card { padding: 1.2rem; }
.side-panel h3 { font-size: .95rem; margin-bottom: .8rem; }

.cost-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem;
}
.cost-banner strong { font-family: var(--display); font-size: 1.15rem; }

.detection-list { display: flex; flex-direction: column; gap: .5rem; max-height: 280px; overflow-y: auto; }
.detection-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: .82rem;
}
.detection-item__tipo { font-weight: 700; color: var(--ink-muted); flex-shrink: 0; min-width: 60px; }
.detection-item__texto { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detection-item.is-off { opacity: .55; }
.detection-item.is-off .detection-item__texto { text-decoration: line-through; }
.detection-item__toggle {
  width: 32px; height: 18px; border-radius: 999px; background: var(--border-strong);
  position: relative; flex-shrink: 0; transition: background-color .2s var(--ease-out);
}
.detection-item__toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .2s var(--ease-out);
}
.detection-item.is-on .detection-item__toggle { background: var(--accent); }
.detection-item.is-on .detection-item__toggle::after { transform: translateX(14px); }
.detection-item__del { color: var(--danger); font-size: 1rem; flex-shrink: 0; }
.detection-empty { font-size: .85rem; color: var(--ink-faint); padding: .6rem 0; }
.detection-item--no-localizada { border: 1px dashed var(--warn); background: var(--warn-soft); }

.watermark-form label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-muted); margin-bottom: .35rem; }
.watermark-form input[type="text"] {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); margin-bottom: .9rem;
}
.watermark-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; flex-shrink: 0; transition: background-color .2s var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease-out); box-shadow: var(--shadow-sm); }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(18px); }
.watermark-preview {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); height: 80px;
  display: grid; place-items: center; overflow: hidden; position: relative; background: var(--surface-2);
  margin-bottom: .9rem;
}
.watermark-preview span { transform: rotate(-28deg); font-family: var(--display); font-weight: 800; color: rgba(18,21,28,.22); white-space: nowrap; font-size: 1rem; }

.manual-btn { width: 100%; }
.manual-btn.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.honest-note {
  font-size: .82rem; color: var(--ink-muted); background: var(--surface-2);
  padding: .8rem .9rem; border-radius: var(--radius-sm); line-height: 1.5;
}

/* Toasts (never alert()) */
.toast-stack { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 999; display: flex; flex-direction: column; gap: .6rem; max-width: 340px; }
.toast {
  background: var(--ink); color: #fff; padding: .85rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .88rem; box-shadow: var(--shadow-lg);
  transform: translateY(10px); opacity: 0; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast--error { background: var(--danger); }
.toast--ok { background: var(--success); }

/* Upgrade modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(18,21,28,.5);
  display: grid; place-items: center; padding: 1.2rem;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease-out), visibility .25s;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 460px; width: 100%;
  padding: 1.8rem; box-shadow: var(--shadow-lg);
  transform: scale(.96); transition: transform .25s var(--ease-out);
}
.modal-overlay.is-open .modal { transform: scale(1); }
.modal h3 { margin-bottom: .5rem; }
.modal p { color: var(--ink-muted); font-size: .92rem; margin-bottom: 1.2rem; }
.modal__plans { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.2rem; }
.modal__plan {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .2s var(--ease-out);
}
.modal__plan:hover { border-color: var(--accent); }
.modal__plan.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.fake-card {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .9rem 1rem;
  font-family: var(--mono); font-size: .95rem; letter-spacing: .06em; color: var(--ink-muted);
  background: var(--surface-2); margin-bottom: 1.2rem;
}

/* Account page */
.account-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.4rem; align-items: start; }
.account-grid .card { padding: 1.4rem; }
.plan-summary__row { display: flex; justify-content: space-between; font-size: .88rem; padding-block: .5rem; border-bottom: 1px solid var(--border); }
.plan-summary__row:last-child { border-bottom: none; }
.history-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history-table th { text-align: left; color: var(--ink-faint); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.history-table td { padding-block: .65rem; border-bottom: 1px solid var(--border); color: var(--ink-muted); }
.history-empty { padding: 2rem 0; text-align: center; color: var(--ink-faint); font-size: .9rem; }

/* Auth page */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { max-width: 400px; width: 100%; padding: 2rem; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 1.5rem; }
.auth-tabs button { flex: 1; padding: .55rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--ink-muted); transition: all .2s var(--ease-out); }
.auth-tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .82rem; font-weight: 700; color: var(--ink-muted); }
.field input {
  padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); transition: border-color .2s var(--ease-out);
}
.field input:focus { border-color: var(--accent); }
.field small { color: var(--ink-faint); font-size: .78rem; }
.auth-error { background: var(--danger-soft); color: #9c2521; padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 1rem; }

/* Legal pages */
.legal { padding-block: 3rem; }
.legal h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: .8rem; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--ink-muted); font-size: .96rem; margin-bottom: .8rem; }
.legal ul { list-style: disc; padding-left: 1.3rem; }

/* =============================================================
   8. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .mock-box::after { animation: none; }
  .spinner { animation-duration: 1.6s; }
}

/* =============================================================
   9. Responsive
   ============================================================= */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero__grid { grid-template-columns: 1fr; }
  .mock-doc { max-width: 420px; margin-inline: auto; }
  .steps__grid, .features__grid, .pricing__grid { grid-template-columns: 1fr; }
  .tool-workspace { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .header-actions .btn--outline { display: none; }
  .footer__grid { flex-direction: column; }
}
@media (max-width: 540px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}
