/* ============================================================================
   PROYECTO Z — components.css
   Componentes reutilizables: botones, cards, toasts, badges, avatares, modales.
   ============================================================================ */

/* ── BOTONES ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a1208;
  box-shadow: 0 4px 14px rgba(242,169,0,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242,169,0,0.45);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--border2);
  background: var(--card2);
}

.btn-danger {
  background: rgba(255,107,107,0.12);
  color: var(--red);
  border-color: rgba(255,107,107,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(255,107,107,0.2); }

.btn-sm { font-size: 12px; padding: 7px 14px; }
.btn-block { width: 100%; }


/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: all 0.2s; cursor: pointer; }
.card-hover:hover {
  border-color: rgba(242,169,0,0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}


/* ── AVATAR (iniciales con color) ────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 44px; height: 44px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }


/* ── BADGES / PILLS ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-gold   { background: rgba(242,169,0,0.15);  color: var(--gold);   border: 1px solid rgba(242,169,0,0.3); }
.badge-green  { background: rgba(61,214,140,0.12);  color: var(--green);  border: 1px solid rgba(61,214,140,0.3); }
.badge-red    { background: rgba(255,107,107,0.12); color: var(--red);    border: 1px solid rgba(255,107,107,0.3); }
.badge-muted  { background: rgba(255,255,255,0.06); color: var(--muted);  border: 1px solid var(--border); }


/* ── PILLS DE FILTRO ─────────────────────────────────────────────────────── */
.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s;
}
.pill:hover { color: var(--text); border-color: var(--border2); }
.pill.active {
  background: rgba(242,169,0,0.12);
  color: var(--gold);
  border-color: rgba(242,169,0,0.4);
}


/* ── TOAST (notificación flotante) ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, var(--card2), var(--panel));
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  font-size: 14px;
  max-width: 340px;
}
.toast-points {
  border-color: rgba(242,194,68,0.3);
}
.toast-points .toast-icon { font-size: 22px; }
.toast-points .toast-title { font-weight: 700; color: #f2c244; }
.toast-points .toast-sub { font-size: 12px; color: var(--muted); }

.toast-center {
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  bottom: 28px;
}


/* ── MODAL ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}


/* ── CAMPO DE FORMULARIO ─────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
  min-height: 16px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  opacity: 0.5;
  pointer-events: none;
}
.input-group input { padding-left: 42px; }
.input-group .toggle-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
}
.input-group .toggle-eye:hover { opacity: 1; }


/* ── DIVISOR ─────────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--muted2);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ── ESTADO VACÍO ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted2);
  font-size: 14px;
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.6; }


/* ── SPINNER ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
