/* Substance Intelligence · edición externa (membresía) */
:root {
  --navy: #0b1f3a;
  --blue: #1d4ed8;
  --blue-2: #2563eb;
  --blue-soft: #e8f0ff;
  --ink: #0f172a;
  --muted: #5b6b82;
  --line: #dbe3ee;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fff4e2;
  --err: #b91c1c;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .07);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
img { max-width: 100%; }
.hidden { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 12px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; border-color: #b9c7da; }
.btn-light { background: #fff; color: var(--navy); }
.btn-danger { background: var(--err-soft); color: var(--err); }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfd3ff; border-color: var(--blue-2); }
input[type=file] { width: 100%; padding: 14px; border: 1px dashed #a9bad3; border-radius: 12px; background: #f8fbff; font: inherit; }
textarea { min-height: 130px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 16px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }

/* ---------- avisos */
.status { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f1f5fb; color: var(--muted); font-size: 14px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.err { background: var(--err-soft); color: var(--err); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f7; color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.notice { display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--blue-soft); color: #1e3a8a; }
.notice.warn { background: var(--warn-soft); color: #7c3f00; }
.notice strong { display: block; }

/* ---------- público */
.pub-header { position: sticky; top: 0; z-index: 10; background: rgba(244, 247, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(219, 227, 238, .7); }
.pub-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--navy); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: -.02em; }
.brand-name { font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.pub-actions { display: flex; gap: 10px; }
.hero { background: radial-gradient(1200px 500px at 85% -10%, #2b5fd9 0, transparent 60%), linear-gradient(160deg, var(--navy), #10305c);
  color: #fff; padding: 84px 0 96px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.07; letter-spacing: -.03em; margin: 0 0 18px; max-width: 760px; }
.hero p { font-size: 19px; color: #c7d6ef; max-width: 640px; margin: 0 0 30px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 10px; }
.hero .eyebrow { color: #9cc0ff; }
.section { padding: 76px 0; }
.section h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.02em; margin: 0 0 12px; }
.section .lead { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0 0 36px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .n { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 800;
  display: grid; place-items: center; margin-bottom: 14px; }
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); position: relative; }
.plan.featured { border: 2px solid var(--blue); }
.plan .tag { position: absolute; top: -12px; left: 26px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; }
.plan h3 { margin: 0 0 4px; font-size: 19px; }
.price { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; }
.price small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan ul { padding: 0; margin: 18px 0 24px; list-style: none; }
.plan li { padding: 7px 0 7px 26px; position: relative; color: #334155; font-size: 15px; }
.plan li::before { content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 8px; border-left: 2.5px solid var(--ok);
  border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.paybox { margin-top: 26px; max-width: 900px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 650; cursor: pointer; }
.faq p { color: var(--muted); margin: 10px 0 0; }
.pub-footer { background: var(--navy); color: #a9bbd6; padding: 34px 0; font-size: 14px; }
.pub-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.pub-footer a { color: #dbe7ff; }

/* ---------- autenticación */
.auth { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 470px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 0 0 8px; }
.auth-links { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- aplicación */
.app-top { background: var(--navy); color: #fff; }
.app-top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.app-top .brand { color: #fff; }
.app-top .brand-name small { color: #9fb4d4; }
.app-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #c9d6ea; min-width: 0; }
.app-user span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.app-user .btn { color: #fff; border-color: rgba(255,255,255,.25); }
.app-nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.app-nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.app-nav .wrap::-webkit-scrollbar { display: none; }
.app-nav a { padding: 15px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap;
  border-bottom: 2.5px solid transparent; }
.app-nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.app-main { padding: 28px 0 70px; }
.page-title { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card > p { color: var(--muted); margin: 0 0 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: 13px; }
.meter { height: 9px; background: #e6edf6; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter > div { height: 100%; background: var(--blue); border-radius: 99px; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid #edf1f6; }
.todo li:first-child { border-top: 0; }
.todo .dot { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: #eef2f7; color: var(--muted); }
.todo .dot.done { background: var(--ok); color: #fff; }
.todo strong { display: block; }
.todo small { color: var(--muted); }
.downloads { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.lock { text-align: center; padding: 44px 24px; }
.lock .ic { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; background: var(--warn-soft); display: grid; place-items: center; }
.lock h3 { margin: 0 0 6px; }
.lock p { color: var(--muted); max-width: 520px; margin: 0 auto 18px; }
.progress { height: 10px; border-radius: 99px; background: #e6edf6; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue), #60a5fa); transition: width .4s; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.tbl-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.bank { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.bank dt { color: var(--muted); }
.bank dd { margin: 0; font-weight: 650; word-break: break-all; }
.logo-prev { height: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; margin-top: 8px; }
.footer-fixed { padding: 12px 14px; border-radius: 12px; background: #f1f5fb; color: #334155; font-size: 13px; border: 1px dashed #b9c7da; }
.sig-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.sig { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.sig img { height: 70px; object-fit: contain; display: block; margin-bottom: 8px; }
.sig strong { display: block; }
.sig small { color: var(--muted); display: block; margin-bottom: 8px; }
.pad-wrap { border: 1.5px dashed #a9bad3; border-radius: 14px; background: #fff; position: relative; touch-action: none; }
canvas.pad { width: 100%; height: 190px; display: block; border-radius: 14px; cursor: crosshair; }
.pad-hint { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #b7c3d4; pointer-events: none;
  border-top: 1px solid #e3e9f2; margin: 0 30px; padding-top: 6px; font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.subtabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.subtabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; }
.subtabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.legal-foot { color: var(--muted); font-size: 12px; text-align: center; padding: 26px 0 40px; }

@media (max-width: 900px) {
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .steps, .features, .plans, .cols, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 64px; }
  .pub-actions .btn-ghost { display: none; }
  .app-user span { display: none; }
  .card { padding: 18px; }
  .auth-card { padding: 24px; }
}
