/* ══════════════════════════════════════════════
   GP Trader — Fila de Apalancamiento
   Premium dark theme · Mobile-first
   ══════════════════════════════════════════════ */

:root {
  --bg: #050806;
  --bg-alt: #070e0a;
  --card-bg: #0a1410;
  --card-border: #1a3229;
  --card-border-soft: #1a3229;
  --green: #39ff88;
  --green-dim: #0c9f58;
  --gold: #ffd166;
  --gold-dim: #b8860b;
  --text: #f3fff7;
  --text-dim: #bccfc5;
  --muted: #7b9586;
  --muted-dim: #4a6356;
  --danger: #ff5d5d;
  --danger-bg: rgba(255, 93, 93, 0.12);
  --success-bg: rgba(57, 255, 136, 0.10);
  --focus-ring: rgba(57, 255, 136, 0.4);

  /* Grid breakpoints */
  --max-w: min(1120px, 94vw);
  --gap: 10px;
}

/* ─── Reset ─── */

/* Browser guard: keep state blocks truly hidden even when CSS resets/proxies interfere. */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top left, #0a2418 0%, #050806 55%), #050806;
  background-attachment: fixed;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ─── Skip link ─── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 100;
  background: var(--green);
  color: #031107;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* ─── Shell ─── */
.shell {
  width: var(--max-w);
  margin: 0 auto;
  padding: 20px 0 60px;
}

/* ─── Card ─── */
.card {
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(12, 24, 18, 0.94), rgba(6, 10, 8, 0.96));
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 18px;
}

/* ─── Hero glow ─── */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(ellipse at 75% 10%, rgba(57, 255, 136, 0.18), transparent 50%);
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.30;
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.orb.one {
  right: 5%;
  top: 5%;
  width: 140px;
  height: 140px;
  background: rgba(57, 255, 136, 0.18);
}
.orb.two {
  left: -5%;
  bottom: 10%;
  width: 100px;
  height: 100px;
  background: rgba(255, 209, 102, 0.14);
  animation-delay: 2.5s;
}
.orb.three {
  right: 30%;
  bottom: -5%;
  width: 80px;
  height: 80px;
  background: rgba(57, 255, 136, 0.10);
  animation-delay: 5s;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-16px) scale(1.06); }
}

/* ─── Brand ─── */
.brand {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), #0c9f58);
  display: grid;
  place-items: center;
  color: #041008;
  font-weight: 1000;
  font-size: 22px;
  box-shadow: 0 0 32px rgba(57, 255, 136, 0.30);
  flex-shrink: 0;
}
.brand strong { display: block; font-size: 18px; }
.brand span { color: var(--muted); font-size: 12px; }

/* ─── Hero content ─── */
.hero-content { position: relative; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(32px, 7vw, 72px);
  line-height: 0.94;
  margin: 0 0 14px;
  letter-spacing: -0.05em;
}
h2 {
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.03em;
}
.lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 0 18px;
}

/* ─── Guarantee banner ─── */
.guarantee-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(57, 255, 136, 0.08), rgba(57, 255, 136, 0.01));
  border: 1px solid rgba(57, 255, 136, 0.20);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}
.guarantee-banner svg { color: var(--green); flex-shrink: 0; margin-top: 1px; }
.guarantee-banner strong { color: var(--text); }

/* ─── Hero stats ─── */
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}
.stat-value#statLiveDot { font-size: 26px; }
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ─── Rules pills ─── */
.rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rules span {
  border: 1px solid rgba(57, 255, 136, 0.20);
  background: rgba(57, 255, 136, 0.06);
  color: #caffdc;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
}

/* ─── Form panel ─── */
.panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 20px;
  margin-top: 24px;
}
.panel h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.form-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
}
label {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 4px;
}
label[for] { cursor: pointer; }
input {
  width: 100%;
  border: 1px solid #1f3a2a;
  background: var(--bg-alt);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

/* ─── Buttons ─── */
button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: opacity 0.15s, transform 0.1s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:active { transform: scale(0.97); }
button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--green), #14b86a);
  color: #031107;
  padding: 13px 20px;
  width: 100%;
  margin-top: 16px;
}
.btn-primary:hover { opacity: 0.90; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--card-border-soft);
  padding: 10px 18px;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.10); }

