/* =========================================================
   KÜRU — Modern Design System
   Mobile-first, professional, bold like KFC/fast-casual apps
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Poppins:wght@700;800;900&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green-900: #1b5e20;
  --green-700: #2e7d32;
  --green-500: #388e3c;
  --green-400: #4caf50;
  --green-100: #e8f5e9;
  --green-50:  #f1f8e9;

  --orange-600: #e65100;
  --orange-500: #f57c00;
  --orange-400: #ff9800;

  --blue-800: #1565c0;
  --blue-100: #e3f2fd;

  --red-700:  #c62828;
  --red-100:  #ffebee;

  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --white: #ffffff;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.15), 0 8px 20px rgba(0,0,0,.1);

  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #f0f4f0;
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
img  { max-width: 100%; }

/* =========================================================
   HEADER / NAV
   ========================================================= */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 64px;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img { height: 44px; }
.logo h1 {
  font-family: var(--font-display);
  color: var(--green-500);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Desktop nav */
nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 600;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
nav a:hover { background: var(--green-100); color: var(--green-700); }

.nav-puntos {
  background: var(--green-100);
  color: var(--green-700);
  padding: .3rem .8rem;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Hamburger menu button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  border-radius: var(--radius-sm);
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: all .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--white);
  z-index: 999;
  flex-direction: column;
  padding: 1.5rem;
  gap: .3rem;
  border-top: 1px solid var(--gray-200);
  overflow-y: auto;
  animation: slideDown .25s ease;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: background .18s;
  border-bottom: 1px solid var(--gray-100);
}
.nav-drawer a:hover { background: var(--green-100); color: var(--green-700); }
.nav-drawer .nav-puntos { margin: .5rem 0; text-align: center; font-size: .9rem; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   BUTTONS — Modern & Bold
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  letter-spacing: .01em;
  white-space: nowrap;
  line-height: 1;
}

.btn:active { transform: scale(.97); }

.btn.green {
  background: var(--green-500);
  color: var(--white);
  border-color: var(--green-500);
  box-shadow: 0 3px 12px rgba(56,142,60,.3);
}
.btn.green:hover {
  background: var(--green-700);
  border-color: var(--green-700);
  box-shadow: 0 5px 18px rgba(56,142,60,.4);
  transform: translateY(-1px);
}

.btn.orange {
  background: var(--orange-500);
  color: var(--white);
  border-color: var(--orange-500);
  box-shadow: 0 3px 12px rgba(245,124,0,.3);
}
.btn.orange:hover {
  background: var(--orange-600);
  border-color: var(--orange-600);
  box-shadow: 0 5px 18px rgba(245,124,0,.4);
  transform: translateY(-1px);
}

.btn.red {
  background: var(--red-700);
  color: var(--white);
  border-color: var(--red-700);
}
.btn.red:hover { background: #b71c1c; transform: translateY(-1px); }

.btn.blue {
  background: var(--blue-800);
  color: var(--white);
  border-color: var(--blue-800);
  box-shadow: 0 3px 12px rgba(21,101,192,.25);
}
.btn.blue:hover { background: #0d47a1; transform: translateY(-1px); }

.btn.outline {
  background: transparent;
  color: var(--green-500);
  border-color: var(--green-500);
}
.btn.outline:hover { background: var(--green-500); color: var(--white); transform: translateY(-1px); }

.btn-block {
  display: flex;
  width: 100%;
  text-align: center;
  padding: .9rem;
  font-size: 1rem;
  margin-top: .5rem;
  border-radius: var(--radius-md);
}

/* Green action button inside cards */
.btn-green {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-500);
  color: var(--white);
  border: none;
  padding: .65rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 700;
  width: 100%;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(56,142,60,.25);
  text-decoration: none;
}
.btn-green:hover:not(:disabled) { background: var(--green-700); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(56,142,60,.35); }
.btn-green:disabled { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; box-shadow: none; }

.btn-retirar {
  background: transparent;
  color: var(--red-700);
  border: 1.5px solid #ef9a9a;
  padding: .55rem .9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  width: 100%;
  font-family: var(--font-body);
  transition: all .2s;
}
.btn-retirar:hover { background: var(--red-100); border-color: var(--red-700); }

/* =========================================================
   HERO — Full-bleed cinematic
   ========================================================= */

.hero {
  text-align: center;
  padding: 7rem 1.5rem 5rem;
  color: var(--white);
  position: relative;
  min-height: 80vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,.6) 0%, rgba(27,94,32,.55) 100%);
  z-index: 1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  z-index: 0;
}
.hero-slide.active { opacity: 1; }
.hero-slide:nth-child(1) { background-image: url("../imagenes/fondo.jpg");  }
.hero-slide:nth-child(2) { background-image: url("../imagenes/fondo1.jpg"); }
.hero-slide:nth-child(3) { background-image: url("../imagenes/fondo2.jpg"); }
.hero-slide:nth-child(4) { background-image: url("../imagenes/fondo3.jpg"); }

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(8px);
  color: #a5d6a7;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .4rem 1.1rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.2rem;
}

