/* =====================================================
   RESET BÁSICO
   ===================================================== */
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body{
  height: 100%;
}

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  background: #f6f7fb;
  line-height: 1.5;
}

/* =====================================================
   VARIABLES
   ===================================================== */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;

  --primary:#111827;
  --primary2:#0b1220;

  --radius:18px;
  --shadow:0 18px 40px rgba(15,23,42,.10);
  --shadow2:0 10px 22px rgba(15,23,42,.08);
}

/* =====================================================
   LAYOUT GENERAL
   ===================================================== */
.container{
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

/* =====================================================
   FONDO HOME (IMÁGENES)
   ===================================================== */
body.home-bg{
  background-image: url("../img/fondoprincipales.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Overlay */
body.home-bg::before{
  content:"";
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.65);
  z-index: -1;
}

/* Móvil */
@media (max-width: 768px){
  body.home-bg{
    background-image: url("../img/fondoprincipalesv.png");
    background-attachment: scroll;
  }
}

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247,248,251,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.navbar .inner{
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand b{
  font-weight: 800;
  letter-spacing: -.4px;
}

.brand .sub{
  font-size: 12px;
  color: var(--muted);
}

.links{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link{
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid transparent;
}

.link:hover,
.link.active{
  background: #fff;
  border-color: var(--line);
}

.userpill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.avatar{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* =====================================================
   TIPOGRAFÍA
   ===================================================== */
.h1{
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -.6px;
  margin-bottom: 10px;
}

.h2{
  font-size: 18px;
  margin-bottom: 6px;
  letter-spacing: -.2px;
}

.p{
  font-size: 15px;
}

.muted{
  color: var(--muted);
}

.hr{
  border: none;
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

/* =====================================================
   BOTONES
   ===================================================== */
.btn{
  display: inline-block;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--primary), var(--primary2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow2);
}

.btn:hover{
  opacity: .92;
}

.btn-ghost{
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(15,23,42,.03);
  border: 1px solid var(--line);
  color: var(--muted);
}

.badge .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg,#2563eb,#22c55e);
}

/* =====================================================
   CARDS
   ===================================================== */
.card{
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* =====================================================
   HERO
   ===================================================== */
.hero{
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
}

@media (max-width: 900px){
  .hero{
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   HERO BOX / VISUAL
   ===================================================== */
.heroBox{
  background: linear-gradient(
    135deg,
    rgba(37,99,235,.08),
    rgba(34,197,94,.08)
  );
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
}

.heroVisual{
  display: flex;
  justify-content: center;
  align-items: center;
}

.heroVisual img{
  max-width: 260px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.15);
}

@media (max-width: 768px){
  .heroVisual img{
    max-width: 200px;
  }
}

/* =====================================================
   FEATURES / GRID
   ===================================================== */
.grid3{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px){
  .grid3{
    grid-template-columns: 1fr;
  }
}

.feature{
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: var(--shadow2);
}

.feature small{
  color: var(--muted);
}

/* =====================================================
   UTILIDADES
   ===================================================== */
.text-center{ text-align: center; }
.mt-10{ margin-top: 10px; }
.mt-20{ margin-top: 20px; }

/* =====================================================
   RESPONSIVE AJUSTES
   ===================================================== */
@media (max-width: 520px){
  .brand .sub{ display:none; }
  .userpill span.name{ display:none; }
}
/* =====================================================
   NAV RESPONSIVO (MÓVIL)
   ===================================================== */

.navToggle{
  display:none;
  background:none;
  border:none;
  font-size:22px;
  cursor:pointer;
}

/* Escritorio */
@media (min-width: 769px){
  .links{
    display:flex !important;
  }
}

/* Celulares */
@media (max-width: 768px){

  .navToggle{
    display:block;
  }

  .links{
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 10px 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.12);
  }

  .links.open{
    display:flex;
  }

  .link{
    width: 100%;
    padding: 12px;
    border-radius: 12px;
  }

  .userpill{
    width: 100%;
    justify-content: flex-start;
    margin: 6px 0;
  }

  /* HERO EN CELULAR */
  .hero{
    grid-template-columns: 1fr;
  }

  .heroBox{
    margin-top: 12px;
  }

  .heroVisual img{
    max-width: 180px;
  }

  /* TEXTO MÁS LEGIBLE */
  .h1{
    font-size: 26px;
  }

  .container{
    padding: 18px 14px 30px;
  }
}
