/* ── Referidos — estilos inline extraídos de referidos.html ── */
body { background: var(--bg-primary, #f8fafc); margin: 0; font-family: system-ui; }
.app-container { opacity: 0; transition: opacity 0.3s ease; }
.app-container.loaded { opacity: 1; }
#preloader { position: fixed; inset: 0; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.3s; }
#preloader.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 40px; height: 40px; border: 3px solid rgba(6,182,212,0.3); border-top-color: var(--primary,#06b6d4); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.referidos-page { padding: 1.5rem; max-width: 1200px; margin: 0 auto; }
.referidos-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}
.referidos-header h1 {
  font-size: 1.75rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary, #1e293b);
  font-weight: 700;
  flex-shrink: 0;
}
.referidos-header .referidos-tagline {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 1rem;
  flex: 1 1 12rem;
  min-width: 0;
}
.referidos-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.referidos-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 12px; font-size: 0.9rem; font-weight: 600; border: 1px solid; }
.referidos-badge.blue { background: rgba(59,130,246,0.12); color: #2563eb; border-color: rgba(59,130,246,0.3); }
.referidos-badge.green { background: rgba(34,197,94,0.12); color: #16a34a; border-color: rgba(34,197,94,0.3); }
.referidos-badge.emerald { background: rgba(16,185,129,0.12); color: #0d9488; border-color: rgba(16,185,129,0.3); }
.referidos-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 1024px) { .referidos-grid { grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; } }
.referidos-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.referidos-sidebar { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.referidos-card { background: var(--bg-secondary, #fff); border-radius: 14px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border, #e2e8f0); }
.referidos-card h2 { font-size: 1.05rem; margin: 0 0 1rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-weight: 600; }
.referidos-card .field-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.35rem; display: block; font-weight: 500; }
.referidos-code-wrap { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.referidos-code-wrap input { flex: 1; font-size: 1rem; font-family: monospace; padding: 0.6rem 0.75rem; border-radius: 10px; border: 2px solid var(--border); background: var(--bg-primary); color: var(--text-primary); }
.referidos-url-wrap { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.referidos-url-wrap input { flex: 1; font-size: 0.85rem; padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); }
.referidos-share { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.referidos-share button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 10px; font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; transition: opacity 0.2s; }
.referidos-share button:hover { opacity: 0.9; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-facebook { background: #1877F2; color: #fff; }
/* Copiar junto al input: solo icono, sin fondo ni borde */
.referidos-code-wrap .btn-copy,
.referidos-url-wrap .btn-copy {
  background: none;
  border: none;
  box-shadow: none;
  color: #0f172a;
  padding: 0.4rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}
.referidos-code-wrap .btn-copy i,
.referidos-url-wrap .btn-copy i {
  color: #0f172a;
}
.referidos-code-wrap .btn-copy:hover,
.referidos-url-wrap .btn-copy:hover {
  opacity: 1;
  background: none;
  border: none;
  box-shadow: none;
}
.referidos-code-wrap .btn-copy:focus,
.referidos-url-wrap .btn-copy:focus {
  outline: none;
}
.referidos-code-wrap .btn-copy:focus-visible,
.referidos-url-wrap .btn-copy:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.25);
  outline-offset: 2px;
}
.referidos-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.referidos-table th { text-align: left; padding: 0.6rem 0.75rem; background: var(--bg-primary); color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); }
.referidos-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.referidos-table .status { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 600; }
.status-converted { background: rgba(34,197,94,0.15); color: #16a34a; }
.status-active { background: rgba(59,130,246,0.15); color: #2563eb; }
.status-pending { background: rgba(245,158,11,0.15); color: #d97706; }
.referidos-empty { text-align: center; padding: 2rem 1.5rem; color: var(--text-secondary); }
/* Solo el icono grande del estado vacío; no afectar iconos dentro del botón */
.referidos-empty > i:first-of-type {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
  color: var(--primary);
}
.referidos-empty .btn-share-main i {
  font-size: 1rem;
  margin: 0;
  opacity: 1;
  color: #fff;
}
.referidos-empty .referidos-empty-hint {
  font-size: 0.8rem;
  margin: 0.65rem 0 0;
  color: var(--text-secondary, #64748b);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.35;
}
.referidos-empty .btn-share-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.65rem 1.35rem;
  border-radius: 12px;
  background: var(--primary, #06b6d4);
  color: #fff;
  border: 1px solid rgba(8, 100, 120, 0.4);
  box-shadow: 0 2px 0 rgba(8, 100, 120, 0.45), 0 4px 14px rgba(6, 182, 212, 0.35);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.referidos-empty .btn-share-main-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}
.referidos-empty .btn-share-main:hover {
  filter: brightness(1.05);
  box-shadow: 0 3px 0 rgba(8, 100, 120, 0.45), 0 8px 20px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}
.referidos-empty .btn-share-main:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(8, 100, 120, 0.45), 0 2px 8px rgba(6, 182, 212, 0.3);
}
.referidos-empty .btn-share-main:focus {
  outline: none;
}
.referidos-empty .btn-share-main:focus-visible {
  outline: 3px solid rgba(6, 182, 212, 0.55);
  outline-offset: 3px;
}
.referidos-how { padding-left: 0; list-style: none; }
.referidos-how li { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--text-secondary); }
.referidos-how .num { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.referidos-free-month { background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(20,184,166,0.08)); border: 1px solid rgba(16,185,129,0.25); }
.referidos-free-month .apply-btn { display: block; width: 100%; padding: 0.6rem 1rem; border-radius: 10px; background: var(--primary); color: #fff; border: none; font-weight: 600; cursor: pointer; margin-top: 0.5rem; }
.referidos-free-month .apply-btn:hover { opacity: 0.9; }
.referidos-progress { margin-top: 0.5rem; }
.referidos-progress .bar { height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.referidos-progress .fill { height: 100%; background: #10b981; border-radius: 6px; transition: width 0.2s; }
.referidos-stats-card { background: var(--bg-secondary); border-radius: 14px; padding: 1.25rem 1.5rem; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.referidos-stats-card .stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.referidos-stats-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.hidden { display: none !important; }
#applyFreeMonthModal { z-index: 99999; }
.modal-box { background: var(--bg-secondary); border-radius: 16px; padding: 1.5rem; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.2); border: 1px solid var(--border); }
.modal-box h3 { margin: 0 0 1rem; font-size: 1.2rem; color: var(--text-primary); }
.modal-box input { width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 0.5rem; font-size: 1rem; }
.modal-box .code-status { font-size: 0.85rem; margin-bottom: 0.5rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.modal-actions button { flex: 1; padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary); }
.modal-actions button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.link-ver-todo { font-size: 0.85rem; color: var(--primary); text-decoration: none; }
.link-ver-todo:hover { text-decoration: underline; }
