@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Montserrat:wght@300;700&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:      #08080F;
  --clr-purple:  #6A1AFF;
  --clr-magenta: #C023E8;
  --clr-gold:    #FFC738;
  --clr-green:   #00C853;
  --clr-red:     #FF4444;
  --clr-white:   #FFFFFF;
  --clr-muted:   rgba(255,255,255,0.55);
  --clr-panel:   rgba(10,14,40,0.82);
  --clr-border:  rgba(192,35,232,0.30);
  --font-display:'Rajdhani', sans-serif;
  --font-body:   'Montserrat', sans-serif;
}

html, body { height:100%; width:100%; overflow-x:hidden; }

body {
  background-color: var(--clr-bg);
  font-family: var(--font-body);
  color: var(--clr-white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Canvas de rayas ───────────────────────────────────────── */
#speed-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ─── Resplandor de fondo ───────────────────────────────────── */
.bg-glow {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse 55% 40% at 50% 50%, rgba(106,26,255,0.16) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 65% 50%, rgba(255,199,56,0.10) 0%, transparent 70%);
}

/* ─── Layout principal ──────────────────────────────────────── */
.page-wrap {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 56px;
  width: 100%; max-width: 960px;
  padding: 24px 20px;
  min-height: 100vh;
}

/* ─── Columna izquierda: logo ───────────────────────────────── */
.side-logo {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 0;
  animation: fade-in 0.8s cubic-bezier(0.22,1,0.36,1) both;
}

.side-logo img {
  width: min(240px, 36vw);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(106,26,255,0.55))
          drop-shadow(0 0 14px rgba(255,199,56,0.28));
}

/* ─── Separador vertical ────────────────────────────────────── */
.divider-v {
  flex: 0 0 1px; align-self: stretch;
  background: linear-gradient(180deg,
    transparent,
    rgba(106,26,255,0.5) 20%,
    rgba(255,199,56,0.5) 50%,
    rgba(192,35,232,0.5) 80%,
    transparent);
  min-height: 340px;
  animation: fade-in 0.8s 0.2s cubic-bezier(0.22,1,0.36,1) both;
}

/* ─── Columna derecha: panel ────────────────────────────────── */
.auth-panel {
  flex: 1 1 auto; max-width: 380px;
  background: var(--clr-panel);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 36px 32px 32px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 40px rgba(106,26,255,0.18), 0 8px 32px rgba(0,0,0,0.55);
  animation: panel-in 0.8s 0.15s cubic-bezier(0.22,1,0.36,1) both;
}

/* ─── Título del panel ──────────────────────────────────────── */
.panel-title {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-align: center; margin-bottom: 4px;
  background: linear-gradient(110deg, var(--clr-gold), #FFE57A);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.x-chip {
  display: inline-block;
  background: var(--clr-gold); color: #000;
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.65em; letter-spacing: 0.1em;
  border-radius: 4px; padding: 1px 7px;
  margin-left: 6px; vertical-align: middle;
  -webkit-text-fill-color: #000;
}

.panel-sub {
  text-align: center; color: var(--clr-muted);
  font-size: 0.82rem; margin-bottom: 24px;
}

/* ─── Dirección de wallet ───────────────────────────────────── */
.field-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--clr-muted);
  text-transform: uppercase; margin-bottom: 6px;
}

.field-addr {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
  word-break: break-all; margin-bottom: 16px;
}

/* ─── Botones ───────────────────────────────────────────────── */
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.btn {
  position: relative;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  text-align: center; padding: 13px 20px;
  border-radius: 6px; border: none;
  cursor: pointer; outline: none; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  width: 100%; display: block;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.18s;
  background: rgba(255,255,255,0.10);
}
.btn:hover::after { opacity: 1; }
.btn:hover        { transform: translateY(-2px); }
.btn:active       { transform: translateY(0); }

/* Conectar Wallet — degradado purple→magenta */
.btn-wallet {
  background: linear-gradient(110deg, var(--clr-purple) 0%, var(--clr-magenta) 100%);
  color: var(--clr-white);
  box-shadow: 0 0 18px rgba(106,26,255,0.40), 0 4px 14px rgba(192,35,232,0.28);
}
.btn-wallet:hover {
  box-shadow: 0 0 28px rgba(106,26,255,0.60), 0 6px 20px rgba(192,35,232,0.42);
}

/* Ir al panel — dorado */
.btn-gold {
  background: linear-gradient(110deg, #E8A800 0%, #FFC738 60%, #FFE566 100%);
  color: #000;
  box-shadow: 0 0 18px rgba(255,199,56,0.40), 0 4px 14px rgba(0,0,0,0.35);
}
.btn-gold:hover {
  box-shadow: 0 0 28px rgba(255,199,56,0.60), 0 6px 20px rgba(0,0,0,0.45);
}

/* Outline (usar otra wallet) */
.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.35); color: var(--clr-white); }

