/* ============================================================
   SOCIOS ECOM — Invita y gana
   ============================================================ */

.referidos { display: flex; flex-direction: column; gap: 20px; }

.ref-caja, .ref-portada, .ref-cifra {
  border: .8px solid var(--se-linea);
  border-radius: var(--se-r-card);
  background: var(--se-papel);
  animation: ref-entra .6s cubic-bezier(.16, .84, .24, 1) both;
}
[data-tema="oscuro"] .ref-caja,
[data-tema="oscuro"] .ref-cifra {
  border-color: rgba(255, 255, 255, .085);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012)), #0d0e11;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 60px -36px rgba(0, 0, 0, .9);
}
@keyframes ref-entra { from { opacity: 0; transform: translateY(12px); } }

/* ---------- La portada: el premio y el enlace ---------- */

.ref-portada {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: 28px;
  overflow: hidden;
  border-color: rgba(20, 195, 154, .35);
  background: radial-gradient(60% 140% at 0% 50%, rgba(20, 195, 154, .14), transparent 60%), var(--se-papel);
}
[data-tema="oscuro"] .ref-portada {
  border-color: rgba(47, 212, 168, .28);
  background:
    radial-gradient(60% 140% at 0% 50%, rgba(20, 195, 154, .18), transparent 60%),
    radial-gradient(40% 90% at 100% 0%, rgba(230, 179, 74, .08), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)), #0d0e11;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 60px -36px rgba(0, 0, 0, .9);
}
.ref-portada::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(157, 243, 220, .08) 50%, transparent 60%);
  background-size: 250% 100%;
  animation: ref-brillo 6s ease-in-out infinite;
}
@keyframes ref-brillo { 0%, 60% { background-position: 150% 0; } 100% { background-position: -50% 0; } }

