@font-face {
  font-family: 'Archivo Variable';
  src: url('/assets/fonts/archivo-wdth.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #000;
  --surface: #10151f;
  --surface-2: #171e2c;
  --line: #263044;
  --text: #e8eef8;
  --muted: #8a9bb8;
  --samp: #fcd116;
  --mta: #1e5fd8;
  --mta-text: #4c8df6;
  --bot: #ce1126;
  --bot-text: #ff5a6a;
  --ok: #3ddc84;
  --warn: #ffb020;
  --bad: #ff5a6a;
  --accent: var(--text);
  --radius: 10px;
  --font: 'Archivo Variable', 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1rem; line-height: 1.6; font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--mta-text); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--text); color: #000; padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 8px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.wrap.wide { width: min(1180px, 100% - 32px); }

h1, h2, h3, h4 { font-stretch: 125%; font-weight: 800; line-height: 1.1; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; margin-top: 1.6em; }
h4 { font-size: 1rem; margin: 0; }
p { margin: 0 0 1em; max-width: 68ch; }
.hint, .per { color: var(--muted); }
.hint { font-size: .92rem; }
.per { font-size: .88em; }
.bad-text { color: var(--bad); }

/* Cabecera */
.top { border-bottom: 1px solid var(--line); background: #000; position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-stretch: 125%; font-weight: 800; font-size: 1.05rem; }
.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a, .acct a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover, .acct a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current='page'] { color: var(--text); background: var(--surface); }
.acct { display: flex; align-items: center; gap: 4px; }
.acct form { margin: 0; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; padding: 8px 12px; cursor: pointer; border-radius: 8px; }
button.link:hover { color: var(--text); background: var(--surface); }

