/* ═══════════════ Sistemimap — estilos ═══════════════ */
:root {
  --primary: #6d5efc;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e3e6f0;
  --text: #1c2030;
  --muted: #687089;
  --success: #12a454;
  --success-bg: #e5f7ed;
  --danger: #e0384b;
  --danger-bg: #fdecee;
  --warning: #c98a00;
  --warning-bg: #fff6dd;
  --info-bg: #ecebff;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 8px 24px rgba(20, 24, 40, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar: #141726;
  --sidebar-text: #aeb4cc;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f111a;
    --surface: #171a26;
    --surface-2: #1d2130;
    --border: #2a2f42;
    --text: #e8eaf3;
    --muted: #949bb5;
    --success-bg: #0f2c1e;
    --danger-bg: #36161c;
    --warning-bg: #33290d;
    --info-bg: #242149;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --sidebar: #0b0d15;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }

/* ─────────── Botones ─────────── */
.btn {
  --b: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--b);
  background: var(--b); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .05s, background .15s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-danger { --b: var(--danger); }
.btn-success { --b: var(--success); }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 7px; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; font: inherit; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.inline { display: inline; margin: 0; }

/* ─────────── Formularios ─────────── */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Interruptor */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 500; margin-bottom: 14px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: var(--border); position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; margin: 1px 0 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch small { display: block; color: var(--muted); font-weight: 400; }

/* Selector por tarjetas */
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.choice label { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; font-weight: 600; background: var(--surface); }
.choice label small { display: block; font-weight: 400; color: var(--muted); }
.choice input { margin-right: 6px; accent-color: var(--primary); }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }

/* ─────────── Tarjetas y alertas ─────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 18px 22px 0; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.alert ul { margin: 0; padding-left: 18px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--primary); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ─────────── Tablas ─────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .55; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table tr.editing { display: none; }
.table tr.editing.open { display: table-row; }
.table tr.editing td { background: var(--surface-2); }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .emoji { font-size: 2rem; display: block; margin-bottom: 6px; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); color: var(--text); font-size: .88rem; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══════════════ Área pública ═══════════════ */
.public { min-height: 100vh; display: flex; flex-direction: column; background:
  radial-gradient(1200px 500px at 50% -120px, color-mix(in srgb, var(--primary) 26%, transparent), transparent 70%), var(--bg); }
