/* OPTIMIZED BUILD */
/* ═══════════════════════════════════════════════════════
   HELIX RECOM — main.css
   Estética: Cyber-dark / Neon Forge / Glow Tech
   Fuentes: Syne (display) + Space Mono (code) + Geist (body)
═══════════════════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  /* Colores HELIX brand */
  --color-primary: #FF6600;
  --color-primary-light: #FF8A3D;
  --color-primary-dark: #CC5200;
  --color-accent: #00D8FF;
  --color-accent-dim: rgba(0, 216, 255, 0.15);

  /* Backgrounds */
  --color-bg: #080C10;
  --color-bg-mid: #0D1219;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-glass: rgba(10, 16, 24, 0.72);
  --color-glass-border: rgba(255, 255, 255, 0.08);

  /* Texto */
  --color-text: #F0F4F8;
  --color-text-secondary: #8898AA;
  --color-text-muted: #4A5568;

  /* Border */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-active: rgba(255, 102, 0, 0.5);

  /* System */
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* Rareza medallas */
  
  
  
  

  /* Tipografía */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --font-body: 'Geist', system-ui, -apple-system, sans-serif;

  /* Text sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --max-width: 1200px;
  --nav-h: 60px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ── CANVAS BG ── */
#helix-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(135deg, #155A8A -33%, #000000 50%, #FF6600 166%);
}

/* ── UTILITIES ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-4); }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.04em;
  border: none; border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.2s ease;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 0 32px rgba(255, 102, 0, 0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-secondary:hover { background: var(--color-accent-dim); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }
.btn-full { width: 100%; }
.btn[disabled], .btn.loading { opacity: 0.55; pointer-events: none; }

/* ── TOAST ── */
.toast-container {
  position: fixed; top: var(--space-6); right: var(--space-6);
  z-index: 9000; display: flex; flex-direction: column; gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500; font-family: var(--font-body);
  color: white; box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  pointer-events: auto; animation: toastIn 0.3s ease forwards;
  max-width: 340px; backdrop-filter: blur(12px);
}
.toast.success { background: rgba(16, 185, 129, 0.9); border: 1px solid var(--color-success); }
.toast.error   { background: rgba(239, 68, 68, 0.9); border: 1px solid var(--color-error); }
.toast.warning { background: rgba(245, 158, 11, 0.9); border: 1px solid var(--color-warning); color: #000; }
.toast.info    { background: rgba(59, 130, 246, 0.9); border: 1px solid var(--color-info); }
.toast.hiding  { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, rgba(255,255,255,0.06) 50%, var(--color-surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════════════════════════════════════════════════
   AUTH SCREEN
═══════════════════════════════════════════════════════ */
main#auth-screen {
  position: relative; z-index: 10; pointer-events: auto;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-8);
}

/* LOGO */
.auth-logo { text-align: center; }
.logo-placeholder { display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--space-3); }
.logo-wordmark {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
  /* Espacio para imagen de logo si el cliente la provee */
}
.logo-helix {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FF6600, #FF8A3D, #FFB366);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255, 102, 0, 0.4));
}
.logo-recom {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--color-accent);
  text-transform: uppercase;
  margin-top: -4px;
}
.logo-sm .logo-helix { font-size: 1.4rem; }
.logo-sm .logo-recom { font-size: 0.55rem; letter-spacing: 0.25em; }

.auth-tagline {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
  letter-spacing: 0.02em;
}

/* AUTH CARD */
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* CAMPO NOMBRE — oculto por defecto, aparece con animación si es cuenta nueva */

}

/* HINT cuenta nueva */

/* SOCIAL BUTTONS */
.social-auth { display: flex; flex-direction: column; gap: var(--space-2); }

/* Fila de 2 botones sociales lado a lado */

.btn-social {
  display: flex; align-items: center; justify-content: flex-start; gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text); font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; font-family: var(--font-body);
  white-space: nowrap;
}
.btn-social:hover { background: var(--color-surface-hover); border-color: rgba(255,255,255,0.16); transform: translateY(-1px); }

/* Colores de acento en hover por provider */
.btn-google:hover  { border-color: rgba(66,133,244,0.4); }

/* DIVIDER */
.auth-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--color-text-muted); font-size: var(--text-xs);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

/* FORM */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); }
.form-input {
  width: 100%; padding: var(--space-3) var(--space-4);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text); font-family: var(--font-body); font-size: var(--text-sm);
  transition: all 0.2s ease;
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(255,102,0,0.15); }

