/* ============ RESET & BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --azul-cuba: #002a5e;
  --rojo-cuba: #cf142b;
  --amarillo: #ffc72c;
  --coral: #ff6b6b;
  --crema: #fdf8f3;
  --gris: #4a5568;
  --blanco: #ffffff;
  --sombra: 0 10px 40px rgba(0,0,0,0.08);
  --sombra-hover: 0 20px 60px rgba(0,0,0,0.15);
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.7;
  color: var(--gris);
  background: var(--crema);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--rojo-cuba); text-decoration: none; }

/* ============ NAVBAR ============ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}
.navbar .logo {
  font-size: 1.2rem; font-weight: 800;
  color: var(--azul-cuba);
  display: flex; align-items: center; gap: .5rem;
  z-index: 101;
}
.navbar nav {
  display: flex; align-items: center; gap: .5rem;
}
.navbar nav a {
  color: var(--gris);
  font-weight: 500; transition: color .3s;
  padding: .5rem .8rem;
}
.navbar nav a:hover { color: var(--rojo-cuba); }

/* Botón hamburguesa (oculto en desktop) */
.menu-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.8rem; cursor: pointer;
  color: var(--azul-cuba);
  z-index: 101;
  padding: .3rem;
}

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0,42,94,0.85), rgba(207,20,43,0.75)),
    url('https://images.unsplash.com/photo-1583833008338-35c436398294?w=1600') center/cover;
  color: white;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
}
.hero-content { max-width: 900px; animation: fadeUp 1s ease-out; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}
.hero h1 span { color: var(--amarillo); }
.hero p {
  font-size: clamp(1rem, 2vw, 1.4rem);
  margin-bottom: 2.5rem;
  opacity: .95;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

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

/* ============ BOTONES ============ */
.btn {
  display: inline-block;
  padding: 1rem 2.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all .3s ease;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: center;
}
.btn-primary {
  background: var(--amarillo);
  color: var(--azul-cuba);
  box-shadow: 0 8px 25px rgba(255,199,44,.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255,199,44,.6);
}
.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}
.btn-secondary:hover { background: white; color: var(--azul-cuba); }
.btn-solid {
  background: var(--rojo-cuba);
  color: white;
  box-shadow: 0 8px 25px rgba(207,20,43,.3);
}
.btn-solid:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(207,20,43,.5);
}

/* ============ SECCIONES ============ */
main { padding: 0; }
section { padding: 5rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--azul-cuba);
  font-weight: 800;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}
.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--gris);
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}

/* ============ STATS ============ */
.stats-section { background: white; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #f8f9ff, #fff);
  box-shadow: var(--sombra);
  transition: transform .3s;
}
.stat-card:hover { transform: translateY(-8px); }
.stat-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.stat-card .number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--rojo-cuba);
  display: block;
  line-height: 1;
  margin-bottom: .5rem;
  word-break: break-word;
}
.stat-card .label {
  color: var(--gris);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============ CÓMO FUNCIONA ============ */
.steps-section { background: var(--crema); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.step {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--sombra);
  position: relative;
  transition: transform .3s;
}
.step:hover { transform: translateY(-8px); }
.step .step-number {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 50px;
  background: var(--amarillo);
  color: var(--azul-cuba);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.3rem;
  box-shadow: 0 5px 15px rgba(255,199,44,.4);
}
.step h3 {
  color: var(--azul-cuba);
  margin: 1.5rem 0 1rem;
  font-size: 1.3rem;
}

/* ============ IMPACTO ============ */
.impact-section {
  background: var(--azul-cuba);
  color: white;
}
.impact-section .section-title { color: white; }
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.impact-card {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform .3s;
}
.impact-card:hover { transform: translateY(-8px); }
.impact-card img { width: 100%; height: 220px; object-fit: cover; }
.impact-card-body { padding: 1.8rem; }
.impact-card h3 { margin-bottom: .8rem; color: var(--amarillo); }

/* ============ CTA FINAL ============ */
.cta-section {
  background: linear-gradient(135deg, var(--rojo-cuba), #e83e5a);
  color: white;
  text-align: center;
  padding: 5rem 1.5rem;
}
.cta-section h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1rem;
  font-weight: 800;
}
.cta-section p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  opacity: .95;
}

/* ============ FORMULARIOS ============ */
.form-section {
  min-height: 80vh;
  padding: 7rem 1rem 3rem;
  display: flex; align-items: center; justify-content: center;
}
.form-card {
  background: white;
  padding: 2.5rem 2rem;
  border-radius: 24px;
  box-shadow: var(--sombra);
  max-width: 500px;
  width: 100%;
}
.form-card h2 {
  color: var(--azul-cuba);
  margin-bottom: .5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
}
.form-card .subtitle {
  color: var(--gris);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.form-card label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--azul-cuba);
  font-size: .95rem;
}
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  padding: .9rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  margin-top: .4rem;
  transition: border .3s;
  font-family: inherit;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--rojo-cuba);
}
.form-card .btn { width: 100%; margin-top: 1rem; }

.montos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  margin: 1.5rem 0;
}
.monto-btn {
  padding: 1rem .5rem;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--azul-cuba);
  cursor: pointer;
  transition: all .3s;
  min-height: 50px;
}
.monto-btn:hover, .monto-btn.active {
  border-color: var(--rojo-cuba);
  background: var(--rojo-cuba);
  color: white;
}

