@import url('https://fonts.googleapis.com/css2?family=Michroma&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ════════════════════════════════════════
   BITRUN — conexion.css  v2.9
   ════════════════════════════════════════ */

:root {
  --bg:     #0b0c10;
  --bg2:    #0f1116;
  --bg3:    #13151c;
  --card:   #13151c;
  --card2:  #181a23;
  --border: rgba(255,255,255,0.07);
  --border2:rgba(255,255,255,0.13);
  --accent: #6366f1;
  --accent2:#818cf8;
  --glow:   rgba(99,102,241,0.22);
  --orange: #f97316;
  --orange-glow: rgba(249,115,22,0.30);
  --fg:     #e8eaf0;
  --fg2:    #9ca3af;
  --fg3:    #6b7280;
  --green:  #22c55e;
  --red:    #ef4444;

  --font-title: 'Michroma', 'Inter', sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;
  --font-mono:  'Space Mono', monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── TOPBAR ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, env(safe-area-inset-right,0px)) 0 max(24px, env(safe-area-inset-left,0px));
  height: 58px;
  background: rgba(11,12,16,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none;
}
.logo-img {
  width: 30px; height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--orange-glow));
}
.logo-name {
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--fg);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.logo-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent2);
  background: rgba(99,102,241,0.10);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 4px;
  padding: 2px 6px;
}
@media (max-width: 380px) { .logo-tag { display: none; } }

/* ─── MAIN ─── */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px max(20px, env(safe-area-inset-right,0px));
}

.connect-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}

.connect-logo {
  width: 72px; height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px var(--orange-glow));
}

.connect-title {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--fg);
  line-height: 1.3;
}

.connect-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg2);
  line-height: 1.6;
  max-width: 300px;
}

/* ─── ESTADO DE RED ─── */
.net-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
}
.net-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fg3);
  flex-shrink: 0;
  transition: background 0.3s;
}
.net-dot.ok  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.net-dot.bad { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.net-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg2);
}
.net-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg3);
  margin-left: auto;
}

/* ─── BOTÓN CONECTAR ─── */
.btn-connect {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 0 24px var(--glow);
}
.btn-connect:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.btn-connect:disabled { opacity: 0.40; cursor: not-allowed; }

/* ─── ESTADO ─── */
.status-msg {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg3);
  min-height: 18px;
  transition: color 0.2s;
}
.status-msg.ok   { color: var(--green); }
.status-msg.err  { color: var(--red); }
.status-msg.warn { color: #f59e0b; }

/* ─── VERSION ─── */
.connect-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg3);
  margin-top: 4px;
}

/* ─── SPINNER ─── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOASTS ─── */
.toast-container {
  position: fixed; bottom: 20px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  width: 300px; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 500; color: var(--fg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  animation: toastIn 0.25s ease;
  word-break: break-word;
}
.toast.success { border-color: rgba(34,197,94,0.35); }
.toast.error   { border-color: rgba(239,68,68,0.35); }
.toast.warn    { border-color: rgba(245,158,11,0.35); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ─── PASOS DE REGISTRO ─── */
.reg-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.reg-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  transition: opacity 0.3s;
}

.step-num {
  min-width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.step-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}

.step-desc {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg2);
  line-height: 1.5;
}

.btn-step {
  margin-top: 10px;
  padding: 9px 18px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 0 16px var(--glow);
  align-self: flex-start;
}
.btn-step:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }
.btn-step:disabled { opacity: 0.4; cursor: not-allowed; }

.step-status {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg3);
  min-height: 16px;
  margin-top: 2px;
}

/* ─── ÉXITO DE REGISTRO ─── */
.reg-success {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  width: 100%;
  animation: fadeUp 0.4s ease;
}

.reg-success-icon {
  font-size: 40px;
  line-height: 1;
}

.reg-success-title {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--green);
}

.reg-success-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg2);
}

.reg-success-id {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--glow);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}


/* ════════════════════════════════════════
   BITRUN v3.1 — SELECTOR DE IDIOMA
   ════════════════════════════════════════ */
#google_translate_element, iframe.goog-te-banner-frame,
.goog-te-balloon-frame, .goog-te-spinner-pos, .goog-tooltip,
.goog-tooltip:hover, #goog-gt-tt, body > .skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO, .VIpgJd-yAWNEb-L7lbkb {
  display: none !important; visibility: hidden !important;
}
body, body.translated-ltr, body.translated-rtl { top: 0 !important; margin-top: 0 !important; }
.goog-text-highlight, .VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q {
  background: none !important; box-shadow: none !important;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btr-lang { position: relative; font-family: var(--font-body), system-ui, sans-serif; }
.btr-lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1.5px solid rgba(255,255,255,0.15); border-radius: 999px;
  background: rgba(255,255,255,0.04); color: var(--fg2);
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  cursor: pointer; white-space: nowrap; user-select: none;
  -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.btr-lang-btn:hover { border-color: var(--orange); color: var(--fg); background: rgba(249,115,22,0.06); }
.btr-lang-btn:active { transform: scale(0.97); }
.btr-lang-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.btr-lang-btn svg {
  width: 15px; height: 15px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.btr-lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 250px; max-height: min(370px, 60vh);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  margin: 0; padding: 6px; list-style: none;
  background: rgba(10,10,14,0.98); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.65), 0 0 0 1px rgba(249,115,22,0.10);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(0.98); transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s; z-index: 500;
}
.btr-lang.open .btr-lang-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.btr-lang-menu::-webkit-scrollbar { width: 5px; }
.btr-lang-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 5px; }
.btr-lang-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin: 0; padding: 9px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--fg);
  font-family: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background 0.12s;
}
.btr-lang-item:hover, .btr-lang-item:focus-visible { background: rgba(255,255,255,0.05); outline: none; }
.btr-lang-item.active { background: rgba(249,115,22,0.16); }
.btr-lang-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 31px; height: 21px; padding: 0 5px; border-radius: 5px;
  background: rgba(255,255,255,0.07); font-size: 10px; font-weight: 700;
  letter-spacing: 0.4px; color: rgba(255,255,255,0.72); flex-shrink: 0;
}
.btr-lang-item.active .btr-lang-code { background: var(--orange); color: #fff; }
.btr-lang-names { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.btr-lang-native { font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btr-lang-es { font-size: 10px; line-height: 1.2; color: rgba(255,255,255,0.42); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btr-lang-check {
  width: 14px; height: 14px; flex-shrink: 0;
  stroke: var(--orange); fill: none; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.12s;
}
.btr-lang-item.active .btr-lang-check { opacity: 1; }
@media (max-width: 480px) {
  .btr-lang-btn .btr-lang-label { display: none; }
  .btr-lang-btn { padding: 0 10px; gap: 0; }
  .btr-lang-menu { width: min(240px, calc(100vw - 20px)); max-height: 58vh; }
}
@media (max-height: 480px) { .btr-lang-menu { max-height: calc(100vh - 80px); } }