.btn-icon {
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 10px;
  min-height: 40px;
  border: 1px solid transparent;
}
.btn-icon:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ─── Button loading state ─── */
.btn-loading { display: none; }
.btn-loading svg { animation: spin 0.8s linear infinite; }
button:disabled .btn-text { display: none; }
button:disabled .btn-loading { display: inline-flex; align-items: center; gap: 6px; }
button:disabled { opacity: 0.8; cursor: wait; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Result / alert ─── */
.result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.result.visible { display: block; }
.result-success {
  background: var(--success-bg);
  border: 1px solid rgba(57, 255, 136, 0.20);
  color: #daffed;
}
.result-error {
  background: var(--danger-bg);
  border: 1px solid rgba(255, 93, 93, 0.20);
  color: #ffd5d5;
}
.result-info {
  background: rgba(57, 255, 136, 0.05);
  border: 1px solid rgba(57, 255, 136, 0.12);
  color: var(--text-dim);
}
.result strong { color: var(--text); display: block; margin-bottom: 4px; }
.result .gold-text { color: var(--gold); font-weight: 900; }

/* ─── Lookup section ─── */
.lookup-section { margin-bottom: 18px; }
.lookup-header { margin-bottom: 12px; }
.section-note {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
  line-height: 1.5;
}
.lookup-form { margin-top: 6px; }
.lookup-input-group {
  display: flex;
  gap: 8px;
}
.lookup-input-group input { flex: 1; }
.lookup-input-group button {
  width: auto;
  padding: 13px 22px;
  margin-top: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.lookup-result { margin-top: 12px; }

/* ─── Queue section ─── */
.queue-section { margin-bottom: 18px; }
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Live badge ─── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background 0.3s;
}
.live-online {
  background: rgba(57, 255, 136, 0.10);
  border: 1px solid rgba(57, 255, 136, 0.25);
  color: var(--green);
}
.live-online .live-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(57, 255, 136, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}
.live-polling {
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.20);
  color: var(--gold);
}
.live-polling .live-dot {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.4);
  animation: dotPulse 2.5s ease-in-out infinite;
}
.live-offline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.live-offline .live-dot { background: var(--muted); }

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Queue rows ─── */
.queue {
  display: grid;
  gap: 8px;
}
.row {
  display: grid;
  grid-template-columns: 56px 1fr 120px 110px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 12px 14px;
  transition: border-color 0.2s, background 0.2s;
}
.row[role="listitem"] { position: relative; }

/* ─── Row columns ─── */
.pos {
  font-size: 20px;
  font-weight: 1000;
  color: var(--gold);
  letter-spacing: -0.03em;
  text-align: center;
}
.row-info { min-width: 0; }
.name {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.id {
  color: var(--muted);
  font-size: 12px;
}
.amount {
  color: var(--green);
  font-weight: 900;
  font-size: 14px;
  text-align: right;
}
.row-status {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
}
.status-pending { color: #ffd166; background: rgba(255, 209, 102, 0.08); }
.status-approved { color: var(--green); background: rgba(57, 255, 136, 0.08); }
.status-in_progress { color: #8bd3ff; background: rgba(139, 211, 255, 0.08); }
.status-done { color: #c7f9cc; background: rgba(199, 249, 204, 0.06); }
.status-rejected { color: #ff9a9a; background: rgba(255, 154, 154, 0.06); }

/* ─── Golden rows ─── */
.golden {
  border-color: rgba(255, 209, 102, 0.50) !important;
  background: linear-gradient(115deg, rgba(255, 209, 102, 0.12), rgba(57, 255, 136, 0.03), rgba(255, 255, 255, 0.02)) !important;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.12);
  animation: goldPulse 2.4s ease-in-out infinite;
}
.golden .pos { color: var(--gold); text-shadow: 0 0 10px rgba(255, 209, 102, 0.40); }
.golden .amount { color: var(--gold); }
.gold-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.40);
  color: var(--gold);
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 209, 102, 0.10); }
  50% { box-shadow: 0 0 32px rgba(255, 209, 102, 0.24); }
}

/* ─── Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 10px;
}
.skeleton-pos { width: 40px; height: 24px; margin: auto; }
.skeleton-name { width: 70%; height: 16px; }
.skeleton-amount { width: 80%; height: 16px; justify-self: end; }
.skeleton-status { width: 60%; height: 14px; justify-self: center; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Empty / Error states ─── */
.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.empty-state svg, .error-state svg { opacity: 0.4; margin-bottom: 4px; }
.error-state p { color: var(--danger); }
.error-state .btn-secondary { margin-top: 4px; }

/* ─── Queue footer ─── */
.queue-footer {
  margin-top: 14px;
  text-align: center;
}
.queue-footer .muted { font-size: 12px; }

/* ─── ─── ✦ RESPONSIVE ✦ ─── ─── */

/* Tablet horizontal / desktop */
@media (min-width: 821px) {
  .shell { padding: 34px 0 60px; }
  .card { padding: 28px; margin-bottom: 24px; }

  .hero-content {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 30px;
    align-items: start;
  }
  .panel { margin-top: 0; }

  h1 { font-size: clamp(42px, 5.5vw, 72px); }

  .row {
    grid-template-columns: 60px 1fr 140px 120px;
    padding: 14px 18px;
  }

  .lookup-input-group input { max-width: 420px; }
}

/* Tablet vertical */
@media (min-width: 601px) and (max-width: 820px) {
  .hero-content {
    display: grid;
    grid-template-columns: 1fr;
  }
  .panel { margin-top: 20px; }
}

/* Mobile (default is mobile-first) */
@media (max-width: 600px) {
  .shell { padding: 14px 0 40px; }
  .card { padding: 18px; border-radius: 20px; }

  h1 { font-size: 30px; margin-bottom: 12px; }
  .lead { font-size: 15px; }

  .hero-stats { gap: 16px; }
  .stat-value { font-size: 20px; }

  .row {
    grid-template-columns: 44px 1fr 80px 70px;
    gap: 6px;
    padding: 10px 10px;
    border-radius: 14px;
  }
  .pos { font-size: 16px; }
  .name { font-size: 13px; }
  .amount { font-size: 12px; }
  .row-status { font-size: 10px; padding: 3px 6px; }

  .lookup-input-group {
    flex-direction: column;
    gap: 10px;
  }
  .lookup-input-group button { width: 100%; }

  .queue-header { flex-direction: column; }
  .queue-header-actions { align-self: flex-end; }
  .panel { padding: 16px; }

  .guarantee-banner { font-size: 13px; padding: 12px 14px; }
}

/* ─── Reduced motion ─── */
.app-footer{display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;padding:4px 6px 20px}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
