:root {
  --bg: #f6f7fb; --card: #fff; --ink: #0f1b2d; --muted: #5b6577; --line: #e3e7ef;
  --sky: #3b5bfd; --sky-ink: #fff; --amber: #ffb020; --ok: #12a150; --red: #d92d20;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --card: #131c2e; --ink: #eef2f8; --muted: #9aa6ba; --line: #24314a;
    --sky: #6d86ff; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--sky); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* cabecera / pie */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1040px; margin: 0 auto; padding: 16px; }
.top nav { display: flex; gap: 18px; align-items: center; font-size: .95rem; }
.top nav a { color: var(--ink); text-decoration: none; }
.brand img { height: 28px; width: auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: invert(1) hue-rotate(180deg); } }
.who { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.who img { border-radius: 50%; }
.who form { margin: 0; }
.foot { max-width: 1040px; margin: 48px auto 0; padding: 24px 16px 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

/* botones */
.btn { display: inline-block; background: var(--sky); color: var(--sky-ink); border: 0; border-radius: 999px; padding: .75em 1.4em;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(59,91,253,.3); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--sky); border: 1.5px solid var(--sky); }
.btn.big { font-size: 1.1rem; padding: .9em 1.8em; }
.btn.red { background: var(--red); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--sky); cursor: pointer; text-decoration: underline; }
.link.red, .red { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.center { text-align: center; max-width: 560px; margin: 40px auto; }
.flash { background: #e8f7ee; color: #0b6b35; border-radius: 10px; padding: 10px 14px; }
.warn { background: #fff4e0; color: #8a5300; border-radius: 10px; padding: 10px 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flash { background: #0f2e1d; color: #7fe0a8; }
  :root:not([data-theme="light"]) .warn { background: #33250b; color: #ffcf7a; } }

/* panel */
.app main { padding-top: 8px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 12px 0 20px; flex-wrap: wrap; }
.meter { height: 6px; background: var(--line); border-radius: 99px; width: min(320px, 70vw); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--sky); }
.auto-top { display: flex; gap: 14px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.thumb.any { display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: .8rem; border: 1px dashed var(--line); }
.tag { font-size: .75rem; padding: .15em .6em; border-radius: 99px; vertical-align: middle; font-weight: 600; }
.tag.on { background: #e3f6ea; color: var(--ok); } .tag.off { background: var(--bg); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 0; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stats dt { font-size: .78rem; color: var(--muted); } .stats dd { margin: 0; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } .auto-top .btn { padding: .5em 1em; } }
.empty { text-align: center; padding: 36px 22px; }
.danger { margin-top: 40px; color: var(--muted); } .danger summary { cursor: pointer; }

/* formulario */
.form label { display: block; margin: 0 0 14px; font-weight: 600; }
.form small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.form input:not([type=checkbox]):not([type=radio]), .form textarea { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 400; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--sky); outline-offset: 1px; border-color: transparent; }
.form .check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.form .check input { width: 20px; height: 20px; accent-color: var(--sky); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.media { position: relative; margin: 0 !important; cursor: pointer; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; }
.media input { position: absolute; opacity: 0; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.any { display: grid; place-items: center; background: var(--bg); text-align: center; font-size: .85rem; padding: 6px; border: 2px dashed var(--line); }
.media:has(input:checked) { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(59,91,253,.25); }
.actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); }
.delete { margin-top: 12px; }

/* web pública */
.hero { padding: 40px 0 24px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.hero small { color: var(--muted); }
.phone { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); max-width: 340px; justify-self: center; }
.bubble { border-radius: 18px; padding: 10px 14px; margin: 8px 0; font-size: .95rem; max-width: 88%; }
.bubble.in { background: var(--bg); } .bubble.out { background: var(--sky); color: #fff; margin-left: auto; }
.bubble .b { display: block; margin-top: 8px; text-align: center; background: rgba(255,255,255,.18); border-radius: 10px; padding: 6px; font-weight: 700; font-size: .85rem; }
.comment { font-size: .92rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 6px; }
.comment b { margin-right: 6px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 16px; } }
.section { padding: 40px 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.steps .card::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--amber); color: #111; font-weight: 800; margin-bottom: 10px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan .price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 1.1em; margin: 12px 0 18px; } .plan li { margin: 4px 0; }
.plan.featured { border: 2px solid var(--sky); }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.legal { max-width: 760px; }
.legal h1 { font-size: 2rem; } .legal h2 { margin-top: 1.6em; }
.legal table { border-collapse: collapse; width: 100%; font-size: .95rem; } .legal td, .legal th { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legal .tablewrap { overflow-x: auto; }