.btn-forgot {
  background: none; border: none; color: var(--color-text-muted); font-size: var(--text-xs);
  cursor: pointer; text-align: center; transition: color 0.2s;
  font-family: var(--font-body); padding: 0;
}
.btn-forgot:hover { color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════ */
#dashboard { position: relative; z-index: 10; pointer-events: auto; min-height: 100vh; }
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  background: rgba(8, 12, 16, 0.8);
  border-bottom: 1px solid var(--color-glass-border);
  backdrop-filter: blur(20px);
}
.nav-logo { display: flex; align-items: center; }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.nav-btn {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full); color: var(--color-text);
  cursor: pointer; transition: all 0.2s ease; font-family: var(--font-body); font-size: var(--text-sm);
}
.nav-btn:hover { background: var(--color-surface-hover); border-color: rgba(255,255,255,0.15); }
.nav-btn-icon { padding: var(--space-2); border-radius: var(--radius-full); }
.nav-avatar { font-size: 1.1rem; }
.nav-username { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD BODY
═══════════════════════════════════════════════════════ */
.dashboard-body {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: var(--space-16);
}

/* ── RECOM CENTER ── */
.recom-center {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: var(--space-8) var(--space-4);
  gap: var(--space-8);
}

.recom-orb-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

/* Pulse rings */
.recom-pulse-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 102, 0, 0.3);
  pointer-events: none;
}
.r1 { width: 200px; height: 200px; animation: pulseRing 2.4s ease-out infinite; }
.r2 { width: 260px; height: 260px; animation: pulseRing 2.4s ease-out 0.6s infinite; }
.r3 { width: 320px; height: 320px; animation: pulseRing 2.4s ease-out 1.2s infinite; }
@keyframes pulseRing {
  0%   { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* BOTÓN RECOM */
.btn-recom {
  position: relative; z-index: 1;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6600 0%, #CC4400 60%, #1A0A00 100%);
  border: 2px solid rgba(255, 140, 0, 0.6);
  color: white; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: all 0.3s ease;
  box-shadow:
    0 0 40px rgba(255, 102, 0, 0.4),
    0 0 80px rgba(255, 102, 0, 0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-recom:hover {
  transform: scale(1.07);
  box-shadow:
    0 0 60px rgba(255, 102, 0, 0.65),
    0 0 120px rgba(255, 102, 0, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-recom:active { transform: scale(0.98); }
.btn-recom-label {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}
.btn-recom-sub {
  font-family: var(--font-body);
  font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════
   TARJETA VIP — Ratio tarjeta de crédito ISO 7810
═══════════════════════════════════════════════════════ */

.recom-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: var(--space-8) var(--space-4);
  gap: var(--space-8);
}

.recom-orb-wrap.hide {
  opacity: 0; transform: scale(0.85);
  pointer-events: none; transition: all 0.4s ease;
}

/* Wrapper: SIN background, SIN borde, SIN padding */
.code-reveal {
  width: min(90vw, 480px);
  aspect-ratio: 1.586 / 1;
  position: relative;
  animation: fadeSlideUp 0.5s ease;
}
@media (min-width: 600px) { .code-reveal { width: min(85vw, 520px); } }
@media (min-width: 768px) { .code-reveal { width: min(80vw, 580px); } }

/* El card3d gira — el borde va acá con box-shadow */
.code-reveal .card3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
  border-radius: 18px;
  /* box-shadow GIRA con la tarjeta — cicla naranja/azul */
  animation: borderColorCycle 4s ease infinite;
}
@keyframes borderColorCycle {
  0%,100% {
    box-shadow: 0 0 0 2px #FF6600,
                0 0 24px rgba(255,102,0,0.4),
                0 24px 60px rgba(0,0,0,0.85);
  }
  50% {
    box-shadow: 0 0 0 2px #1E84C6,
                0 0 24px rgba(30,132,198,0.4),
                0 24px 60px rgba(0,0,0,0.85);
  }
}
.code-reveal .card3d.flipped { transform: rotateY(180deg); }

/* Cara base */
.card3d-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* FRENTE */
.card3d-front {
  background: #07090e;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.card3d-shine {
  position: absolute; inset: 0; pointer-events: none; border-radius: 16px;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(255,102,0,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 50%, rgba(30,132,198,0.1) 0%, transparent 55%);
  animation: shineBreath 5s ease-in-out infinite alternate;
}
@keyframes shineBreath { from { opacity:.5; } to { opacity:1; } }

.card3d-left {
  flex: 0 0 42%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 14px 16px 22px;
  border-right: 1px solid rgba(255,255,255,0.05);
  position: relative;
}
.card3d-left::after {
  content: ''; position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px; border-radius: 2px;
  background: linear-gradient(to bottom, #FF6600, #1E84C6);
}

.card3d-logo { display: flex; align-items: baseline; gap: 5px; }
.card3d-logo-helix {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem); font-weight: 800;
  background: linear-gradient(135deg, #FF6600, #1E84C6, #FF6600, #1E84C6);
  background-size: 300% 300%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}
.card3d-logo-recom {
  font-family: var(--font-mono);
  font-size: clamp(0.38rem, 0.8vw, 0.46rem); font-weight: 700;
  letter-spacing: 0.2em; color: var(--color-accent);
}
.card3d-chip {
  display: inline-block; padding: 3px 9px;
  background: linear-gradient(135deg, #FF6600, #1E84C6, #FF6600, #1E84C6);
  background-size: 300% 300%;
  border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 0.48rem; font-weight: 700;
  letter-spacing: 0.12em; color: #fff; width: fit-content;
  animation: gradientShift 4s ease infinite;
}
.card3d-email {
  font-size: clamp(0.48rem, 1.1vw, 0.6rem);
  color: var(--color-text-muted); margin: 0; word-break: break-all; line-height: 1.3;
}

.card3d-right {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 18px 20px 16px 18px; gap: 8px;
}
.card3d-label {
  font-size: 0.52rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--color-text-muted); margin: 0;
}
.card3d-code {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2.8vw, 1.25rem); font-weight: 700;
  letter-spacing: 0.08em; color: var(--color-accent);
  text-shadow: 0 0 16px rgba(0,216,255,0.4); margin: 0;
}
.card3d-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: rgba(255,102,0,0.1); border: 1px solid rgba(255,102,0,0.3);
  border-radius: var(--radius-full); color: var(--color-primary);
  font-size: 0.6rem; font-weight: 700; font-family: var(--font-display);
  letter-spacing: 0.05em; cursor: pointer; transition: all 0.2s ease; width: fit-content;
}
.card3d-copy-btn:hover { background: rgba(255,102,0,0.22); transform: translateY(-1px); }
.card3d-hint { font-size: 0.48rem; color: rgba(255,255,255,0.15); margin: 0; letter-spacing: 0.06em; }

/* DORSO — mismo fondo negro, transform invertido */
.card3d-back {
  background: #050810;
  transform: rotateY(180deg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 22px 26px;
}
.card3d-shine-back {
  position: absolute; inset: 0; pointer-events: none; border-radius: 16px;
  background:
    radial-gradient(ellipse at 85% 30%, rgba(30,132,198,0.13) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 70%, rgba(255,102,0,0.08) 0%, transparent 50%);
}
.card3d-back-content {
  display: flex; flex-direction: column; gap: 10px; flex: 1; justify-content: center;
}
.card3d-back-title {
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.8vw, 0.9rem); font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text); margin: 0;
}
.card3d-back-desc {
  font-size: clamp(0.6rem, 1.4vw, 0.75rem);
  color: var(--color-text-secondary); line-height: 1.6; margin: 0;
}
.card3d-back-desc strong { color: #FF6600; }
.card3d-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #FF6600, #1E84C6, #FF6600, #1E84C6);
  background-size: 300% 300%;
  border-radius: var(--radius-full);
  color: white; font-size: 0.65rem; font-weight: 700;
  font-family: var(--font-display); letter-spacing: 0.04em;
  text-decoration: none; transition: filter 0.2s, transform 0.2s; width: fit-content;
  animation: gradientShift 4s ease infinite;
}
.card3d-back-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.card3d-hint-back { font-size: 0.48rem; color: rgba(255,255,255,0.15); margin-top: 10px; letter-spacing: 0.06em; }

/* ── RESPONSIVE MOBILE FIRST ── */

/* Base: 320px — el más pequeño */
@media (max-width: 374px) {
  .code-reveal { width: 96vw; }
  .card3d-left { padding: 12px 10px 12px 14px; }
  .card3d-right { padding: 12px 14px 12px 12px; gap: 6px; }
  .card3d-back  { padding: 14px 16px; }
  .nav { padding: 0 var(--space-3); }
  .nav-username { max-width: 80px; font-size: 0.75rem; }
}

/* Mobile estándar: 375–479px */
@media (max-width: 479px) {
  .code-reveal { width: 94vw; }
  .recom-center { padding: var(--space-4) var(--space-3); }
  .card3d-left { padding: 14px 12px 14px 18px; }
  .card3d-right { padding: 14px 16px 14px 14px; gap: 7px; }
  .card3d-back  { padding: 16px 20px; }
  /* Código más compacto en pantalla chica */
  .card3d-code { letter-spacing: 0.05em; }
}

/* Mobile grande / tablet pequeña: 480–767px — ya cubierto con min-width 600 arriba */

/* Ocultar username en mobile para no saturar navbar */
@media (max-width: 600px) {
  .nav-username { display: none; }
  .nav { padding: 0 var(--space-4); }
}