.hero-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  text-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.hero-content p {
  font-size: clamp(.9rem, 2.5vw, 1.1rem);
  color: rgba(255,255,255,.85);
  margin-bottom: 2.5rem;
  max-width: 540px;
  line-height: 1.7;
}

.roles {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.roles .btn {
  padding: .85rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* =========================================================
   STATS BAR
   ========================================================= */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.stat {
  text-align: center;
  padding: 1.8rem 1rem;
  position: relative;
}
.stat + .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--gray-200);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--green-500);
  line-height: 1;
  margin-bottom: .35rem;
}
.stat-label {
  font-size: .78rem;
  color: var(--gray-500, #6b7280);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* =========================================================
   FEATURES GRID (homepage)
   ========================================================= */

.features {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  padding: 3rem 1.5rem;
  gap: 1.2rem;
}

.feature {
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 260px;
  padding: 2rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
  border: 1px solid var(--gray-200);
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--green-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto .8rem;
}
.feature h3 { color: var(--green-700); margin-bottom: .4rem; font-size: 1.02rem; font-weight: 700; }
.feature p  { font-size: .83rem; color: var(--gray-600); line-height: 1.5; }

/* =========================================================
   HERO PANEL (inner pages)
   ========================================================= */

.hero-panel {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--green-900) 100%);
  color: var(--white);
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 32px;
  background: #f0f4f0;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-panel h2 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: .4rem;
  letter-spacing: -0.5px;
}
.hero-panel p  { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: .8rem; }

.badge-usuario {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-pill);
  padding: .4rem 1.2rem;
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.95);
}

/* =========================================================
   CONTAINER / SECTIONS
   ========================================================= */

.container {
  max-width: 980px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,.04);
}
.container-sm  { max-width: 500px; }
.container-med { max-width: 760px; }

h2 {
  text-align: center;
  font-family: var(--font-display);
  color: var(--green-700);
  margin-bottom: .5rem;
  font-size: 1.8rem;
  font-weight: 800;
}

