@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-violet:   #4F2BFF;
  --clr-magenta:  #C023E8;
  --clr-orange:   #FF6B00;
  --clr-red:      #FF1A1A;
  --clr-cyan:     #00D4FF;
  --clr-white:    #FFFFFF;
  --clr-muted:    rgba(255,255,255,0.55);
  --clr-panel:    rgba(10, 14, 40, 0.82);
  --clr-border:   rgba(255, 107, 0, 0.28);

  --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(255, 107, 0, 0.12) 0%,
      transparent 70%),
    radial-gradient(ellipse 40% 30% at 35% 50%,
      rgba(79, 43, 255, 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 + metamask ────────────────────── */
.side-logo {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fade-in 0.8s cubic-bezier(0.22,1,0.36,1) both;
}

.side-logo img.logo-img {
  width: min(260px, 38vw);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(79, 43, 255, 0.50))
          drop-shadow(0 0 14px rgba(255, 107, 0, 0.28));
}

/* Bloque de descarga MetaMask */
.metamask-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.metamask-block p {
  font-size: 0.78rem;
  color: var(--clr-muted);
  text-align: center;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.btn-metamask {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  background: linear-gradient(110deg, #E8821A 0%, #F6851B 100%);
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-white);
  box-shadow: 0 0 18px rgba(246,133,27,0.40), 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}

.btn-metamask:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(246,133,27,0.60), 0 6px 20px rgba(0,0,0,0.45);
}

.btn-metamask img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ─── Separador vertical ────────────────────────────────────── */
.divider-v {
  flex: 0 0 1px;
  align-self: stretch;
  background: linear-gradient(180deg,
    transparent,
    rgba(255,107,0,0.5) 20%,
    rgba(0,212,255,0.4) 50%,
    rgba(79,43,255,0.5) 80%,
    transparent);
  min-height: 380px;
  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(255, 107, 0, 0.14),
    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: 28px;
  background: linear-gradient(110deg, var(--clr-orange), var(--clr-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Campo de entrada ──────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}

.field-group input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,107,0,0.30);
  border-radius: 6px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--clr-white);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field-group input::placeholder {
  color: var(--clr-muted);
  font-size: 0.85rem;
}

.field-group input:focus {
  border-color: var(--clr-orange);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.14);
}

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

.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 naranja-rojo */
.btn-wallet {
  background: linear-gradient(110deg, var(--clr-orange) 0%, var(--clr-red) 100%);
  color: var(--clr-white);
  box-shadow: 0 0 18px rgba(255,107,0,0.40), 0 4px 14px rgba(255,26,26,0.28);
}
.btn-wallet:hover {
  box-shadow: 0 0 28px rgba(255,107,0,0.60), 0 6px 20px rgba(255,26,26,0.42);
}

/* ─── Separador social ──────────────────────────────────────── */
.social-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 14px;
}
.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;
  font-size: 1rem;
  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; }

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

/* ─── 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); }
}

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

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .page-wrap {
    flex-direction: column;
    gap: 24px;
    padding: 32px 16px 40px;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 40px;
  }
  .divider-v { display: none; }
  .side-logo img.logo-img { width: min(200px, 70vw); }
  .auth-panel { padding: 28px 20px 26px; max-width: 100%; width: 100%; }
  .btn-metamask { font-size: 0.82rem; padding: 10px 16px; }
}

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

/* ════════════════════════════════════════════════════════════════
   SELECTOR DE IDIOMA FLOTANTE (Google Translate)
   Orden visual: sobre contenido, header y drawers (≤ 400),
   debajo de toasts (9999) y modales (10000).
════════════════════════════════════════════════════════════════ */

/* — Ocultar barra, tooltips y resaltado nativos de Google — */
.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;
}

/* — Contenedor flotante — */
.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, -apple-system, 'Segoe UI', Roboto, sans-serif;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* — Botón "Idioma" — */
.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: #FFFFFF;
  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 #FFFFFF;
  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;
}

/* — Panel de idiomas — */
.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: #FFFFFF;
  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: #FFFFFF;
}
.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: #FFFFFF;
  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; }

/* — Ocultar mientras el menú lateral móvil está abierto — */
body:has(.drawer-overlay.open) .dr-lang {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* — Tablet — */
@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; }
}

/* — Móvil (Android / iPhone) — */
@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; }
}

/* — Pantallas muy pequeñas / horizontal baja — */
@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; }
}