.public header.top { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; max-width: 980px; margin: 0 auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #ff5fa2)); display: grid; place-items: center; color: #fff; font-size: 1rem; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent); }
.public main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }
.hero { text-align: center; margin: 34px 0 26px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.search-card { max-width: 620px; margin: 0 auto; padding: 26px; }
.search-form { display: flex; gap: 10px; }
.search-form input { padding: 14px 16px; font-size: 1.02rem; }
@media (max-width: 560px) { .search-form { flex-direction: column; } }
.trust { display: flex; gap: 18px; justify-content: center; color: var(--muted); font-size: .85rem; margin-top: 16px; flex-wrap: wrap; }
.public footer { text-align: center; padding: 22px; color: var(--muted); font-size: .85rem; }

.results { margin-top: 34px; }
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-head h2 { font-size: 1.2rem; margin: 0; }
.message { padding: 0; overflow: hidden; }
.message + .message { margin-top: 18px; }
.message-head { padding: 18px 22px; display: flex; gap: 14px; align-items: flex-start; border-bottom: 1px solid var(--border); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--info-bg); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; text-transform: uppercase; }
.message-head h3 { font-size: 1.02rem; margin: 0 0 2px; word-break: break-word; }
.message-meta { color: var(--muted); font-size: .86rem; word-break: break-all; }
.message-date { margin-left: auto; text-align: right; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.codes { padding: 18px 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.code-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent); padding: 10px 12px 10px 18px; border-radius: 12px; }
.code-box .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.7rem; font-weight: 800; letter-spacing: .14em; color: var(--primary); }
.message-body iframe { width: 100%; border: 0; display: block; min-height: 180px; height: 420px; background: #fff; }
.message-foot { padding: 10px 22px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════ Panel de administración ═══════════════ */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { color: #fff; padding: 4px 10px 22px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6c7391; padding: 14px 12px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--sidebar-text); font-weight: 500; font-size: .93rem; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--primary) 85%, #000); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.nav .ico { width: 20px; text-align: center; font-size: 1rem; }
.nav .count { margin-left: auto; font-size: .72rem; background: rgba(255,255,255,.1); padding: 1px 8px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.07); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.me .avatar { width: 34px; height: 34px; font-size: .85rem; background: rgba(255,255,255,.1); color: #fff; }
.me strong { color: #fff; display: block; font-size: .9rem; }
.me small { font-size: .75rem; }
.sidebar .btn-ghost { color: var(--sidebar-text); border-color: rgba(255,255,255,.12); }
.sidebar .btn-ghost:hover { background: rgba(255,255,255,.06); color: #fff; }

.admin-main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar .sub { color: var(--muted); font-size: .86rem; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 28px 32px 60px; max-width: 1240px; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .menu-toggle { display: inline-flex; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 600; display: flex; justify-content: space-between; }
.stat .value { font-size: 1.9rem; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .foot { font-size: .8rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.dash-grid .card + .card { margin-top: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.chart .bar .total { background: color-mix(in srgb, var(--primary) 25%, transparent); border-radius: 5px 5px 0 0; position: relative; min-height: 2px; }
.chart .bar .ok { position: absolute; left: 0; right: 0; bottom: 0; background: var(--primary); border-radius: 5px 5px 0 0; }
.chart-labels { display: flex; gap: 6px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.list-plain li:last-child { border-bottom: 0; }

.checklist li { justify-content: flex-start; }
.checklist .ok { color: var(--success); }
.checklist .no { color: var(--warning); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 220px; }

.tester-result { margin-top: 12px; }
.folder-list { max-height: 180px; overflow: auto; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.folder-list button { cursor: pointer; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 400px at 50% 0, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 30px; }
.auth .brand { justify-content: center; margin-bottom: 8px; }

/* Página de error */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 20px; }
.error-page .code { font-size: 4.5rem; font-weight: 900; color: var(--primary); letter-spacing: -.04em; line-height: 1; }
.grid-side { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.grid-side .card + .card { margin-top: 0; }
@media (max-width: 1000px) { .grid-side { grid-template-columns: 1fr; } }
.grid-2 > .card + .card { margin-top: 0; }
.stats > .card + .card, .dash-grid > .card + .card { margin-top: 0; }
@media (max-width: 560px) {
  .message-head { flex-wrap: wrap; padding: 16px; }
  .message-head > div:nth-child(2) { flex: 1; min-width: 0; }
  .message-date { margin-left: 56px; text-align: left; display: flex; gap: 8px; }
  .codes { padding: 14px 16px; }
  .code-box .code { font-size: 1.4rem; }
}

/* ═══════════════ Temas del sitio público ═══════════════ */
.bg-fx { display: none; }
.public > *:not(.bg-fx) { position: relative; z-index: 1; }
.preview-bar { background: #111; color: #fff; text-align: center; padding: 9px 16px; font-size: .88rem; }
.preview-bar a { color: #ffd76a; margin-left: 6px; }
.logo-img { width: 36px; height: 36px; object-fit: contain; border-radius: 9px; }

/* Plataformas y logos */
.platforms { margin: 0 auto 28px; max-width: 760px; text-align: center; }
.platforms-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; margin: 0 0 14px; }
.platform-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.platform { --pc: var(--primary); display: flex; align-items: center; gap: 9px; padding: 9px 15px 9px 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: .9rem; transition: transform .15s, box-shadow .15s, border-color .15s; }
.platform:hover { transform: translateY(-2px); border-color: var(--pc); box-shadow: 0 8px 22px color-mix(in srgb, var(--pc) 30%, transparent); }
.pl-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--pc); color: #fff; flex-shrink: 0; overflow: hidden; }
.pl-icon svg { width: 18px; height: 18px; }
.pl-icon img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pl-initial { font-weight: 900; font-size: 1rem; }
.avatar-platform { background: var(--pc) !important; color: #fff !important; overflow: hidden; }
.avatar-platform svg { width: 22px; height: 22px; }
.avatar-platform img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.platform-tag { --pc: var(--primary); display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--pc); margin-bottom: 2px; }

/* ── Tema: Plataformas (streaming oscuro) ── */
.theme-plataformas {
  --bg: #08080c; --surface: #14141c; --surface-2: #1b1b25; --border: #272733; --text: #f3f3f6; --muted: #9a9aab;
  --info-bg: #23202c; --danger-bg: #3a1218; --success-bg: #0f2a1b; --warning-bg: #2f260c;
  --shadow: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
}
.theme-plataformas.public { background: radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, var(--primary) 38%, transparent), transparent 70%), linear-gradient(#08080c, #0d0d14); }
.theme-plataformas .hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); text-transform: none; }
.theme-plataformas .platforms { max-width: 860px; }
.theme-plataformas .platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-plataformas .platform { flex-direction: column; justify-content: center; padding: 18px 10px 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 22%, #14141c), #121219); border-color: color-mix(in srgb, var(--pc) 35%, #272733); }
.theme-plataformas .platform .pl-icon { width: 54px; height: 54px; border-radius: 14px; background: transparent; color: var(--pc); filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--pc) 55%, transparent)); }
.theme-plataformas .platform .pl-icon svg { width: 40px; height: 40px; }
.theme-plataformas .platform .pl-initial { font-size: 1.9rem; }
.theme-plataformas .platform .pl-name { font-size: .85rem; }
.theme-plataformas .platform[style*="#000000"] .pl-icon, .theme-plataformas .platform[style*="#555555"] .pl-icon { color: #fff; }
.theme-plataformas .search-card { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }

/* ── Tema: Premium (negro y dorado) ── */
.theme-premium {
  --bg: #050507; --surface: rgba(255,255,255,.045); --surface-2: rgba(255,255,255,.06); --border: rgba(212,175,55,.22);
  --text: #f6f1e4; --muted: #a8a191; --info-bg: rgba(212,175,55,.12); --danger-bg: rgba(224,56,75,.15); --success-bg: rgba(18,164,84,.15); --warning-bg: rgba(201,138,0,.15);
  --shadow: 0 20px 50px rgba(0,0,0,.55); --radius: 18px; color-scheme: dark;
}
.theme-premium.public { background: #050507; }
.theme-premium .bg-fx { display: block; position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.theme-premium .bg-fx span { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: .32; animation: float 18s ease-in-out infinite alternate; }
.theme-premium .bg-fx span:nth-child(1) { background: var(--primary); top: -180px; left: -120px; }
.theme-premium .bg-fx span:nth-child(2) { background: #8a6a12; bottom: -220px; right: -160px; animation-delay: -6s; }
.theme-premium .bg-fx span:nth-child(3) { background: #f3e2a9; top: 40%; left: 55%; width: 300px; height: 300px; opacity: .12; animation-delay: -12s; }
@keyframes float { to { transform: translate(60px, 40px) scale(1.12); } }
.theme-premium .card { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.theme-premium .hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -.01em; background: linear-gradient(180deg, #fff6d8, var(--primary) 70%, #8a6a12); -webkit-background-clip: text; background-clip: text; color: transparent; }
.theme-premium .hero::before { content: "★ PREMIUM ★"; display: inline-block; font-size: .72rem; letter-spacing: .32em; color: var(--primary); border: 1px solid var(--border); padding: 5px 14px; border-radius: 99px; margin-bottom: 18px; }
.theme-premium .btn:not(.btn-ghost) { background: linear-gradient(135deg, #fff1c1, var(--primary) 45%, #9c7a1c); color: #1a1405; border-color: transparent; box-shadow: 0 8px 26px color-mix(in srgb, var(--primary) 35%, transparent); }
.theme-premium .logo { background: linear-gradient(135deg, #fff1c1, var(--primary), #8a6a12); color: #1a1405; }
.theme-premium input[type=email] { background: rgba(0,0,0,.35); border-color: var(--border); }
.theme-premium .code-box { background: rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.theme-premium .search-card { box-shadow: 0 0 0 1px rgba(212,175,55,.12), 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06); }

/* ── Tema: Aurora (degradado animado) ── */
.theme-aurora {
  --surface: rgba(255,255,255,.14); --surface-2: rgba(255,255,255,.1); --border: rgba(255,255,255,.28);
  --text: #ffffff; --muted: rgba(255,255,255,.78); --info-bg: rgba(255,255,255,.18); --danger-bg: rgba(255,255,255,.92); --success-bg: rgba(255,255,255,.92); --warning-bg: rgba(255,255,255,.92);
  --shadow: 0 20px 50px rgba(30,10,60,.35); --radius: 22px; color-scheme: dark;
}
.theme-aurora.public { background: linear-gradient(125deg, #6d28d9, #db2777, #f59e0b, #0ea5e9, #7c3aed); background-size: 400% 400%; animation: aurora 22s ease infinite; }
@keyframes aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.theme-aurora .card { backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }
.theme-aurora .hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); text-shadow: 0 4px 30px rgba(0,0,0,.18); }
.theme-aurora .btn:not(.btn-ghost) { background: #fff; color: #4c1d95; border-color: #fff; }
.theme-aurora .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.theme-aurora input[type=email] { background: rgba(255,255,255,.92); color: #1c2030; border-color: transparent; }
.theme-aurora .logo { background: #fff; color: #7c3aed; }
.theme-aurora .code-box { background: rgba(255,255,255,.95); border-color: rgba(124,58,237,.5); }
.theme-aurora .code-box .code { color: #6d28d9; }
.theme-aurora .alert-error { color: #b4232f; }
.theme-aurora .alert-success { color: #0d7a3e; }
.theme-aurora .codes .muted, .theme-aurora .message-meta { color: rgba(255,255,255,.85); }
.theme-aurora .platform { background: rgba(255,255,255,.16); }
.theme-aurora .preview-bar, .theme-aurora .public footer { color: #fff; }

/* ── Tema: Minimal ── */
.theme-minimal {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #fafafa; --border: #e6e6e6; --text: #111111; --muted: #6b6b6b;
  --info-bg: #f3f3f3; --danger-bg: #fdf0f0; --success-bg: #effaf3; --warning-bg: #fff8e6;
  --shadow: none; --radius: 6px; --radius-sm: 4px; color-scheme: light;
}
.theme-minimal.public { background: #fff; }
.theme-minimal .hero { margin-top: 56px; }
.theme-minimal .hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.02em; }
.theme-minimal .logo { background: var(--text); box-shadow: none; border-radius: 4px; }
.theme-minimal .btn:not(.btn-ghost) { box-shadow: none; }
.theme-minimal .search-card { border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; padding: 30px 4px; }
.theme-minimal .trust { display: none; }
.theme-minimal header.top { border-bottom: 1px solid var(--border); max-width: none; }
.theme-minimal .code-box { border-style: solid; border-width: 1px; border-color: var(--text); }
.theme-minimal .code-box .code { color: var(--text); }
.theme-minimal .platform { border-radius: 99px; }
.theme-minimal .pl-icon { border-radius: 50%; width: 26px; height: 26px; }
.theme-minimal .pl-icon svg { width: 14px; height: 14px; }

/* ═══════════════ Selector de temas (panel) ═══════════════ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.theme-option { margin: 0; padding: 0; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .15s, box-shadow .15s; display: block; }
.theme-option:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.theme-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-thumb { position: relative; height: 210px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.theme-thumb iframe { width: 1280px; height: 840px; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; position: absolute; top: 0; left: 0; }
.theme-info { padding: 14px 16px; }
.theme-info strong { font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theme-info p { margin: 4px 0 10px; font-size: .85rem; color: var(--muted); }
.theme-check { display: none; }
.theme-option:has(input:checked) .theme-check { display: inline-flex; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.theme-aurora .code-box .btn { background: #6d28d9; color: #fff; border-color: #6d28d9; }
@media (max-width: 560px) {
  .theme-plataformas .platform-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .theme-plataformas .platform { padding: 12px 6px 10px; }
  .theme-plataformas .platform .pl-icon { width: 40px; height: 40px; }
  .theme-plataformas .platform .pl-icon svg { width: 30px; height: 30px; }
  .theme-plataformas .platform .pl-name { font-size: .74rem; }
}

/* Acceso de clientes */
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.client-chip { font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.login-card { max-width: 420px; }
.quick-emails { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.quick-emails .badge { cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; }
.quick-emails .badge:hover { border-color: var(--primary); color: var(--primary); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.checks label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-weight: 500; cursor: pointer; background: var(--surface); }
.checks label:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }
.checks input { accent-color: var(--primary); }
.theme-preview-img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* ═══════════════ Pantallas de acceso ═══════════════ */
.ico-svg { width: 18px; height: 18px; flex-shrink: 0; }
.input-icon { position: relative; }
.input-icon > .ico-svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; }
.input-icon input { padding-left: 44px !important; padding-top: 13px; padding-bottom: 13px; }
.input-icon input[type=password], .input-icon input[data-capslock] { padding-right: 46px; }
.input-icon:focus-within > .ico-svg { color: var(--primary); }
.input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.input-action:hover { color: var(--text); background: var(--surface-2); }
.input-action.on { color: var(--primary); }
.caps-warning { margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--warning); }
.auth-submit .btn-label { display: inline-flex; align-items: center; gap: 8px; }
.auth-submit .ico-svg { transition: transform .2s; }
.auth-submit:hover .ico-svg { transform: translateX(4px); }

/* ── Acceso del panel (pantalla dividida) ── */
.auth-page { background: var(--bg); }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-visual {
  position: relative; overflow: hidden; color: #fff; padding: 40px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--primary) 0%, transparent 55%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--primary) 60%, #ff4fa0) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 55%, #0b0d1a), #0b0d1a 75%);
}
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.auth-orbs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 16s ease-in-out infinite alternate; }
.auth-orbs span:nth-child(1) { width: 380px; height: 380px; background: var(--primary); top: -120px; right: -80px; }
.auth-orbs span:nth-child(2) { width: 300px; height: 300px; background: #ff4fa0; bottom: -100px; left: -60px; opacity: .35; animation-delay: -5s; }
.auth-orbs span:nth-child(3) { width: 220px; height: 220px; background: #38bdf8; top: 45%; left: 40%; opacity: .2; animation-delay: -10s; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .brand { color: #fff; font-size: 1.15rem; }
.auth-visual .logo { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.auth-visual-body { margin: auto 0; max-width: 520px; padding: 40px 0; }
.auth-kicker { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.75); padding: 6px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 99px; background: rgba(255,255,255,.06); }
.auth-visual h2 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin: 22px 0 30px; }
.auth-visual h2 em { font-style: normal; background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--primary) 35%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .85; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; }
.auth-features strong { display: block; font-size: .98rem; }
.auth-features small { color: rgba(255,255,255,.68); font-size: .86rem; }
.f-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); flex-shrink: 0; }
.auth-float { margin-top: 38px; width: 280px; padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 24px 50px rgba(0,0,0,.35); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: bob 6s ease-in-out infinite; }
.af-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: rgba(255,255,255,.75); }
.af-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.2); }
.af-time { margin-left: auto; }
.af-code { font: 800 2rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; margin: 8px 0 12px; }
.af-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; }
.af-bar span { display: block; height: 100%; width: 60%; background: #fff; border-radius: 4px; animation: countdown 8s linear infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(-1deg); } }
@keyframes countdown { from { width: 100%; } to { width: 0; } }
.auth-visual-foot { font-size: .8rem; color: rgba(255,255,255,.55); }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-mobile-brand { display: none; margin-bottom: 26px; }
.auth-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--primary); background: var(--info-bg); padding: 6px 12px; border-radius: 99px; }
.auth-pill .ico-svg { width: 15px; height: 15px; }
.auth-box h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; margin: 16px 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 26px; }
.auth-box .btn-lg { padding: 15px 24px; margin-top: 6px; box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 35%, transparent); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-foot .ico-svg { width: 15px; height: 15px; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-main { background:
    radial-gradient(700px 360px at 50% -60px, color-mix(in srgb, var(--primary) 32%, transparent), transparent 70%), var(--bg); align-items: start; padding-top: 56px; }
  .auth-mobile-brand { display: flex; }
}

/* ── Acceso de clientes (se adapta al tema activo) ── */
.client-auth { display: grid; place-items: center; padding: 26px 0 10px; }
.ca-card { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr; border-radius: calc(var(--radius) + 6px); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow), 0 30px 80px rgba(20, 20, 40, .12); }
.ca-side {
  position: relative; overflow: hidden; color: #fff; padding: 40px 36px; display: flex; flex-direction: column;
  background: linear-gradient(150deg, var(--primary), color-mix(in srgb, var(--primary) 45%, #0b0d1a));
}
.ca-side > * { position: relative; z-index: 1; }
.ca-glow { position: absolute !important; z-index: 0 !important; width: 360px; height: 360px; right: -140px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.35), transparent 65%); }
.ca-side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(200deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(200deg, #000, transparent 60%); }
.ca-lock { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28), 0 10px 30px rgba(0,0,0,.2); }
.ca-lock .ico-svg { width: 26px; height: 26px; }
.ca-side h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: 22px 0 8px; color: #fff; }
.ca-side p { color: rgba(255,255,255,.82); margin: 0 0 22px; }
.ca-perks { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 12px; font-weight: 600; font-size: .93rem; }
.ca-perks li { display: flex; align-items: center; gap: 10px; }
.ca-perks .ico-svg { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: rgba(255,255,255,.14); }
.ca-platforms { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.ca-pl { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--pc); box-shadow: 0 6px 16px rgba(0,0,0,.15); overflow: hidden; }
.ca-pl svg { width: 20px; height: 20px; }
.ca-pl img { width: 100%; height: 100%; object-fit: contain; }
.ca-pl .pl-initial { font-weight: 900; }
.ca-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.ca-form h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.ca-form > p.muted { margin: 0 0 24px; }
.ca-form .btn-lg { padding: 15px 24px; margin-top: 4px; }
.ca-back { text-align: center; margin: 18px 0 0; }
@media (max-width: 760px) {
  .ca-card { grid-template-columns: 1fr; }
  .ca-side { padding: 28px 24px; }
  .ca-side h1 { font-size: 1.5rem; margin-top: 14px; }
  .ca-perks { display: none; }
  .ca-platforms { margin-top: 4px; }
  .ca-form { padding: 28px 22px 32px; }
}
/* Ajustes por tema */
.theme-premium .ca-side { background: linear-gradient(150deg, #2a2108, #0a0906 70%); color: #f6f1e4; box-shadow: inset 0 0 0 1px rgba(212,175,55,.25); }
.theme-premium .ca-side h1 { background: linear-gradient(180deg, #fff6d8, var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: Georgia, serif; }
.theme-premium .ca-lock, .theme-premium .ca-perks .ico-svg { color: var(--primary); background: rgba(212,175,55,.12); box-shadow: inset 0 0 0 1px rgba(212,175,55,.3); }
.theme-aurora .ca-card { backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }
.theme-aurora .ca-side { background: rgba(255,255,255,.12); }
.theme-aurora .ca-form input { background: rgba(255,255,255,.92); color: #1c2030; }
.theme-aurora .ca-form .input-icon > .ico-svg { color: #6b7280; }
.theme-minimal .ca-card { box-shadow: none; border-radius: 6px; }
.theme-minimal .ca-side { background: #111; }
.theme-minimal .ca-side h1 { font-family: Georgia, serif; font-weight: 400; }
.theme-plataformas .ca-side { background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 55%, #14141c), #0b0b10 75%); }
.ca-form > p.ca-back { text-align: center; margin: 20px 0 0; }
.ca-platforms { gap: 7px; }
.ca-pl { width: 34px; height: 34px; border-radius: 10px; }
.ca-pl svg { width: 18px; height: 18px; }
.theme-aurora .ca-form .input-action { color: #6b7280; }
.theme-aurora .ca-form .input-action:hover { background: rgba(0,0,0,.06); color: #1c2030; }
