/* ============================================================
   MiComunidadApp — Main Stylesheet
   Color Principal: #1565C0
   ============================================================ */

:root {
  --primary:       #1565C0;
  --primary-dark:  #0D47A1;
  --primary-light: #1976D2;
  --accent:        #42A5F5;
  --bg-light:      #F0F4FF;
  --bg-white:      #FFFFFF;
  --text-dark:     #1A2340;
  --text-mid:      #4A5568;
  --text-light:    #718096;
  --border:        #E2E8F0;
  --shadow:        0 4px 24px rgba(21,101,192,0.10);
  --shadow-hover:  0 8px 40px rgba(21,101,192,0.18);
  --radius:        16px;
  --radius-sm:     10px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-white {
  background: #fff;
  color: var(--primary);
}
.btn-white:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
}

/* ── Navbar ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: var(--shadow); }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.navbar-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.navbar-links a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: color .2s;
}
.navbar-links a:hover { color: var(--primary); }

.navbar-cta { display: flex; gap: 12px; align-items: center; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: all .3s;
  border-radius: 2px;
}

/* ── Section titles ── */
.section-label {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto;
}
.text-center { text-align: center; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #EBF3FF 0%, #F0F4FF 50%, #E8F0FE 100%);
  padding: 96px 0 80px;
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(21,101,192,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px 6px 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 8px; height: 8px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity:1; transform:scale(1); }
  50%       { opacity:.6; transform:scale(1.4); }
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-title span { color: var(--primary); }

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-mid);
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}
.stat span { font-size: .85rem; color: var(--text-light); }

/* Phone mockup */
.hero-visual { display: flex; justify-content: center; align-items: center; }

.phone-mockup {
  position: relative;
  width: 280px;
}
.phone-frame {
  background: #fff;
  border-radius: 44px;
  border: 8px solid #1A2340;
  box-shadow: 0 40px 80px rgba(21,101,192,0.25), 0 0 0 1px rgba(0,0,0,0.06);
  overflow: hidden;
  aspect-ratio: 9/19;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 28px;
  background: #1A2340;
  border-radius: 0 0 20px 20px;
  z-index: 2;
}
.phone-screen {
  background: #F0F2F5;
  height: 100%;
  padding: 40px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phone-header {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: .75rem;
}
.phone-header .greeting { color: #888; font-size: .65rem; }
.phone-header .name { font-weight: 700; color: var(--text-dark); font-size: .8rem; }

.phone-banner {
  background: var(--primary);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-size: .75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.phone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}
.phone-card {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  font-size: .65rem;
  color: var(--text-mid);
}
.phone-card .count {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 2px;
}

.phone-float {
  position: absolute;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: .75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.phone-float.float-1 { right: -40px; top: 20%; }
.phone-float.float-2 { left: -50px; top: 55%; }
.phone-float .fi { font-size: 1.1rem; }

/* ── Mockup duo (imágenes de marketing reales) ── */
.mockup-duo {
  position: relative;
  width: 420px;
  height: 520px;
  flex-shrink: 0;
}

.mockup-img {
  position: absolute;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(21,101,192,0.22), 0 8px 24px rgba(0,0,0,0.10);
  transition: transform .4s ease, box-shadow .4s ease;
}
.mockup-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Imagen principal: más grande, adelante */
.mockup-img--front {
  width: 240px;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-radius: 32px;
}
.mockup-img--front:hover {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: 0 48px 96px rgba(21,101,192,0.28);
}

/* Imagen secundaria: más pequeña, girada, detrás */
.mockup-img--back {
  width: 220px;
  top: 0;
  right: 0;
  z-index: 1;
  transform: rotate(3deg);
  border-radius: 28px;
}
.mockup-img--back:hover {
  transform: rotate(1deg) translateY(-6px);
  box-shadow: 0 40px 80px rgba(21,101,192,0.22);
}

/* Si solo hay una imagen, centrarla */
.mockup-single {
  width: 260px;
  height: auto;
}
.mockup-single .mockup-img--front {
  position: relative;
  width: 100%;
  bottom: auto;
  left: auto;
}

@media (max-width: 768px) {
  .mockup-duo {
    width: 280px;
    height: 360px;
    margin: 0 auto;
  }
  .mockup-img--front { width: 168px; }
  .mockup-img--back  { width: 154px; }
}

/* ── Features ── */
.features {
  padding: 96px 0;
  background: var(--bg-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
}

.feature-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.feature-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 56px; height: 56px;
  background: var(--bg-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  transition: background .3s;
}
.feature-card:hover .feature-icon { background: var(--primary); }
.feature-card:hover .feature-icon svg { color: #fff; }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
}
.feature-card p {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ── How it works ── */
.how-it-works {
  padding: 96px 0;
  background: linear-gradient(180deg, #F0F4FF 0%, #EBF3FF 100%);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 64px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  z-index: 0;
}

.step {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 72px; height: 72px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(21,101,192,0.35);
  border: 4px solid #fff;
  transition: transform .3s;
}
.step:hover .step-number { transform: scale(1.1); }

.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
}
.step p {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ── CTA Banner ── */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.cta-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 250px; height: 250px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.cta-section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  position: relative; z-index: 1;
}
.cta-section p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.82);
  margin-bottom: 36px;
  position: relative; z-index: 1;
}
.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}

/* Store badges */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--text-dark);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.store-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.store-badge svg { font-size: 1.5rem; }
.store-badge small { display: block; font-size: .7rem; font-weight: 400; color: var(--text-light); }
.store-badge strong { display: block; font-size: .95rem; }

/* ── Footer ── */
.site-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.72);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 32px;
}

.footer-brand .logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand .logo-icon-sm {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
}
.footer-brand p {
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 20px;
}
.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  color: #fff;
  font-size: .9rem;
}
.social-links a:hover { background: var(--primary); }

.footer-col h4 {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  font-size: .9rem;
  color: rgba(255,255,255,0.6);
  transition: color .2s;
}
.footer-col ul a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }

/* ── Mobile Nav ── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.mobile-menu.open { display: block; opacity: 1; pointer-events: all; }
.mobile-menu-panel {
  position: absolute;
  top: 0; right: 0;
  width: 280px; height: 100%;
  background: #fff;
  padding: 24px;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-close {
  width: 36px; height: 36px;
  background: var(--bg-light);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 24px;
  font-size: 1.1rem;
}
.mobile-menu-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-links a {
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--text-dark);
  transition: background .2s;
}
.mobile-menu-links a:hover { background: var(--bg-light); color: var(--primary); }
.mobile-cta { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.mobile-cta .btn { justify-content: center; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar-links, .navbar-cta { display: none; }
  .hamburger { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { order: -1; }
  .phone-float { display: none; }
  .phone-mockup { width: 220px; }

  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero { padding: 60px 0; }
  .hero-title { font-size: 1.9rem; }
  .btn { padding: 12px 24px; font-size: .9rem; }
}

/* ── Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