/* Loading state */
.btn.loading .btn-text { opacity: 0; }
.btn.loading .spinner  { display: block; }
.btn-text { display: block; }
.spinner  {
  display: none; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--clr-white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ─── Fila wallet + badge ───────────────────────────────────── */
.wallet-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 16px;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700;
  font-family: var(--font-display); letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.status-badge.registered    { background:rgba(0,200,83,0.15); color:var(--clr-green); border:1px solid rgba(0,200,83,0.35); }
.status-badge.not-registered{ background:rgba(255,68,68,0.12); color:var(--clr-red);   border:1px solid rgba(255,68,68,0.30); }
.status-dot { width:7px; height:7px; border-radius:50%; background:currentColor; }

/* ─── Grid de info (ID, sponsor) ───────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.info-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,199,56,0.15);
  border-radius: 8px; padding: 12px;
}
.info-label {
  font-size: 0.70rem; color: var(--clr-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.info-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; letter-spacing: 0.04em;
}
.info-value.gold { color: var(--clr-gold); }

/* ─── Mensaje de estado ─────────────────────────────────────── */
.status-msg {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 8px 0 14px;
}
.status-msg p {
  margin: 0; font-size: 0.80rem;
  line-height: 1.6; color: rgba(255,255,255,0.75);
}

/* ─── Separador social ──────────────────────────────────────── */
.social-sep {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px; margin-bottom: 12px;
}
.social-sep span {
  font-size: 0.72rem; color: var(--clr-muted);
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.social-sep::before, .social-sep::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.12);
}

/* ─── Redes sociales ────────────────────────────────────────── */
.social-row { display: flex; justify-content: center; gap: 12px; }

.social-btn {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: transform 0.18s, opacity 0.18s;
  border: 1px solid rgba(255,255,255,0.10);
}
.social-btn:hover { transform: translateY(-3px); opacity: 0.85; }
.social-btn svg { width: 18px; height: 18px; fill: var(--clr-white); flex-shrink: 0; }
.s-x         { background: #000000; }
.s-instagram { background: radial-gradient(circle at 30% 110%, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.s-whatsapp  { background: #25D366; }

/* ─── Botón DashRun B ───────────────────────────────────────── */
.dashb-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 12px; color: var(--clr-muted); font-size: 0.75rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.dashb-sep::before, .dashb-sep::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,0.10);
}
.dashb-sep span { white-space: nowrap; }

.btn-dashb {
  display: flex; align-items: center; justify-content: center;
  gap: 9px; width: 100%; padding: 13px 20px;
  background: transparent;
  border: 1.5px solid rgba(139,92,246,0.45);
  border-radius: 10px; color: #c4b5fd;
  font-size: clamp(0.82rem, 2.2vw, 0.90rem);
  font-weight: 600; letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
  box-sizing: border-box;
}
.btn-dashb:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.75);
  color: #ede9fe; transform: translateY(-2px);
}
.btn-dashb:active { transform: translateY(0); }
.dashb-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; opacity: 0.85;
}

/* ─── Link a registro ───────────────────────────────────────── */
.switch-link { text-align: center; margin-top: 18px; font-size: 0.80rem; color: var(--clr-muted); }
.switch-link a { color: var(--clr-gold); text-decoration: none; font-weight: 500; }
.switch-link a:hover { text-decoration: underline; }

