/* ═════════════════════════════════════════════════════════════════════
   Patmopet · Programa de Puntos · Landing pública
   Paleta:
     Naranja marca   #E67E22
     Naranja cálido  #F59E0B
     Marrón trazo    #6B3F1D
     Azul oscuro     #1E3A5F
     Gris gatito     #95A5A6
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --naranja: #E67E22;
  --naranja-soft: #F59E0B;
  --naranja-light: #FED7AA;
  --naranja-bg: #FEF3E5;
  --marron: #6B3F1D;
  --azul: #1E3A5F;
  --azul-light: #2C5282;
  --gris: #95A5A6;
  --verde: #10B981;
  --rojo: #DC2626;
  --amber-soft: #FEF3C7;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --bg: #FFF7ED;
  --card: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(30,58,95,0.05);
  --shadow: 0 4px 12px rgba(230,126,34,0.10), 0 2px 4px rgba(30,58,95,0.05);
  --shadow-lg: 0 20px 40px rgba(230,126,34,0.15), 0 10px 20px rgba(30,58,95,0.08);
  --radius: 1rem;
  --radius-sm: 0.5rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFE8CF 50%, #FEF3C7 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

.paws-bg {
  position: fixed;
  inset: 0;
  color: var(--naranja);
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.wrapper {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 0 2rem;
  position: relative;
  z-index: 1;
}

/* ── Header de marca ── */
.brand-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}
.logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(230,126,34,0.25));
}
.tagline {
  font-size: 0.85rem;
  color: var(--marron);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Card base ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.5rem;
  border: 1px solid rgba(230,126,34,0.1);
}

/* ── Vista login ── */
.card-login h1 {
  font-size: 1.5rem;
  color: var(--azul);
  margin-bottom: 0.35rem;
  text-align: center;
  font-weight: 700;
}
.subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--azul);
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: all 0.15s ease;
  background: #fff;
}
.field input:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 4px rgba(230,126,34,0.15);
}
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.btn-primary {
  width: 100%;
  padding: 0.95rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--naranja) 0%, var(--naranja-soft) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(230,126,34,0.35);
  transition: all 0.15s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(230,126,34,0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#error-login:not(:empty) {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: var(--rojo);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 1rem;
  font-weight: 500;
}

.how-to {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--naranja-bg) 0%, #FFF8E7 100%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(230,126,34,0.15);
}
.how-to h3 {
  font-size: 0.9rem;
  color: var(--azul);
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.how-to ul { list-style: none; }
.how-to li {
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.3rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.how-to .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--naranja);
  margin-top: 0.45rem;
  flex-shrink: 0;
}

/* ── Vista datos ── */
.greeting {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.greeting strong { color: var(--azul); }
.wave {
  display: inline-block;
  animation: wave 2s ease infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(14deg); }
  80% { transform: rotate(-4deg); }
}

.saldo-hero {
  background: linear-gradient(135deg, var(--naranja) 0%, var(--naranja-soft) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(230,126,34,0.35);
  position: relative;
  overflow: hidden;
}
.saldo-hero::before {
  content: '🐾';
  position: absolute;
  font-size: 8rem;
  opacity: 0.08;
  right: -1rem;
  bottom: -2rem;
  transform: rotate(-15deg);
}
.saldo-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.saldo-value {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}
.saldo-unit {
  font-size: 1.25rem;
  font-weight: 600;
  opacity: 0.85;
}
.saldo-equiv {
  font-size: 0.95rem;
  opacity: 0.95;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Barra canje */
.progreso-canje {
  background: #FFF;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.progreso-canje.listo {
  background: #F0FDF4;
  border-color: var(--verde);
}
.progreso-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.progreso-canje.listo .progreso-label {
  color: var(--verde);
  font-weight: 700;
}
.progreso-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--naranja) 0%, var(--naranja-soft) 100%);
  border-radius: 4px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.progreso-canje.listo .progreso-fill {
  background: linear-gradient(90deg, var(--verde) 0%, #34D399 100%);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.stat-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--azul);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat.alerta { background: #FEF2F2; border-color: #FCA5A5; }
.stat.alerta .stat-value { color: var(--rojo); }
.stat.bien { background: #F0FDF4; border-color: #86EFAC; }
.stat.bien .stat-value { color: var(--verde); }

/* Aviso vencimiento */
.aviso-vence {
  background: var(--amber-soft);
  border: 1px solid #FCD34D;
  color: #92400E;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.aviso-icon { font-size: 1.25rem; flex-shrink: 0; }

/* Secciones */
.seccion { margin-bottom: 1.25rem; }
.seccion-title {
  font-size: 0.85rem;
  color: var(--azul);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

/* Mascotas */
.mascotas-grid {
  display: grid;
  gap: 0.5rem;
}
.mascota-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mascota-card.cumple-mes {
  background: linear-gradient(135deg, #FCE7F3 0%, #FEF3E5 100%);
  border-color: #F9A8D4;
}
.mascota-emoji { font-size: 1.5rem; flex-shrink: 0; }
.mascota-info { flex: 1; min-width: 0; }
.mascota-nombre { font-weight: 700; color: var(--azul); font-size: 0.95rem; }
.mascota-detalle { font-size: 0.75rem; color: var(--muted); }
.mascota-cumple-mes-tag {
  font-size: 0.65rem;
  background: #EC4899;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Últimas compras */
#compras-list { display: grid; gap: 0.4rem; }
.compra-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.compra-fecha {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.compra-desc {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compra-total {
  font-size: 0.85rem;
  color: var(--azul);
  font-weight: 700;
  white-space: nowrap;
}

/* Movimientos */
#lista-historial {
  display: grid;
  gap: 0.4rem;
}
.mov {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.mov-info { flex: 1; min-width: 0; }
.mov-tipo {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.mov-nota {
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-word;
  line-height: 1.35;
}
.mov-vence {
  font-size: 0.7rem;
  color: #9CA3AF;
  margin-top: 0.15rem;
}
.mov-right { text-align: right; flex-shrink: 0; }
.mov-pts {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.mov-pts.pos { color: var(--verde); }
.mov-pts.neg { color: var(--rojo); }
.mov-fecha {
  font-size: 0.7rem;
  color: #9CA3AF;
  margin-top: 0.15rem;
}

/* Acciones */
.acciones {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.btn-compartir {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #25D366;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
  transition: all 0.15s ease;
}
.btn-compartir:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,211,102,0.4);
}
.btn-secondary {
  width: 100%;
  padding: 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  color: var(--azul);
  border-color: var(--azul);
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}
footer .soft { opacity: 0.7; margin-top: 0.2rem; }

/* Animación de entrada */
.fade-in {
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive desktop */
@media (min-width: 768px) {
  body { padding: 2rem; }
  .wrapper { max-width: 36rem; }
  .card { padding: 2.5rem 2rem; }
  .card-login h1 { font-size: 1.75rem; }
  .saldo-value { font-size: 4rem; }
  .logo { max-width: 260px; }
}
