/* ==========================================================================
   COMPONENTS.CSS – Elementos reutilizables en toda la web
   Última actualización: marzo 2026
   ========================================================================== */

/* Variables (si no están en base.css, agrégalas aquí) */
:root {
  --primary: #3ba676;
  --primary-dark: #c0392b;
  --accent: #f39c12;
  --text: #2c3e50;
  --bg: #f8f9fa;
  --light: #ecf0f1;
  --gray: #6b7280;
  --gray-light: #9ca3af;
}

/* Botones comunes */
.cta-big,
.btn-connect {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  transition: all 0.25s ease;
}

.cta-big {
  background: var(--primary);
  color: white;
  padding: 1.1rem 2.4rem;
  font-size: 1.3rem;
  box-shadow: 0 6px 20px rgba(231,76,60,0.25);
}

.cta-big:hover {
  transform: translateY(-3px);
}

.btn-connect {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

/* Tarjeta de mascota genérica (listado principal) */
.pet-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
}

.pet-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.pet-card .pet-image {
  height: 210px;
  overflow: hidden;
  flex-shrink: 0;
}

.pet-card .pet-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-card .pet-info {
  padding: 1.2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.pet-card .pet-description {
  flex-grow: 1;
  margin: 0.6rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.pet-card .pet-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Tarjeta carrusel (diferenciada y con altura fija) */
.pet-card-carousel {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: all 0.28s ease;
  display: flex;
  flex-direction: column;
  height: 430px;                /* altura fija → todas iguales */
  width: 100%;
  max-width: 360px;             /* más pequeño y controlado */
  margin: 0 12px;
  flex: 0 0 auto;
}

.pet-card-carousel:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 32px rgba(231,76,60,0.18);
}

.pet-card-carousel .pet-image {
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.pet-card-carousel .pet-info {
  padding: 1.2rem 1.3rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.pet-card-carousel .pet-desc-carousel {
  flex-grow: 1;
  margin: 0.6rem 0 1.2rem;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.pet-card-carousel .btn-connect {
  margin-top: auto;
  background: var(--primary);
  color: white;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  width: 100%;
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  background: white;
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  margin: 3.5rem auto;
  max-width: 1100px;
}

.stat-item {
  text-align: center;
  min-width: 180px;
}

.stat-number {
  font-size: 2.6rem;
  color: var(--primary);
  font-weight: 700;
}

/* Modal mascota */
.pet-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.pet-modal.hidden {
  display: none;
}


/* FICHAS MASCOTAS (INCLUDE) */

.user-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.user-image-container {
  position: relative;
  display: inline-block;
}

.user-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-20%);
  z-index: 9999;
  
  background: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;

  font-size: 0.6rem;
  font-weight: 700;

  opacity: 0;
  visibility: hidden;
  transition: .15s;
}

.user-image-container:hover .user-tooltip {
  opacity: 1;
  visibility: visible;
}


/* ==========================================================================
   LOGIN MODERNO – Base para login y registro
   ========================================================================== */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 85vh;
  padding: 2rem;
  background: linear-gradient(to bottom, var(--bg), #fff);
}

.auth-container {
  background: var(--glass-bg, #fff);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border, #ddd);
  border-radius: var(--radius-lg, 16px);
  padding: 3rem 2rem;
  width: 100%;
  box-shadow: 0 12px 32px rgba(59,166,118,0.12);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

/* ==========================================================================
   Login – ancho por defecto
   ========================================================================== */
.auth-page.login .auth-container {
  max-width: 420px;
}

/* ==========================================================================
   Registro – ancho mayor
   ========================================================================== */
.auth-page.register .auth-container {
  max-width: 840px;  /* el doble de login */
}

/* ==========================================================================
   Titulos y subtitulos
   ========================================================================== */
.auth-title {
  font-family: var(--font-heading, 'Cabinet Grotesk', sans-serif);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark, #2c3e50);
}

.auth-subtitle {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.95rem;
  color: var(--text-muted, #555);
  margin-bottom: 2rem;
}

/* ==========================================================================
   Formulario vertical
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-form .form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.auth-form input {
  padding: 14px 12px;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  background: #fdfdfd;
}

.auth-form input:focus {
  border-color: var(--primary, #3ba676);
  box-shadow: 0 0 8px rgba(59,166,118,0.25);
}

.auth-form label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #999;
  pointer-events: none;
  transition: all 0.3s;
}

.auth-form input:focus + label,
.auth-form input:not(:placeholder-shown) + label {
  top: -8px;
  left: 8px;
  font-size: 0.75rem;
  color: var(--primary, #3ba676);
  background: #fff;
  padding: 0 4px;
}

/* ==========================================================================
   Botones
   ========================================================================== */
.btn-auth {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg,#3ba676,#2e8b57);
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59,166,118,0.18);
}

.btn-auth.secondary {
  background: #eee;
  color: #333;
}

.btn-auth.small {
  padding: 10px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Links y opciones
   ========================================================================== */
.auth-link {
  color: var(--primary, #3ba676);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-options,
.auth-register,
.resend-container,
.forgot-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.9rem;
  text-align: center;
}

/* ==========================================================================
   Mensajes de alerta
   ========================================================================== */
.alert-danger {
  background: #fde2e2;
  color: #b33a3a;
  padding: 10px;
  border-radius: 8px;
  margin-top: 1rem;
  text-align: center;
}

/* ==========================================================================
   Media queries
   ========================================================================== */
@media (min-width: 768px) {
  .auth-page.login .auth-container {
    max-width: 480px;
  }
  .auth-page.register .auth-container {
    max-width: 900px;
  }
}

@media (min-width: 1200px) {
  .auth-page.login .auth-container {
    max-width: 500px;
  }
  .auth-page.register .auth-container {
    max-width: 1000px;
  }
}