/* =============================================
   TARJETAS DIGITALES — SulPlast
   Estilo Linktree para perfiles NFC/QR
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #f1f5f9;
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.card-container {
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== AVATAR ========== */
.avatar {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

.avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 3px solid #38bdf8;
  font-size: 50px;
  line-height: 104px;
  color: #38bdf8;
}

.avatar img[style*="display: none"] + .avatar-fallback,
.avatar img:not([src]),
.avatar img[src=""] {
  display: none;
}

/* Si no hay imagen, mostrar fallback */
.avatar img:not([src]), .avatar img[src=""] {
  /* escondemos */
}

/* Hack: mostrar fallback cuando imagen falla */
.avatar:has(img[style*="display: none"]) .avatar-fallback {
  display: block;
}

/* Alternativa sencilla: si no hay img, mostrar fallback */
.avatar .avatar-fallback {
  display: none;
}
.avatar:has(img) .avatar-fallback { display: none; }
/* Para navegadores sin :has, mostramos fallback siempre y escondemos con JS — 
   o simplemente mostramos fallback si no hay src */
.avatar img[src="../img/foto-jose.jpg"] ~ .avatar-fallback,
.avatar img[src="../img/foto-bertha.jpg"] ~ .avatar-fallback,
.avatar img[src="../img/foto-alfredo.jpg"] ~ .avatar-fallback,
.avatar img[src="../img/foto-agripina.jpg"] ~ .avatar-fallback,
.avatar img[src="../img/foto-felipe.jpg"] ~ .avatar-fallback {
  display: none;
}
/* La imagen solo existe si la pones. Si no, se ve el fallback */

/* Simplificamos: fallback visible por defecto si no hay imagen real */
.avatar img[src=""] { display: none; }

/* ========== TEXTO ========== */
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.role {
  font-size: 1.05rem;
  font-weight: 500;
  color: #38bdf8;
  margin-bottom: 2px;
}

.company {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 28px;
}

/* ========== BOTONES ========== */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.btn {
  display: block;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn:active {
  transform: translateY(0);
}

/* Colores por tipo */
.whatsapp { background: rgba(37, 211, 102, 0.2);  border-color: rgba(37, 211, 102, 0.4); }
.whatsapp:hover { background: rgba(37, 211, 102, 0.35); }

.phone    { background: rgba(56, 189, 248, 0.2);  border-color: rgba(56, 189, 248, 0.4); }
.phone:hover    { background: rgba(56, 189, 248, 0.35); }

.email    { background: rgba(251, 146, 60, 0.2);  border-color: rgba(251, 146, 60, 0.4); }
.email:hover    { background: rgba(251, 146, 60, 0.35); }

.linkedin { background: rgba(14, 118, 168, 0.2);  border-color: rgba(14, 118, 168, 0.4); }
.linkedin:hover { background: rgba(14, 118, 168, 0.35); }

.extra    { background: rgba(168, 85, 247, 0.2);  border-color: rgba(168, 85, 247, 0.4); }
.extra:hover    { background: rgba(168, 85, 247, 0.35); }

/* ========== FOOTER ========== */
footer small {
  color: #64748b;
  font-size: 0.75rem;
}

/* ========== LANDING PAGE ========== */
body.landing {
  flex-direction: column;
  gap: 24px;
}

.landing-header {
  text-align: center;
  margin-bottom: 10px;
}

.landing-header h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.landing-header p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.personas-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-width: 700px;
}

.persona-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 24px;
  text-align: center;
  text-decoration: none;
  color: #f1f5f9;
  width: 180px;
  transition: all 0.25s ease;
}

.persona-card:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.persona-card .mini-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  margin: 0 auto 10px;
  font-size: 30px;
  line-height: 60px;
}

.persona-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.persona-card span {
  font-size: 0.75rem;
  color: #38bdf8;
}
