/* =========================================================
   LexMarket — sitio público (azul marino + ámbar)
   ========================================================= */
:root {
  --navy: #0F172A; --navy-2: #1E293B; --navy-3: #334155;
  --amber: #F59E0B; --amber-2: #FBBF24; --amber-bg: #FEF3C7;
  --bg: #F8FAFC; --surface: #FFFFFF; --border: #E2E8F0;
  --text: #0F172A; --muted: #64748B;
  --green: #059669; --green-bg: #D1FAE5;
  --red: #DC2626; --red-bg: #FEE2E2;
  --blue: #2563EB; --blue-bg: #DBEAFE;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-full: 999px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; padding-top: 40px; padding-bottom: 64px; }
.narrow-wide { max-width: 760px; padding-top: 28px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
[hidden] { display: none !important; }
.material-symbols-outlined { font-size: 20px; vertical-align: middle; user-select: none; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--r-md); border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover { background: var(--amber-2); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #047857; box-shadow: 0 6px 16px rgba(5,150,105,.25); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Cabecera ---------- */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 6px 12px; flex-wrap: wrap; padding: 7px 16px; background: var(--amber-bg); color: #78350F; font-size: .82rem; text-align: center; }
.demo-bar a { color: #78350F; font-weight: 700; }
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { border-radius: 10px; }
.brand span { display: flex; flex-wrap: wrap; align-items: baseline; font-size: 1.25rem; line-height: 1.05; }
.brand strong { font-weight: 800; }
.brand em { font-style: normal; font-weight: 800; color: var(--amber); }
.brand small { flex-basis: 100%; font-size: .7rem; color: #94A3B8; font-weight: 500; }
.brand-small span { font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: #CBD5E1; text-decoration: none; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: .92rem; }
.nav a:not(.btn):hover { color: #fff; background: rgba(255,255,255,.07); }

/* ---------- Inicio ---------- */
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 55%, #1E1B4B 100%); color: #fff; padding: 64px 0 72px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(245,158,11,.16); color: var(--amber-2); font-size: .78rem; font-weight: 700; padding: 6px 12px; border-radius: var(--r-full); text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; margin: 16px 0; }
.lead { color: #CBD5E1; font-size: 1.08rem; max-width: 560px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { list-style: none; padding: 0; margin: 30px 0 0; display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--amber-2); }
.hero-stats span { font-size: .82rem; color: #94A3B8; }
.hero-doc { display: flex; justify-content: center; }
.paper { background: #fff; color: var(--text); border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.35); position: relative; }
.hero-doc .paper { width: min(420px, 100%); padding: 30px 30px 24px; font-family: 'Merriweather', serif; font-size: .82rem; line-height: 1.7; transform: rotate(1.5deg); }
.paper-title { text-align: center; font-weight: 700; letter-spacing: .08em; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.paper mark { background: var(--amber-bg); padding: 0 3px; border-radius: 3px; border-bottom: 1px solid var(--amber); }
.paper-lines span { display: block; height: 7px; border-radius: 4px; background: #EEF2F7; margin: 8px 0; }
.paper-lines span:nth-child(2) { width: 85%; } .paper-lines span:nth-child(3) { width: 60%; }
.paper-stamp { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding: 10px 12px; border: 1.5px solid var(--green); border-radius: 8px; color: var(--green); font-family: 'Inter', sans-serif; }
.paper-stamp .material-symbols-outlined { font-size: 30px; }
.paper-stamp small { display: block; color: var(--muted); font-size: .72rem; }

.section { padding: 72px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 26px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--amber); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

.catalog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.catalog-head .section-title { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--border); background: #fff; padding: 7px 14px; border-radius: var(--r-full); font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.doc-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.doc-card:hover { box-shadow: 0 10px 30px rgba(15,23,42,.1); transform: translateY(-2px); }
.doc-card-top { display: flex; justify-content: space-between; align-items: center; }
.tag { display: inline-block; background: var(--amber-bg); color: #92400E; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: var(--r-full); }
.doc-card h3 { font-size: 1.15rem; }
.doc-card p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.doc-lawyer { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--amber); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; flex-shrink: 0; }
.doc-card-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); }
.doc-card-foot strong { display: block; font-size: 1.3rem; }
.faq-wrap { max-width: 780px; }
.faq-wrap details { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px 18px; margin-bottom: 10px; }
.faq-wrap summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.faq-wrap details p { margin: 0 0 14px; color: var(--muted); }

/* ---------- Completar documento ---------- */
.filler { padding-top: 22px; padding-bottom: 60px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.filler-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 26px; align-items: start; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.form-card { padding: 26px; display: grid; gap: 16px; }
.form-card h1 { font-size: 1.6rem; font-weight: 800; }
.form-card > p { margin: -6px 0 0; }
.progress { height: 8px; background: #EEF2F7; border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--amber), var(--green)); transition: width .3s; }
.field-group { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field-group legend { grid-column: 1 / -1; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-3); padding: 10px 0 2px; border-top: 1px solid var(--border); width: 100%; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-wide, .field-group .field:only-of-type { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 700; color: var(--navy-3); }
.req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #CBD5E1; border-radius: var(--r-sm); font: inherit; font-size: .93rem; background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field .help { color: var(--muted); font-size: .76rem; }
.field .error { color: var(--red); font-size: .78rem; font-weight: 600; }
.input-prefix { display: flex; align-items: center; border: 1px solid #CBD5E1; border-radius: var(--r-sm); background: #fff; }
.input-prefix span { padding-left: 12px; color: var(--muted); font-weight: 600; }
.input-prefix input { border: 0; box-shadow: none !important; }
.input-prefix:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.check.has-error { color: var(--red); }
.pay-box { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.pay-box strong { display: block; font-size: 1.6rem; font-weight: 800; }

.preview-col { position: sticky; top: 84px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; background: var(--navy-2); color: #E2E8F0; padding: 11px 16px; border-radius: var(--r-lg) var(--r-lg) 0 0; font-size: .88rem; font-weight: 600; }
.preview-bar .material-symbols-outlined { color: var(--amber); margin-right: 6px; }
.badge { background: var(--navy-3); color: #CBD5E1; font-size: .72rem; padding: 3px 8px; border-radius: 5px; }
.preview-scroll { background: #CBD5E1; padding: 26px; border-radius: 0 0 var(--r-lg) var(--r-lg); max-height: calc(100vh - 150px); overflow-y: auto; }
.paper.doc { padding: 48px 52px 40px; min-height: 640px; font-family: 'Merriweather', serif; font-size: .9rem; line-height: 1.8; overflow: hidden; }
.doc p { text-align: justify; margin: 0 0 14px; }
.doc .clause { text-transform: uppercase; }
.doc-title { text-align: center; font-family: 'Inter', sans-serif; font-size: 1.05rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 22px; }
.watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: 'Inter', sans-serif; font-size: 6rem; font-weight: 900; letter-spacing: .1em; color: rgba(15,23,42,.06); transform: rotate(-32deg); user-select: none; }
.var { padding: 1px 4px; border-radius: 3px; }
.var-empty { background: #EEF2F7; color: #94A3B8; font-style: italic; font-family: 'Inter', sans-serif; font-size: .82em; }
.var-filled { background: var(--amber-bg); border-bottom: 1px solid var(--amber); font-weight: 700; }
.var-missing { color: #94A3B8; }
.doc-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 44px; font-family: 'Inter', sans-serif; font-size: .78rem; text-align: center; color: var(--muted); }
.sign-line { border-top: 1px solid #64748B; margin: 50px 0 6px; }
.sign-pending, .sign-stamp { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: -40px; padding: 8px; border: 1.5px dashed #CBD5E1; border-radius: 8px; font-size: .75rem; }
.sign-stamp { border: 1.5px solid var(--green); color: var(--green); text-align: left; justify-content: flex-start; }
.sign-stamp .material-symbols-outlined { font-size: 28px; }
.sign-stamp small { display: block; color: var(--muted); }

/* ---------- Pago, pedido y verificación ---------- */
.pay-card { padding: 30px; display: grid; gap: 16px; text-align: center; }
.pay-card h1 { font-size: 1.6rem; font-weight: 800; }
.test-ribbon { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: var(--r-md); background: var(--blue-bg); color: var(--blue); font-weight: 700; font-size: .85rem; }
.pay-icon { width: 62px; height: 62px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.pay-icon .material-symbols-outlined { font-size: 30px; }
.summary { margin: 0; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 8px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.summary .total { border-top: 1px solid var(--border); padding-top: 8px; font-size: 1.1rem; }
.summary .total dd { color: var(--green); }
.pay-actions { display: grid; gap: 10px; margin: 0; }

.order-page { padding-top: 28px; padding-bottom: 64px; }
.success-hero { text-align: center; margin-bottom: 24px; }
.success-hero > .material-symbols-outlined { font-size: 54px; color: var(--green); }
.success-hero h1 { font-size: 1.8rem; font-weight: 800; margin: 6px 0; }
.success-hero p { max-width: 640px; margin: 0 auto; }
.order-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 26px; align-items: start; }
.order-side { padding: 22px; display: grid; gap: 10px; position: sticky; top: 84px; }
.order-code { font-size: 1.5rem; font-weight: 800; letter-spacing: .03em; }
.order-side h2 { font-size: 1.1rem; margin-top: 4px; }
.order-side h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 8px; }
.order-side p { margin: 0; }
.status { justify-self: start; display: inline-block; padding: 5px 12px; border-radius: var(--r-full); font-size: .8rem; font-weight: 800; }
.status-ok { background: var(--green-bg); color: var(--green); }
.status-warn { background: var(--amber-bg); color: #92400E; }
.status-info { background: var(--blue-bg); color: var(--blue); }
.status-err { background: var(--red-bg); color: var(--red); }
.status-muted { background: #EEF2F7; color: var(--muted); }
.notice { border-radius: var(--r-md); padding: 14px; display: grid; gap: 8px; font-size: .9rem; }
.notice p { margin: 0; }
.notice-info { background: var(--blue-bg); color: #1E3A8A; }
.notice-ok { background: var(--green-bg); color: #065F46; }
.notice-err { background: var(--red-bg); color: #991B1B; }
.notice strong { display: flex; align-items: center; gap: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: .85rem; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: #CBD5E1; margin-top: 5px; }
.timeline .ev-paid .dot, .timeline .ev-signed .dot { background: var(--green); }
.timeline .ev-changes_requested .dot { background: var(--blue); }
.timeline .ev-rejected .dot { background: var(--red); }
.timeline p { margin: 0; }
.timeline time { color: var(--muted); font-size: .76rem; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: .9rem; }
.alert-error { background: var(--red-bg); color: #991B1B; }
.alert-ok { background: var(--green-bg); color: #065F46; margin-bottom: 18px; }
.big-icon { font-size: 44px !important; color: var(--amber); justify-self: center; }
.verify-card { text-align: center; }
.verify-form { display: flex; gap: 8px; }
.verify-form input { flex: 1; min-height: 46px; padding: 0 14px; border: 1px solid #CBD5E1; border-radius: var(--r-sm); font: inherit; font-size: 1rem; letter-spacing: .06em; }
.verify-result { display: flex; gap: 12px; text-align: left; padding: 16px; border-radius: var(--r-md); }
.verify-result > .material-symbols-outlined { font-size: 32px; }
.verify-result.ok { background: var(--green-bg); color: #065F46; }
.verify-result.bad { background: var(--red-bg); color: #991B1B; }
.verify-result dl { margin: 8px 0; display: grid; gap: 4px; font-size: .88rem; }
.verify-result dl div { display: flex; gap: 8px; }
.verify-result dt { min-width: 120px; opacity: .8; }
.verify-result dd { margin: 0; font-weight: 700; }
.verify-result p { margin: 0; }

.site-footer { background: var(--navy); color: #94A3B8; padding: 36px 0 20px; margin-top: 30px; font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 8px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a, .footer-bottom a { color: #CBD5E1; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--navy-3); font-size: .78rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner, .filler-grid, .order-grid { grid-template-columns: 1fr; }
  .hero-doc { display: none; }
  .steps { grid-template-columns: 1fr 1fr; }
  .preview-col, .order-side { position: static; }
  .preview-scroll { max-height: none; }
}
@media (max-width: 720px) {
  .nav a:not(.btn) { display: none; }
  .steps, .field-group { grid-template-columns: 1fr; }
  .paper.doc { padding: 28px 22px; font-size: .84rem; }
  .preview-scroll { padding: 12px; }
  .watermark { font-size: 3.6rem; }
  .form-card { padding: 20px; }
  .pay-box .btn { width: 100%; }
  .doc-signs { grid-template-columns: 1fr; }
}