/* ─── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(20,20,36,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--clr-white); font-size: 0.82rem;
  padding: 10px 20px; border-radius: 8px;
  backdrop-filter: blur(12px); white-space: nowrap;
  animation: toast-in 0.3s ease both;
}
.toast-success { border-color: rgba(0,200,83,0.4); color: var(--clr-green); }
.toast-error   { border-color: rgba(255,68,68,0.4); color: var(--clr-red); }
@keyframes toast-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

/* ─── Animaciones ───────────────────────────────────────────── */
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes panel-in { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .side-logo, .divider-v, .auth-panel { animation: none; opacity: 1; }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {

  /* En móvil el body (flex) centra el page-wrap.
     Sin min-height: 100vh en page-wrap, el body puede centrarlo
     correctamente — si no, el page-wrap ocupa toda la pantalla
     y el contenido queda pegado arriba. */
  body {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .page-wrap {
    flex-direction: column;
    gap: 24px;
    padding: 32px 16px 40px;
    min-height: 0;          /* cancela el min-height: 100vh global — clave para centrar en móvil */
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .divider-v { display: none; }
  .side-logo img { width: min(180px, 65vw); }
  .auth-panel { padding: 28px 20px 26px; max-width: 100%; width: 100%; }
}

@media (max-width: 360px) {
  .auth-panel { padding: 22px 14px 22px; }
  .panel-title { font-size: 1.35rem; }
}

/* ════════════════════════════════════════════════════════════════
   SELECTOR DE IDIOMA FLOTANTE (Google Translate)
════════════════════════════════════════════════════════════════ */
.goog-te-banner-frame, iframe.goog-te-banner-frame,
.goog-te-balloon-frame, .goog-te-spinner-pos,
.goog-tooltip, .goog-tooltip:hover, #goog-gt-tt,
#google_translate_element, body > .skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO, .VIpgJd-yAWNEb-L7lbkb {
  display: none !important; visibility: hidden !important;
}
body { top: 0 !important; }
.goog-text-highlight, .VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q {
  background: none !important; box-shadow: none !important;
}

.dr-lang {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 9000;
  font-family: 'Montserrat', system-ui, sans-serif;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.dr-lang .dr-lang-btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 56px; margin: 0; padding: 0 28px 0 22px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #5A4FD6 0%, #6A40C9 100%);
  color: #fff; font-family: inherit; font-size: 18px; font-weight: 700;
  line-height: 1; letter-spacing: 0.2px; text-transform: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 10px 26px rgba(90,64,210,0.45), 0 0 36px rgba(106,64,201,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.dr-lang .dr-lang-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 12px 30px rgba(90,64,210,0.55), 0 0 44px rgba(106,64,201,0.45);
}
.dr-lang .dr-lang-btn:active { transform: scale(0.97); }
.dr-lang .dr-lang-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.dr-lang .dr-lang-btn svg { width: 26px; height: 26px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dr-lang .dr-lang-menu {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  width: 270px; max-height: min(440px, 62vh);
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  margin: 0; padding: 6px; list-style: none;
  background: rgba(16,14,30,0.98);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(106,64,201,0.18);
  opacity: 0; visibility: hidden;
  transform: translateY(8px) scale(0.98); transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.dr-lang.open .dr-lang-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dr-lang .dr-lang-menu::-webkit-scrollbar { width: 6px; }
.dr-lang .dr-lang-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 6px; }

.dr-lang .dr-lang-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin: 0; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: #fff; font-family: inherit;
  text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.dr-lang .dr-lang-item:hover, .dr-lang .dr-lang-item:focus-visible { background: rgba(255,255,255,0.06); outline: none; }
.dr-lang .dr-lang-item.active { background: rgba(106,64,201,0.28); }
.dr-lang .dr-lang-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 6px; border-radius: 6px;
  background: rgba(255,255,255,0.08); font-size: 11px; font-weight: 700;
  letter-spacing: 0.4px; color: rgba(255,255,255,0.85); flex-shrink: 0;
}
.dr-lang .dr-lang-item.active .dr-lang-code { background: linear-gradient(135deg, #5A4FD6 0%, #6A40C9 100%); color: #fff; }
.dr-lang .dr-lang-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dr-lang .dr-lang-native { font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-lang .dr-lang-es { font-size: 11px; line-height: 1.2; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-lang .dr-lang-check { width: 16px; height: 16px; flex-shrink: 0; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.dr-lang .dr-lang-item.active .dr-lang-check { opacity: 1; }

@media (max-width: 768px) {
  .dr-lang { right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); }
  .dr-lang .dr-lang-btn { height: 50px; gap: 10px; padding: 0 22px 0 18px; font-size: 16px; }
  .dr-lang .dr-lang-btn svg { width: 23px; height: 23px; }
}
@media (max-width: 480px) {
  .dr-lang { right: max(14px, env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dr-lang .dr-lang-btn { height: 46px; gap: 8px; padding: 0 18px 0 15px; font-size: 15px; }
  .dr-lang .dr-lang-btn svg { width: 21px; height: 21px; }
  .dr-lang .dr-lang-menu { width: min(260px, calc(100vw - 28px)); max-height: 60vh; max-height: 60dvh; }
  .dr-lang .dr-lang-item { padding: 11px 12px; }
}
@media (max-height: 480px) { .dr-lang .dr-lang-menu { max-height: calc(100vh - 100px); } }
@media (prefers-reduced-motion: reduce) {
  .dr-lang, .dr-lang .dr-lang-btn, .dr-lang .dr-lang-menu, .dr-lang .dr-lang-item { transition: none; }
}
@media print { .dr-lang { display: none !important; } }
