/* Sitio My Rewards: mismos colores y tipografías de la tienda (base.css y fonts.css son copia de la tienda) */

/* Encabezado */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); box-shadow: 0 1px 0 var(--outline); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 8px 16px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; line-height: 1; min-width: 0; }
.brand .logo { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.brand .wm { display: grid; gap: 1px; font-family: var(--display); text-transform: uppercase; }
.brand .wm b { font-weight: 800; font-size: 26px; line-height: 0.86; white-space: nowrap; }
.lang { display: inline-flex; }
.lang button { position: relative; min-width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; }
.lang button + button::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }

/* Estructura: en teléfono una columna; en tablet/escritorio panel de marca a la izquierda */
.rw-wrap { max-width: 1040px; margin: 0 auto; padding: 16px 16px 40px; min-height: calc(100dvh - 140px); display: grid; gap: 24px; align-items: start; }
.rw-col { width: 100%; max-width: 480px; margin: 0 auto; }
.side { display: none; }
.rw-dash { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; min-height: calc(100dvh - 140px); }
.rw-dash .card + .card { margin-top: 16px; }

.side { position: relative; overflow: hidden; border-radius: 24px; padding: 40px 36px; background: radial-gradient(120% 90% at 0% 0%, #1E3170 0%, var(--surface) 55%, var(--bg) 100%); box-shadow: var(--sh-1); }
.side::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid var(--chip); }
.side img { width: 72px; height: 72px; border-radius: 16px; }
.side-k { margin-top: 28px; font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 0.9; text-transform: uppercase; color: var(--btn); }
.side-t { margin-top: 16px; font-size: 22px; font-weight: 800; line-height: 1.25; color: var(--ink); text-wrap: balance; }
.side-p { margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 34ch; }
.side-f { margin-top: 40px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: var(--btn); }

.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.card { margin-top: 8px; background: var(--surface); border-radius: 20px; padding: 24px 20px; box-shadow: var(--sh-1); }
.card h1 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 9vw, 48px); line-height: 1; text-transform: uppercase; color: var(--ink); }
.card h2 { font-size: 20px; font-weight: 800; line-height: 1.2; margin-top: 8px; }
.card section > h2:first-child { margin-top: 16px; }
.kicker { color: var(--btn); font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.lead, .muted { color: var(--muted); margin-top: 8px; text-wrap: pretty; }
.sm { font-size: 14px; }
.hi { font-size: 18px; font-weight: 700; margin-top: 12px; overflow-wrap: anywhere; }
.panel { margin-top: 20px; padding: 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }

/* Pestañas Entrar / Crear cuenta */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 20px; padding: 4px; background: var(--bg); border-radius: 14px; }
.tabs button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.tabs button[aria-selected="true"] { background: var(--chip); color: var(--ink); }

/* Campos */
.fl { display: block; margin-top: 16px; font-weight: 600; font-size: 15px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="email"], input[type="password"], input[type="text"] { width: 100%; min-height: 48px; margin-top: 6px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-size: 16px; }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
#cCode { letter-spacing: 0.4em; font-size: 22px; font-weight: 700; text-align: center; }
.pw { position: relative; }
.pw input { padding-right: 88px; }
.eye { position: absolute; right: 4px; top: 10px; min-height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--btn); font-weight: 700; font-size: 14px; }
.rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 6px; }
.rules li::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); }
.rules li.on { color: var(--ink); }
.rules li.on::before { border-color: var(--btn); background: var(--btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1330' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat; }
.check { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check.sm { font-size: 14px; color: var(--muted); }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--btn); }
.check a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.captcha:not(:empty) { margin-top: 16px; min-height: 65px; }

/* Avisos */
.note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.note.bad { background: rgba(255, 154, 143, 0.12); color: var(--bad); }
.note.ok { background: rgba(255, 201, 51, 0.12); color: var(--btn); }

/* Botones */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 20px; border: 0; border-radius: 14px; background: var(--btn); color: var(--btn-ink); font-weight: 800; font-size: 17px; text-decoration: none; transition: transform 160ms var(--ease-out), opacity 160ms; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--btn); border: 1.5px solid var(--btn); margin-top: 12px; }
.link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.alt { margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alt-btn { margin-top: 12px; background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; font-size: 16px; }
.alt-btn svg { width: 20px; height: 20px; flex: none; }
.help { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* Panel: tu cuenta */
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--outline); }
.acc-row .link { margin-top: 0; }
.acc-l { color: var(--muted); font-size: 14px; font-weight: 600; }
.acc-v { font-weight: 700; overflow-wrap: anywhere; }
.acc-form { padding: 4px 0 16px; border-bottom: 1px solid var(--outline); }
.acc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acc-btns .btn { margin-top: 16px; }
.danger { color: var(--bad); }
.danger-btn { background: var(--bad); color: #2A0B07; }

.foot { padding: 20px 16px 28px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--outline); }
[hidden] { display: none !important; }