.seccion-h3 {
  color: var(--gray-900);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-left: .85rem;
  border-left: 4px solid var(--green-400);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.subtitulo { text-align: center; color: var(--gray-500, #6b7280); font-size: .9rem; margin-bottom: 1.2rem; }

/* =========================================================
   ALERTS
   ========================================================= */

.alerta {
  max-width: 980px;
  margin: 1rem auto;
  padding: .9rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
  animation: slideDown .3s ease;
  border-left: 4px solid transparent;
}
.alerta.exito { background: var(--green-100); color: var(--green-700); border-color: var(--green-400); }
.alerta.error { background: var(--red-100);  color: var(--red-700);   border-color: #ef5350; }
.alerta.info  { background: var(--blue-100); color: var(--blue-800);  border-color: #42a5f5; }

/* =========================================================
   CARDS (food grid)
   ========================================================= */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem;
  margin-bottom: 1.2rem;
}
.panel-header .seccion-h3 { margin-bottom: 0; }

.contador {
  background: var(--green-100);
  color: var(--green-700);
  padding: .3rem .9rem;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 700;
}

.filtro-form {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.filtro-form select {
  padding: .55rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: var(--font-body);
  background: var(--white);
  cursor: pointer;
  transition: border-color .2s;
}
.filtro-form select:focus { outline: none; border-color: var(--green-400); }
.btn-limpiar { color: var(--red-700); font-size: .85rem; text-decoration: none; font-weight: 600; }
.btn-limpiar:hover { text-decoration: underline; }

.lista-alimentos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: .5rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: .45rem;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card.entregado { opacity: .65; }

/* card inner padding (except top image) */
.card > *:not(img) { padding: 0 1.1rem; }
.card > *:first-child:not(img) { padding-top: 1.1rem; }
.card > *:last-child { padding-bottom: 1.1rem; }
.card img { border-radius: 0; width: 100%; }

/* Green accent top bar */
.card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--green-400), var(--green-700));
  flex-shrink: 0;
}

.card-cat {
  font-size: .7rem;
  background: var(--green-100);
  color: var(--green-700);
  padding: .2rem .65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card h3 { color: var(--gray-900); font-size: .98rem; font-weight: 700; }
.card p  { font-size: .83rem; color: var(--gray-600); }

/* =========================================================
   STATUS BADGES
   ========================================================= */

.estado-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  width: fit-content;
}
.estado-badge.disponible   { background: var(--green-100); color: var(--green-700); }
.estado-badge.entregado    { background: var(--blue-100);  color: var(--blue-800); }
.estado-badge.cancelado    { background: var(--gray-100);  color: var(--gray-600); }
.estado-badge.pendiente    { background: #fff8e1; color: #f57f17; }
.estado-badge.confirmada   { background: var(--green-100); color: var(--green-700); }
.estado-badge.donante      { background: #fff3e0; color: var(--orange-600); }
.estado-badge.beneficiario { background: var(--green-100); color: var(--green-900); }
.estado-badge.administrador{ background: #ede7f6; color: #4527a0; }

/* =========================================================
   FORMS
   ========================================================= */

.form-auth, .form-donante {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: .8rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 160px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.form-group label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--gray-700);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: .75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .92rem;
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
}
.form-group input::placeholder { color: var(--gray-400); }
.form-group textarea { resize: vertical; min-height: 90px; }

.form-link { text-align: center; font-size: .87rem; color: var(--gray-500, #6b7280); margin-top: .3rem; }
.form-link a { color: var(--green-500); font-weight: 700; text-decoration: none; }
.form-link a:hover { text-decoration: underline; }

.info-box {
  background: var(--blue-100);
  border: 1px solid #90caf9;
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-size: .88rem;
  color: var(--blue-800);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* =========================================================
   TABLE
   ========================================================= */

.tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  margin-top: .5rem;
  overflow-x: auto;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tabla-historial th {
  background: var(--gray-900);
  color: var(--white);
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.tabla-historial td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
  background: var(--white);
}
.tabla-historial tr:last-child td { border-bottom: none; }
.tabla-historial tr:hover td { background: var(--green-50); }

/* =========================================================
   KPI / ADMIN
   ========================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .9rem;
  margin-bottom: 1.8rem;
}

.kpi {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1rem;
  text-align: center;
  transition: transform .2s, border-color .2s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--green-400); }
.kpi.kpi-verde { background: var(--green-50); border-color: var(--green-400); }

.kpi-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--green-500);
  line-height: 1;
  margin-bottom: .3rem;
}
.kpi span:last-child { font-size: .75rem; color: var(--gray-600); font-weight: 500; }

/* =========================================================
   ADMIN TABS
   ========================================================= */

.admin-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  padding: .4rem;
  border-radius: var(--radius-lg);
}

.tab-btn {
  padding: .55rem 1.1rem;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all .2s;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--white);
  color: var(--green-700);
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover:not(.active) { background: rgba(255,255,255,.6); color: var(--gray-800); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =========================================================
   RANKING
   ========================================================= */

.ranking-lista {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.2rem;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.ranking-item:hover { transform: translateX(4px); }
.ranking-item.top3  { border-color: #ffd600; background: #fffde7; }
.ranking-item.ranking-yo { background: var(--green-50); border: 2px solid var(--green-400); }

.ranking-pos { font-size: 1.5rem; min-width: 2.5rem; text-align: center; }
.ranking-info { flex: 1; }
.ranking-info strong { display: block; font-size: .95rem; color: var(--gray-900); font-weight: 700; }
.ranking-info small  { font-size: .78rem; color: var(--gray-400); }
.ranking-pts { font-weight: 800; color: var(--green-500); font-size: .95rem; white-space: nowrap; }

.puntos-info {
  background: var(--green-50);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.5rem;
  border: 1px solid #c5e1a5;
}
.puntos-info h3 { color: var(--green-900); margin-bottom: .8rem; font-size: 1rem; font-weight: 700; }
.puntos-info ul { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.puntos-info li {
  font-size: .87rem;
  color: var(--gray-700);
  padding: .4rem .6rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid #dcedc8;
}

/* =========================================================
   QUIEN SOMOS CARDS
   ========================================================= */

.qs-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  border: 1px solid var(--gray-200);
  text-align: center;
  transition: transform .25s, box-shadow .25s;
}
.qs-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.qs-icon {
  font-size: 2.5rem;
  margin-bottom: .7rem;
  display: block;
}
.qs-card h3 { color: var(--green-700); margin-bottom: .5rem; font-weight: 700; }
.qs-card p  { font-size: .88rem; color: var(--gray-600); line-height: 1.6; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  border: 2px solid var(--green-100);
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--green-400); }
.stat-num-lg { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--green-500); }
.stat-card > span:last-child { font-size: .78rem; color: var(--gray-600); }

/* =========================================================
   HOW IT WORKS — PASO CARDS
   ========================================================= */

.pasos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.paso-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.2rem;
  text-align: center;
  border: 2px solid var(--green-400);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.paso-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.paso-num {
  width: 2.4rem;
  height: 2.4rem;
  background: linear-gradient(135deg, var(--green-400), var(--green-700));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  margin: 0 auto .8rem;
  box-shadow: 0 3px 10px rgba(56,142,60,.3);
}
.paso-card h4 { color: var(--gray-900); margin-bottom: .4rem; font-size: .95rem; font-weight: 700; }
.paso-card p  { font-size: .82rem; color: var(--gray-600); line-height: 1.45; }

/* =========================================================
   MAP
   ========================================================= */

#mapa-kuru {
  width: 100%;
  height: 420px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  margin-top: 1rem;
  overflow: hidden;
}
.mapa-info {
  background: var(--green-50);
  border-radius: var(--radius-md);
  padding: .85rem 1.1rem;
  font-size: .87rem;
  color: var(--green-700);
  margin-bottom: .8rem;
  border: 1px solid #c5e1a5;
  font-weight: 600;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
  background: var(--gray-900);
  color: #9ca3af;
  padding: 3rem 2rem 1.5rem;
  margin-top: auto;
}
.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}
.footer-container > div { flex: 1 1 180px; }

.footer-logo h2 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: .3rem;
}
.footer-logo p { color: #6b7280; font-size: .84rem; line-height: 1.5; }

footer h3 {
  color: var(--white);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1rem;
}
footer ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
footer ul li {}
footer a { color: #9ca3af; text-decoration: none; font-size: .85rem; transition: color .18s; }
footer a:hover { color: var(--green-400); }

.footer-bottom {
  text-align: center;
  border-top: 1px solid #374151;
  padding-top: 1.2rem;
  font-size: .8rem;
  color: #6b7280;
  max-width: 1100px;
  margin: 0 auto;
}

/* =========================================================
   MESSAGING
   ========================================================= */

.demo-creds {
  margin-top: 1.5rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: .82rem;
  color: var(--gray-600);
  text-align: center;
  border: 1px dashed var(--gray-300, #d1d5db);
}
.demo-creds p { margin: .2rem 0; }

/* =========================================================
   PASOS LISTA
   ========================================================= */

.pasos-lista {
  list-style: none;
  counter-reset: paso;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.2rem;
}
.pasos-lista li {
  counter-increment: paso;
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .88rem;
  color: var(--gray-700);
}
.pasos-lista li::before {
  content: counter(paso);
  background: var(--green-500);
  color: var(--white);
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}

/* =========================================================
   RESPONSIVE — MOBILE FIRST
   ========================================================= */

@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat + .stat::before { display: none; }
  .stat { border-bottom: 1px solid var(--gray-200); }
}

@media (max-width: 768px) {
  /* Header */
  header { padding: 0 1rem; }
  nav { display: none; } /* hidden, replaced by drawer */
  .nav-hamburger { display: flex; }

  /* Hero */
  .hero { min-height: 70vh; padding: 5rem 1.2rem 4rem; margin: 0; border-radius: 0; }
  .hero-content h2 { font-size: 2rem; letter-spacing: -0.5px; }
  .hero-content p  { font-size: .92rem; }
  .roles { gap: .7rem; }
  .roles .btn { padding: .75rem 1.4rem; font-size: .9rem; width: 100%; max-width: 220px; }

  /* Stats */
  .stats-bar { grid-template-columns: repeat(2, 1fr); }

  /* Features */
  .features { padding: 1.5rem 1rem; gap: .8rem; }
  .feature { min-width: 140px; padding: 1.4rem 1rem; }

  /* Containers */
  .container { margin: .8rem; padding: 1.2rem; border-radius: var(--radius-lg); }

  /* Forms */
  .form-row { flex-direction: column; gap: .8rem; }

  /* KPI */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  /* Admin tabs */
  .admin-tabs { gap: .3rem; }
  .tab-btn { font-size: .8rem; padding: .45rem .7rem; }

  /* Table */
  .tabla-historial th, .tabla-historial td { padding: .5rem .6rem; font-size: .78rem; }

  /* Cards */
  .lista-alimentos { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }

  /* Hero panel */
  .hero-panel { padding: 2.5rem 1rem 2.5rem; }
  .hero-panel::after { clip-path: none; height: 20px; }

  /* Footer */
  .footer-container { flex-direction: column; gap: 1.5rem; }
  footer { padding: 2rem 1.2rem 1rem; }

  /* Sections that use flex layout */
  section.features { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  /* Smaller screens */
  .hero-content h2 { font-size: 1.7rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .lista-alimentos { grid-template-columns: 1fr; }
  .pasos-grid { grid-template-columns: 1fr 1fr; }
  .ranking-item { gap: .6rem; padding: .7rem .9rem; }

  /* Messaging layout fix */
  section.features[style*="align-items:flex-start"] {
    flex-direction: column;
  }
}

/* =========================================================
   UTILITY
   ========================================================= */

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--green-400); border-radius: 3px; }

/* Focus visible for accessibility */
:focus-visible { outline: 2px solid var(--green-400); outline-offset: 2px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