/* Botones */
.btn {
  display: inline-block; background: var(--text); color: #000; font: inherit; font-weight: 700; font-stretch: 110%;
  padding: 12px 22px; border-radius: 8px; text-decoration: none; border: 1px solid var(--text); cursor: pointer; line-height: 1.2;
}
.btn:hover { background: #fff; color: #000; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); color: var(--text); border-color: var(--muted); }
.btn.danger { background: transparent; color: var(--bad); border-color: #5a2630; }
.btn.danger:hover { background: #2a1015; color: var(--bad); }
.btn.small { padding: 8px 14px; font-size: .92rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
button.copy {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
button.copy:hover { border-color: var(--muted); }

/* Portada */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; padding-block: 72px 56px; }
.lead { font-size: 1.15rem; color: #c3cee2; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* Rack: tres unidades de servidor */
.rack { display: grid; gap: 10px; padding: 14px; background: linear-gradient(#0b0f17, #05070b); border: 1px solid var(--line); border-radius: 14px; }
.unit {
  position: relative; display: grid; grid-template-columns: 22px 1fr auto; grid-template-areas: 'led name price' 'led sub price';
  column-gap: 14px; align-items: center; padding: 18px 20px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 8px;
}
.unit:hover { background: var(--surface-2); }
.unit.samp { --c: var(--samp); }
.unit.mta { --c: var(--mta); }
.unit.bot { --c: var(--bot); }
.led { grid-area: led; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2.4s ease-in-out infinite; }
.unit:nth-child(2) .led { animation-delay: .8s; }
.unit:nth-child(3) .led { animation-delay: 1.6s; }
.unit-name { grid-area: name; font-stretch: 125%; font-weight: 800; font-size: 1.2rem; }
.unit-sub { grid-area: sub; color: var(--muted); font-size: .92rem; }
.unit-price { grid-area: price; font-stretch: 110%; font-weight: 700; }
@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 2px var(--ok); } }

/* Tablas de planes */
.products { padding-block: 40px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.products.samp { --c: var(--samp); }
.products.mta { --c: var(--mta); }
.products.bot { --c: var(--bot); }
.section-head { border-left: 6px solid var(--c); padding-left: 16px; margin-bottom: 20px; }
.section-head h2 { margin-bottom: .2em; }
.section-head p { margin: 0; color: var(--muted); }
table.plans { width: 100%; border-collapse: collapse; }
table.plans th, table.plans td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.plans thead th { color: var(--muted); font-weight: 500; font-size: .9rem; }
table.plans tbody th { font-weight: 700; font-stretch: 110%; }
table.plans tr.pop { background: var(--surface); }
table.plans .act { text-align: right; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; font-stretch: 100%; padding: 2px 8px; border-radius: 99px; background: var(--c, var(--line)); color: #000; margin-left: 6px; }
.products.mta .tag, .products.bot .tag { color: #fff; }
table.compact td, table.compact th { padding-block: 10px; }

.how { padding-block: 48px 72px; border-top: 1px solid var(--line); }

/* Pasos reales */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 1.4em; display: grid; gap: 12px; max-width: 68ch; }
ol.steps li { counter-increment: s; position: relative; padding-left: 44px; }
ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: .9rem;
}

/* Flujo de contratación */
.flow { padding-block: 48px 72px; }
.flow.wide-flow { max-width: 1100px; }
.crumb { margin-bottom: 8px; font-size: .92rem; }
ul.choice { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; max-width: 760px; }
a.choose {
  display: grid; gap: 4px; padding: 16px 18px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--c, var(--line)); border-radius: 8px;
}
a.choose:hover { background: var(--surface-2); }
a.choose strong { font-stretch: 112%; font-weight: 700; }
a.choose span { color: var(--muted); font-size: .94rem; }
a.choose.samp { --c: var(--samp); }
a.choose.mta { --c: var(--mta); }
a.choose.bot { --c: var(--bot); }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0 8px; max-width: 760px; }
.months { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
select, input[type='text'] {
  font: inherit; color: var(--text); background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.total { font-size: 1.3rem; margin: 0; }
.total strong { font-stretch: 120%; }

.pay { padding-top: 32px; max-width: 760px; }
ul.methods { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
a.method {
  display: grid; grid-template-columns: 34px 1fr; grid-template-areas: 'i n' 'i s'; column-gap: 12px; align-items: center;
  padding: 14px 16px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
a.method:hover { border-color: var(--muted); }
a.method.on { border-color: var(--text); background: var(--surface-2); }
.m-icon { grid-area: i; font-size: 1.6rem; line-height: 1; }
.m-name { grid-area: n; font-weight: 700; font-stretch: 110%; }
.m-sub { grid-area: s; color: var(--muted); font-size: .88rem; }
.pay-detail { margin-top: 28px; padding: 24px; border: 1px solid var(--text); border-radius: 12px; background: var(--surface); scroll-margin-top: 80px; }
.pay-detail h3:first-child { margin-top: 0; }
.amount { font-size: 1.15rem; }
.approx { color: var(--muted); font-size: .9em; }
dl.fields { margin: 0 0 1.2em; display: grid; gap: 8px; }
.field { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; padding: 10px 14px; background: #000; border: 1px solid var(--line); border-radius: 8px; }
.field dt { color: var(--muted); font-size: .92rem; }
.field dd { margin: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.val { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 1.02rem; word-break: break-all; }
.summary-box { margin: 20px 0; background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.summary-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .95rem; color: #c3cee2; user-select: all; }
.callout { border-left: 6px solid var(--ok); background: #08140d; padding: 16px 18px; border-radius: 0 8px 8px 0; }
.callout p { margin-bottom: 12px; }

/* Cuenta */
ul.services { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.service { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--line)); border-radius: 10px; padding: 20px 22px; }
.service.samp { --c: var(--samp); }
.service.mta { --c: var(--mta); }
.service.bot { --c: var(--bot); }
.svc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.svc-head h2 { font-size: 1.35rem; margin: 0; }
.svc-id { font-size: .8rem; font-weight: 500; color: var(--muted); font-stretch: 100%; margin-left: 8px; }
.status { font-size: .88rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); }
.status.active { color: var(--ok); border-color: #1f5a3a; }
.status.suspended { color: var(--warn); border-color: #5a4310; }
.svc-plan { color: #c3cee2; margin: 8px 0 14px; }
dl.svc-facts { display: grid; gap: 8px; margin: 0 0 16px; }
.svc-facts div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.svc-facts dt { color: var(--muted); font-size: .92rem; }
.svc-facts dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.svc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.svc-actions form { margin: 0; }
.led-s { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.led-s.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.led-s.off { background: var(--bad); }
.led-s.wait { background: var(--warn); }
meter { width: 220px; height: 12px; }
meter.wide { width: 100%; max-width: 560px; height: 16px; }
.flash { padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); margin: 16px 0; max-width: 760px; }
.flash.ok { border-color: #1f5a3a; background: #08140d; }
.flash.bad { border-color: #5a2630; background: #1a090d; color: #ffc4cb; }
.empty { margin-top: 24px; padding: 28px; border: 1px dashed var(--line); border-radius: 10px; }

/* Admin */
.subnav { display: flex; gap: 6px; margin: 4px 0 24px; }
.subnav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); border: 1px solid transparent; }
.subnav a[aria-current='page'] { color: var(--text); border-color: var(--line); background: var(--surface); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 4px; color: var(--muted); }
.stat-n { font-stretch: 125%; font-weight: 800; font-size: 2rem; color: var(--text); line-height: 1; }
ul.usage, ul.mon { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.usage li, ul.mon li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px 6px 2px 0; flex-wrap: wrap; }
.check { font-size: .85rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.admin-act { text-align: left !important; }

.notice-page { padding-block: 96px; }
.foot { border-top: 1px solid var(--line); margin-top: 24px; color: var(--muted); font-size: .92rem; }
.foot-in { padding-block: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }

/* Tablas → filas apiladas en pantallas pequeñas */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 40px; }
  table.plans thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.plans, table.plans tbody, table.plans tr, table.plans th, table.plans td { display: block; }
  table.plans tr { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  table.plans th, table.plans td { border: 0; padding: 4px 8px; }
  table.plans td[data-label] { display: flex; justify-content: space-between; gap: 16px; }
  table.plans td[data-label]::before { content: attr(data-label); color: var(--muted); }
  table.plans .act { text-align: left; padding-top: 10px; }
  .field { grid-template-columns: 1fr; gap: 4px; }
  .svc-facts div { grid-template-columns: 1fr; gap: 2px; }
  .acct { width: 100%; }
}
@media (max-width: 520px) {
  .unit { grid-template-columns: 22px 1fr; grid-template-areas: 'led name' 'led sub' 'led price'; }
  meter { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .led { animation: none; } }

.acct a.btn { color: #000; padding: 8px 14px; }
.acct a.btn:hover { background: #fff; color: #000; }
@media (max-width: 700px) {
  .top { position: static; }
  .top-in { gap: 8px 12px; }
  .acct { order: 2; margin-left: auto; width: auto; }
  .nav { order: 3; flex-basis: 100%; gap: 2px; }
  .nav a { padding: 6px 10px; }
}

/* Confirmar pago */
.confirm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 40px; align-items: start; }
.panel-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 6px; }
.panel-form h2 { margin-bottom: .1em; }
.panel-form label { margin-top: 10px; font-size: .92rem; color: var(--muted); }
.panel-form input, .panel-form select { width: 100%; }
input[type='email'], input[type='password'] { font: inherit; color: var(--text); background: #000; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.panel-form .btn { margin-top: 16px; justify-self: start; }
.panel-form .hint { margin: 0; }

.panel-form.reset { max-width: 420px; margin-top: 40px; }

/* Detalle del servicio */
.detail { border-left: 0; }
.detail h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.detail section { margin-top: 36px; }
.detail .svc-actions { margin-top: 8px; }
.live { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--line)); border-radius: var(--radius); padding: 22px; }
.detail.samp .live { --c: var(--samp); }
.detail.mta .live { --c: var(--mta); }
.detail.bot .live { --c: var(--bot); }
.live h2 { font-size: 1.3rem; }
.live-top { display: flex; gap: 8px 24px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.live-top p { margin: 0; }
.live-state { display: inline-flex; gap: 10px; align-items: center; font-size: 1.2rem; }
dl.meters { display: grid; gap: 12px; margin: 0 0 8px; }
.meters > div { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; }
.meters dt { color: var(--muted); font-size: .92rem; }
.meters dd { margin: 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 520px) { .meters > div { grid-template-columns: 1fr; gap: 4px; } }