@media (max-width: 339px) { .brand .wm b { font-size: 21px; } .two, .rules { grid-template-columns: 1fr; } }
@media (min-width: 760px) {
  .brand .wm b { font-size: 30px; }
  .rw-wrap { padding-top: 32px; }
  .card { padding: 32px 28px; }
}
@media (min-width: 960px) {
  .rw-wrap { grid-template-columns: minmax(0, 1fr) 460px; gap: 40px; }
  .side { display: block; position: sticky; top: 96px; margin-top: 52px; }
  .rw-col { margin: 0; }
  .rw-col .card > h1, .rw-col .card > .lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* el panel de marca ya los muestra */
  .rw-col .card > .tabs, .rw-col .card section[data-view="auth"] .tabs { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Panel: link de registro, red y afiliados */
.link-box input { font-size: 15px; color: var(--btn); font-weight: 700; }
.levels { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.levels li { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--bg); color: var(--muted); font-size: 15px; }
.levels li b { font-size: 18px; color: var(--muted); }
.levels li.on { color: var(--ink); }
.levels li.on b { color: var(--btn); }
.affs { list-style: none; margin: 12px 0 0; padding: 0; }
.affs li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--outline); }
.affs li span { color: var(--muted); font-size: 14px; }
.affs li.empty { color: var(--muted); border: 0; }
@media (min-width: 760px) { .levels { grid-template-columns: repeat(5, 1fr); } .levels li { flex-direction: column; gap: 4px; } }
.acc-btns:has(> [hidden]) { grid-template-columns: 1fr; }

/* ── Panel con pestañas, planes, pagos, banners, ganancias, administrador y sitios públicos ── */
.dtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 4px 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 10; background: var(--bg); }
.dtabs::-webkit-scrollbar { display: none; }
.dtabs a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 15px; text-decoration: none; }
.dtabs a[aria-current] { background: var(--chip); color: var(--ink); }
@media (hover: hover) { .dtabs a:hover { color: var(--ink); } }
[data-panel] .card:first-child { margin-top: 12px; }
.big { font-size: 28px; font-weight: 800; color: var(--btn); margin-top: 6px; }
.tag { display: inline-flex; align-items: center; width: max-content; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.tag.on { background: rgba(255, 201, 51, 0.14); color: var(--btn); }
.tag.bad { background: rgba(255, 154, 143, 0.14); color: var(--bad); }
.grp { font-size: 16px; font-weight: 800; margin-top: 24px; }
select, textarea, input[type="number"], input[type="search"], input[type="url"] { width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-size: 16px; }
textarea { resize: vertical; min-height: 88px; font: inherit; }
.hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; color: var(--ink); }

/* Inicio: planes con contador */
.sub { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--bg); }
.sub-top { display: flex; align-items: center; gap: 10px; }
.sub-top b { font-size: 18px; }
.sub-days { margin-top: 10px; font-size: 22px; font-weight: 800; color: var(--btn); }
.sub.done .sub-days { color: var(--bad); }
.bar { height: 8px; margin-top: 10px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--btn); }
.sub .btn { margin-top: 14px; }

