/* =======================================
   home.css — Landing page exclusive styles
   ======================================= */

:root {
  --bg1: #4527a0;
  --bg2: #1e88e5;
  --bg3: #0d47a1;
  --text: #e8eef5;
  --muted: #b8c4d1;
  --accent: #00d8ff;
  --card: #0d1117cc;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: #0d1117;
  overflow-x: hidden;
}

/* ========== Animated gradient background ========== */
.bg-animated {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 10% 10%, #673ab780 0%, transparent 60%),
    radial-gradient(1000px 700px at 90% 20%, #03a9f480 0%, transparent 65%),
    linear-gradient(120deg, var(--bg1), var(--bg2), var(--bg3));
  background-size: 140% 140%;
  animation: gradientShift 18s ease-in-out infinite;
  z-index: -2;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========== Particle layer ========== */
.particles::before, .particles::after {
  content: "";
  position: fixed;
  inset: -100px;
  pointer-events: none;
  background-repeat: repeat;
  z-index: -1;
  opacity: .35;
  animation: drift 60s linear infinite;
}

.particles::before {
  background-image:
    radial-gradient(2px 2px at 20px 30px, #ffffffcc 50%, transparent 52%),
    radial-gradient(2px 2px at 200px 120px, #ffffffcc 50%, transparent 52%),
    radial-gradient(2px 2px at 340px 260px, #ffffffcc 50%, transparent 52%),
    radial-gradient(2px 2px at 520px 40px, #ffffffcc 50%, transparent 52%),
    radial-gradient(2px 2px at 760px 180px, #ffffffcc 50%, transparent 52%);
  background-size: 800px 400px;
  filter: blur(.2px);
  animation-duration: 90s;
}

.particles::after {
  background-image:
    radial-gradient(1.5px 1.5px at 60px 80px, #ffffff99 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 260px 200px, #ffffff99 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 460px 140px, #ffffff99 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 700px 260px, #ffffff99 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 940px 60px, #ffffff99 50%, transparent 52%);
  background-size: 1000px 500px;
  animation-duration: 120s;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-200px, -120px, 0); }
}

/* ========== Main layout ========== */
main.container-hero,
main.logged-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  width: 100%;
}

.card-hero,
.logged-card {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  background: var(--card);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 20px 60px #0008, inset 0 1px 0 #ffffff1a;
  padding: clamp(1.25rem, 2vw + 1rem, 2.5rem);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
  box-sizing: border-box;
}

/* Slight separation from navbar */
@media (min-width: 768px) {
  main.container-hero,
  main.logged-in {
    padding-top: 6rem;
  }
}

@media (min-width: 1200px) {
  .card-hero,
  .logged-card {
    max-width: 960px;
  }
}

/* ========== Avatar & intro (public view) ========== */
@media (max-width: 680px) {
  .card-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  overflow: hidden;
  background: #0b1220;
  box-shadow: 0 8px 24px #0007, inset 0 1px 0 #ffffff14;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.title {
  font-weight: 800;
  font-size: clamp(1.8rem, 2vw + 1.2rem, 3rem);
  line-height: 1.1;
}

.subtitle {
  color: #c5d1de;
  font-weight: 600;
  margin-top: .25rem;
}

.lead {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: clamp(1rem, .4vw + .95rem, 1.1rem);
}

.actions {
  margin-top: 1.25rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons */
.btn-ghost {
  border: 1px solid #ffffff33;
  color: #eaf2ff;
  background: transparent;
  padding: .65rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}

.btn-ghost:hover {
  border-color: #ffffff66;
  transform: translateY(-1px);
}

.btn-accent {
  border: 1px solid transparent;
  background: var(--accent);
  color: #001018;
}

/* Footer */
footer {
  margin: 1rem auto 2rem;
  text-align: center;
  color: #a9b6c4;
  font-size: .9rem;
}

a.muted {
  color: #a9c7ff;
  text-decoration: none;
  border-bottom: 1px dotted #a9c7ff55;
}

a.muted:hover {
  border-bottom-color: #a9c7ffcc;
}

/* ===== Tesco Card (visible when logged in) ===== */
.tesco-card {
  background: rgba(13, 17, 23, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.tesco-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
  background: rgba(13, 17, 23, 0.75);
}

.tesco-logo {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.tesco-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.tesco-text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ===== Logged-in section (multi-card layout, fixed centering) ===== */
.logged-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(13, 17, 23, 0.6);
  backdrop-filter: blur(14px) saturate(140%);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  padding: 0 3rem;
  max-width: none;
  width: 100%;  
}

.logged-header {
  margin-bottom: 2rem;
}

.logged-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-content: center; /* centra el conjunto */
  justify-items: center;   /* centra cada tarjeta */
  width: 100%;
  max-width: none;
  padding: 0 3rem;
}

/* responsive */
@media (max-width: 767px) {
  .logged-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Fade + slide-up animation for cards ===== */
@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: translateY(25px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logged-grid > .tesco-card {
  animation: cardAppear 0.6s ease-out both;
}

.logged-grid > .tesco-card:nth-child(2) {
  animation-delay: 0.15s;
}
.logged-grid > .tesco-card:nth-child(3) {
  animation-delay: 0.3s;
}
.logged-grid > .tesco-card:nth-child(4) {
  animation-delay: 0.45s;
}

/* Reducir padding en móviles */
@media (max-width: 767px) {
  .logged-card {
    padding: 0 1rem; /* antes 3rem */
  }

  .logged-grid {
    padding: 0 1rem; /* antes 3rem */
    gap: 1.5rem;      /* opcional: reduce separación */
  }
}

/* En moviles, usa todo el ancho disponible */
@media (max-width: 480px) {
  .tesco-card {
    max-width: 100%;
  }
}