.ref-portada__texto { display: flex; align-items: center; gap: 22px; min-width: 0; }
.ref-sello {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: linear-gradient(135deg, #13707f, #14c39a 60%, #9df3dc);
  box-shadow: 0 18px 40px -14px rgba(20, 195, 154, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: ref-late 3.2s ease-in-out infinite;
}
.ref-sello b { position: relative; font: 700 32px/1 var(--se-fuente-mono); letter-spacing: -.04em; color: #fff; text-shadow: 0 2px 6px rgba(3, 40, 32, .45); }
.ref-sello small { position: relative; margin-top: 2px; font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.ref-sello i { position: absolute; inset: 0; border-radius: inherit; animation: ref-onda 3.2s ease-out infinite; }
@keyframes ref-late { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
@keyframes ref-onda { 0%, 30% { box-shadow: 0 0 0 0 rgba(20, 195, 154, .55); } 90%, 100% { box-shadow: 0 0 0 18px rgba(20, 195, 154, 0); } }
.ref-portada__titulo { margin: 0; font-family: var(--se-fuente-display); font-size: 26px; font-weight: 500; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
.ref-portada__bajada { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--se-tinta-2); }

.ref-enlace { position: relative; z-index: 1; display: grid; gap: 10px; }
.ref-enlace__etiqueta { font: 600 10.5px/1 var(--se-fuente-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--se-verde-tinta); }
.ref-enlace__fila { display: flex; gap: 8px; }
.ref-enlace__campo {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: .8px solid var(--se-linea-fuerte);
  border-radius: 100px;
  font: 500 12.5px/1 var(--se-fuente-mono);
  color: var(--se-tinta);
  background: var(--se-papel-hundido);
}
[data-tema="oscuro"] .ref-enlace__campo { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); }
.ref-enlace__fila .btn { flex: none; min-height: 48px; padding: 0 22px; }
.ref-enlace__fila .btn svg { width: 16px; height: 16px; }
.ref-enlace__fila .btn.es-copiado { filter: saturate(1.3) brightness(1.1); }
.ref-enlace__compartir { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ref-enlace__compartir .btn { min-height: 40px; font-size: 13px; }
.ref-enlace__compartir .btn svg { width: 15px; height: 15px; }
.ref-enlace__codigo { font-size: 12.5px; color: var(--se-tinta-3); }
.ref-enlace__codigo b { font-family: var(--se-fuente-mono); letter-spacing: .06em; color: var(--se-tinta); }

/* ---------- Cifras ---------- */

.ref-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ref-cifra { display: grid; gap: 4px; padding: 18px; animation-delay: .06s; }
.ref-cifra:nth-child(2) { animation-delay: .12s; }
.ref-cifra:nth-child(3) { animation-delay: .18s; }
.ref-cifra__icono { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 10px; color: var(--se-verde-tinta); background: var(--se-verde-tint); }
.ref-cifra__icono svg { width: 18px; height: 18px; }
.ref-cifra b { font: 600 32px/1.05 var(--se-fuente-mono); letter-spacing: -.03em; }
.ref-cifra b i { font-style: normal; font-size: 18px; color: var(--se-tinta-3); }
.ref-cifra small { font-size: 12.5px; color: var(--se-tinta-3); }
.ref-cifra__barra { position: relative; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 6px; background: var(--se-linea); }
.ref-cifra__barra i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #13707f, #14c39a, #9df3dc); }

/* ---------- Columnas ---------- */

.ref-columnas { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ref-columna { display: flex; flex-direction: column; gap: 20px; }
.ref-caja { padding: 22px; }
.ref-caja__cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ref-caja__cabeza small { font-size: 12px; color: var(--se-tinta-3); }
.ref-caja__titulo { margin: 0 0 16px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

.ref-pasos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ref-paso {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--se-papel-calido);
  box-shadow: inset 0 0 0 1px var(--se-linea);
  animation: ref-entra .6s cubic-bezier(.16, .84, .24, 1) both;
  animation-delay: calc(var(--i) * 80ms + 150ms);
}
[data-tema="oscuro"] .ref-paso { background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.ref-paso__num { position: absolute; top: 12px; right: 12px; font: 600 11px/1 var(--se-fuente-mono); color: var(--se-tinta-3); }
.ref-paso__icono { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #13707f, #14c39a 60%, #6ee6c6); }
.ref-paso__icono svg { width: 16px; height: 16px; }
.ref-paso b { font-size: 13.5px; font-weight: 600; }
.ref-paso small { font-size: 12px; line-height: 1.45; color: var(--se-tinta-3); }

.ref-condiciones ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.ref-condiciones li { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; color: var(--se-tinta-2); }
.ref-condiciones svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--se-verde-tinta); }

.ref-lista { display: grid; margin: 0; padding: 0; list-style: none; }
.ref-lista li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--se-linea-suave); }
.ref-lista li:last-child { border-bottom: 0; }
.ref-lista__avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; font-weight: 700; color: #03110c; background: linear-gradient(145deg, #2fd4a8, #0e8f6e); }
.ref-lista__quien { display: grid; flex: 1; gap: 1px; min-width: 0; }
.ref-lista__quien b { overflow: hidden; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ref-lista__quien small { font-size: 11.5px; color: var(--se-tinta-3); }
.ref-lista__premio { padding: 4px 10px; border-radius: 100px; font: 600 13px/1 var(--se-fuente-mono); color: var(--se-verde-tinta); background: var(--se-verde-tint); }
.ref-lista__sin { font-size: 12px; color: var(--se-tinta-3); text-align: right; }

.ref-vacio { display: grid; justify-items: center; gap: 6px; padding: 26px 12px; text-align: center; }
.ref-vacio__icono { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 16px; color: var(--se-verde-tinta); background: var(--se-verde-tint); }
.ref-vacio__icono svg { width: 24px; height: 24px; }
.ref-vacio b { font-size: 14.5px; font-weight: 600; }
.ref-vacio small { max-width: 34ch; font-size: 13px; line-height: 1.5; color: var(--se-tinta-3); }

.ref-cargando { display: grid; gap: 16px; }
.ref-cargando span { height: 160px; border-radius: var(--se-r-card); background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%) var(--se-papel-hundido); background-size: 250% 100%; animation: ref-carga 1.3s linear infinite; }
@keyframes ref-carga { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.ref-error { padding: 14px; border-radius: 12px; color: var(--se-error); background: var(--se-error-tint); }

@media (max-width: 1100px) {
  .ref-portada, .ref-columnas { grid-template-columns: minmax(0, 1fr); }

}
@media (max-width: 620px) {
  .ref-portada { padding: 20px; }
  .ref-portada__texto { flex-direction: column; align-items: flex-start; }
  .ref-enlace__fila { flex-direction: column; }
  .ref-cifras { grid-template-columns: minmax(0, 1fr); }
  .ref-pasos { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ref-caja, .ref-portada, .ref-cifra, .ref-paso, .ref-portada::after, .ref-sello, .ref-sello i { animation: none; }
}