/* ============ TABLAS ============ */
.tabla-container {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra);
  margin-top: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th {
  background: var(--azul-cuba);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: .5px;
  white-space: nowrap;
}
td {
  padding: 1rem;
  border-bottom: 1px solid #edf2f7;
}
tr:hover td { background: #f8fafc; }

/* ============ BARRAS DE PROGRESO ============ */
.barra {
  background: #edf2f7;
  height: 12px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: .5rem;
}
.barra > div {
  background: linear-gradient(90deg, var(--rojo-cuba), var(--coral));
  height: 100%;
  border-radius: 10px;
  transition: width 1s ease;
}

/* ============ FOOTER ============ */
footer {
  background: #1a1a2e;
  color: white;
  padding: 3rem 1.5rem 2rem;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  color: var(--amarillo);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.footer-col a {
  display: block;
  color: #cbd5e0;
  margin-bottom: .6rem;
  transition: color .3s;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: center;
  color: #a0aec0;
  font-size: .85rem;
}

/* ============ ADMIN ============ */
.admin-header {
  background: var(--azul-cuba);
  color: white;
  padding: 1.5rem 1rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-header h1 { font-size: 1.3rem; }
.admin-main { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.admin-tabs {
  display: flex; gap: .3rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-tab {
  padding: .7rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--gris);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .3s;
  white-space: nowrap;
  font-size: .9rem;
}
.admin-tab.active {
  color: var(--rojo-cuba);
  border-bottom-color: var(--rojo-cuba);
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-stat {
  background: white;
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: var(--sombra);
}
.admin-stat .label { color: var(--gris); font-size: .85rem; text-transform: uppercase; }
.admin-stat .value { font-size: 1.7rem; font-weight: 800; color: var(--azul-cuba); margin-top: .3rem; word-break: break-word; }

/* ============ UTILS ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.alert {
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: 500;
  font-size: .95rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ============================================================
   📱 RESPONSIVE - MÓVIL (hasta 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Navbar con menú hamburguesa */
  .navbar { padding: .8rem 1rem; }
  .navbar .logo { font-size: 1.05rem; }
  
  .menu-toggle { display: block; }
  
  .navbar nav {
    position: fixed;
    top: 0; right: 0;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 5rem 1.5rem 2rem;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform .3s ease;
    gap: 0;
    overflow-y: auto;
  }
  
  .navbar nav.open { transform: translateX(0); }
  
  .navbar nav a {
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
    margin: 0;
    text-align: left;
    font-size: 1rem;
  }
  
  .navbar nav a.btn {
    margin-top: 1rem;
    text-align: center;
  }
  
  /* Overlay oscuro cuando el menú está abierto */
  .navbar::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 99;
  }
  .navbar.menu-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hero */
  .hero {
    min-height: 90vh;
    padding: 5rem 1rem 2rem;
  }
  .hero h1 { font-size: 2rem; margin-bottom: 1rem; }
  .hero p { font-size: 1rem; margin-bottom: 1.5rem; }
  .hero-cta { flex-direction: column; gap: .8rem; }
  .hero-cta .btn { width: 100%; }

  /* Secciones */
  section { padding: 3rem 1rem; }
  .section-title { font-size: 1.6rem; }
  .section-subtitle { font-size: 1rem; margin-bottom: 2rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stat-card { padding: 1.5rem 1rem; }
  .stat-card .icon { font-size: 2rem; }

  /* Steps */
  .steps-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .step { padding: 2rem 1.5rem; }

  /* Impact */
  .impact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .impact-card img { height: 180px; }
  .impact-card-body { padding: 1.2rem; }

  /* CTA */
  .cta-section { padding: 3rem 1rem; }
  .cta-section h2 { font-size: 1.7rem; }
  .cta-section p { font-size: 1rem; }

  /* Formularios */
  .form-section { padding: 5.5rem 1rem 2rem; min-height: auto; }
  .form-card { padding: 1.8rem 1.2rem; border-radius: 16px; }
  .form-card h2 { font-size: 1.4rem; }
  
  .montos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
  }
  .monto-btn {
    padding: .9rem .5rem;
    font-size: .95rem;
    min-height: 48px;
  }

  /* Footer */
  footer { padding: 2.5rem 1rem 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-col { text-align: center; }

  /* Admin */
  .admin-header { padding: 1rem; }
  .admin-header h1 { font-size: 1.1rem; }
  .admin-main { padding: 1rem .5rem; }
  .admin-tabs { gap: 0; }
  .admin-tab { padding: .6rem .8rem; font-size: .8rem; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-stat .value { font-size: 1.3rem; }
  
  /* Tablas en móvil: scroll horizontal */
  .tabla-container { margin-left: -.5rem; margin-right: -.5rem; border-radius: 0; }
  table { font-size: .85rem; }
  th, td { padding: .7rem .5rem; }
}

/* ============================================================
   📱 MÓVIL MUY PEQUEÑO (hasta 400px)
   ============================================================ */
@media (max-width: 400px) {
  .hero h1 { font-size: 1.7rem; }
  .btn { padding: .8rem 1.2rem; font-size: .9rem; }
  .montos-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   💻 TABLET (769px - 1024px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
}