/* Planes */
.plans { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.plan { position: relative; display: flex; flex-direction: column; padding: 16px; border-radius: 16px; background: var(--bg); border: 1.5px solid transparent; }
.plan.mine { border-color: var(--btn); }
.plan h3 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; margin-top: 4px; }
.plan-what { color: var(--ink); font-weight: 600; margin-top: 6px; }
.plan-price { font-size: 21px; font-weight: 800; color: var(--btn); margin-top: 10px; white-space: nowrap; }
.plan .btn { font-size: 15px; min-height: 46px; padding: 0 8px; }
.plan .btn { margin-top: auto; padding-top: 0; }
.plan .muted { margin-bottom: 14px; }

/* Ventana de pago */
dialog#payDlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); }
dialog#payDlg::backdrop { background: rgba(4, 9, 24, 0.7); }
.dlg-in { padding: 24px 20px; overflow-y: auto; }
.dlg-in h2 { font-size: 22px; font-weight: 800; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: var(--bg); }
.copy-row .link { margin: 0; flex: none; }
.pay-amt { font-size: 22px; color: var(--btn); }
#txid { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

/* Banners y productos */
.items { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bg); }
.item img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; background: var(--chip); }
.item-info { display: grid; gap: 4px; align-content: start; min-width: 0; }
.item-info .price { color: var(--btn); font-weight: 700; }
.item-info .dest { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 18px; }
.item-act .link { margin: 0; }
.item.ask { grid-template-columns: 1fr; }
.item-form { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--bg); }
.item-form h3 { font-size: 18px; font-weight: 800; }
.item-form input, .item-form select { background: var(--surface); }
.img-pick { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.img-pick img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; }
.img-pick .btn { width: auto; margin: 0; padding: 0 18px; cursor: pointer; }

/* Listas (pedidos, retiros, comisiones, usuarios) */
.rows { list-style: none; margin: 12px 0 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--outline); }
.rows li > div { display: grid; gap: 3px; min-width: 0; }
.rows li .r { justify-items: end; text-align: right; align-content: start; }
.rows li.empty { color: var(--muted); border: 0; }
.rows .link { margin: 0; min-height: 32px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stats > div { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: var(--bg); }
.stats span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stats b { font-size: 18px; }
.stats .big { font-size: 22px; margin: 0; }
.row-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.row-form input { min-height: 40px; margin: 0; padding: 6px 10px; font-size: 14px; }
.row-form input[type="number"] { width: 100px; }
.row-form .check { margin: 0; }
.adm-h { font-family: var(--display); font-weight: 800; font-size: 40px; text-transform: uppercase; margin-top: 8px; }
.adm .card { margin-top: 12px; }

/* Sitio público de cada usuario */
.pub { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; min-height: calc(100dvh - 140px); }
.pub h1 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 8vw, 60px); line-height: 1; text-transform: uppercase; margin-top: 6px; }
.pub .dtabs { position: static; margin-top: 16px; }
.pgrid { display: grid; gap: 14px; margin-top: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--sh-1); }
.pshot { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); }
.pshot img { width: 100%; height: 100%; object-fit: cover; }
.pname { font-weight: 700; line-height: 1.3; }
.pcard .price { color: var(--btn); font-weight: 800; }
.pcard .btn { margin-top: auto; min-height: 44px; font-size: 15px; }
@media (min-width: 760px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats { grid-template-columns: repeat(4, 1fr); } .dtabs { margin: 8px 0 0; padding: 4px 0; } }
@media (min-width: 1024px) { .pgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .rw-dash { max-width: 760px; } }
@media (max-width: 759px) { .adm .rows li { flex-direction: column; } .adm .rows li .r { justify-items: start; text-align: left; } .adm .row-form { width: 100%; } .adm .row-form input { flex: 1; } }
