/* ============================================================
   HABICANTÓN — Design System v0.1
   Base de armado y maquetado · SCMDG 2026
   Coherencia de categoría: tuhabi (violeta bold, pills,
   friendly) · inmuebles24 (naranja energía + navy) ·
   vivanuncios (verde confianza). Identidad propia.
   ============================================================ */

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

/* ---------- 1 · TOKENS ---------- */
:root {
  /* Color de marca */
  --hab-primario:        #5B21E0;   /* violeta Habicantón — CTA, links, marca */
  --hab-primario-hover:  #4A18C4;
  --hab-primario-suave:  #EFE9FD;   /* fondos de chip/hover */
  --hab-tinta:           #1A1240;   /* navy-violeta — texto fuerte, footer */
  --hab-acento:          #FF6B35;   /* coral — energía, precio, destacados */
  --hab-acento-suave:    #FFF0EA;
  --hab-exito:           #0FA968;   /* verde — estados positivos, WhatsApp-adjacent */
  --hab-exito-suave:     #E6F7F0;
  --hab-alerta:          #F5A623;
  --hab-alerta-suave:    #FEF5E3;
  --hab-error:           #E5484D;
  --hab-error-suave:     #FDEBEC;
  --hab-info:            #3B82F6;
  --hab-info-suave:      #EAF2FE;
  --hab-whatsapp:        #25D366;

  /* Neutrales (lavanda cálido, nunca gris frío) */
  --hab-fondo:           #F7F5FB;
  --hab-superficie:      #FFFFFF;
  --hab-borde:           rgba(26,18,64,.10);
  --hab-borde-fuerte:    rgba(26,18,64,.18);
  --hab-texto:           #1A1240;
  --hab-texto-2:         rgba(26,18,64,.70);
  --hab-texto-3:         rgba(26,18,64,.45);

  /* Tipografía */
  --hab-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --hab-body:    'Inter', system-ui, sans-serif;

  /* Escala tipográfica */
  --fs-hero: clamp(34px, 5vw, 52px);
  --fs-h1: 34px; --fs-h2: 26px; --fs-h3: 20px; --fs-h4: 16px;
  --fs-body: 15px; --fs-sm: 13px; --fs-xs: 11.5px;

  /* Espaciado (base 4) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Radios */
  --r-card: 16px; --r-input: 12px; --r-pill: 999px; --r-chip: 8px;

  /* Sombras (violáceas suaves) */
  --sombra-1: 0 1px 3px rgba(26,18,64,.06), 0 4px 14px rgba(91,33,224,.06);
  --sombra-2: 0 4px 10px rgba(26,18,64,.08), 0 12px 32px rgba(91,33,224,.10);
  --sombra-cta: 0 6px 18px rgba(91,33,224,.30);
}

/* ---------- 2 · BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--hab-fondo); color: var(--hab-texto);
  font-family: var(--hab-body); font-size: var(--fs-body); line-height: 1.65;
}
h1,h2,h3,h4 { font-family: var(--hab-display); line-height: 1.15; margin: 0 0 var(--sp-3); }
h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.5px; }
h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -.3px; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }
p  { margin: 0 0 var(--sp-4); color: var(--hab-texto-2); }
a  { color: var(--hab-primario); text-decoration: none; }
a:hover { text-decoration: underline; }
.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-5); }
.seccion { padding: var(--sp-7) 0; }
.centrado { text-align: center; }

/* Etiqueta de sección (kicker) */
.kicker {
  display: inline-block; font-family: var(--hab-display); font-weight: 700;
  font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--hab-primario); background: var(--hab-primario-suave);
  padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: var(--sp-4);
}
.kicker--acento { color: var(--hab-acento); background: var(--hab-acento-suave); }

/* ---------- 3 · NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hab-borde);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-5);
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--hab-display); font-weight: 800; font-size: 19px; color: var(--hab-tinta); }
.nav-links { display: flex; gap: var(--sp-4); margin-left: auto; flex-wrap: wrap; }
.nav-links a { font-weight: 600; font-size: var(--fs-sm); color: var(--hab-texto-2); padding: 8px 12px; border-radius: var(--r-pill); }
.nav-links a:hover { color: var(--hab-primario); background: var(--hab-primario-suave); text-decoration: none; }
.nav-links a.activo { color: var(--hab-primario); background: var(--hab-primario-suave); }

/* ---------- 4 · BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--hab-display); font-weight: 700; font-size: 15px;
  padding: 13px 28px; border-radius: var(--r-pill); border: 2px solid transparent;
  cursor: pointer; transition: all .15s ease; text-decoration: none !important;
}
.btn--primario { background: var(--hab-primario); color: #fff; box-shadow: var(--sombra-cta); }
.btn--primario:hover { background: var(--hab-primario-hover); transform: translateY(-1px); }
.btn--acento { background: var(--hab-acento); color: #fff; box-shadow: 0 6px 18px rgba(255,107,53,.30); }
.btn--acento:hover { filter: brightness(.94); transform: translateY(-1px); }
.btn--secundario { background: transparent; color: var(--hab-primario); border-color: var(--hab-primario); }
.btn--secundario:hover { background: var(--hab-primario-suave); }
.btn--fantasma { background: transparent; color: var(--hab-texto-2); }
.btn--fantasma:hover { background: var(--hab-primario-suave); color: var(--hab-primario); }
.btn--whatsapp { background: var(--hab-whatsapp); color: #fff; }
.btn--whatsapp:hover { filter: brightness(.94); }
.btn--sm { padding: 9px 18px; font-size: var(--fs-sm); }
.btn--lg { padding: 16px 36px; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------- 5 · FORMULARIOS ---------- */
.campo { margin-bottom: var(--sp-4); }
.campo label {
  display: block; font-family: var(--hab-display); font-weight: 700;
  font-size: var(--fs-sm); margin-bottom: 6px; color: var(--hab-tinta);
}
.campo .ayuda { font-size: var(--fs-xs); color: var(--hab-texto-3); margin-top: 5px; }
.campo input, .campo select, .campo textarea {
  width: 100%; font-family: var(--hab-body); font-size: 15px;
  padding: 12px 16px; border: 1.5px solid var(--hab-borde-fuerte);
  border-radius: var(--r-input); background: var(--hab-superficie); color: var(--hab-texto);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  border-color: var(--hab-primario); box-shadow: 0 0 0 4px var(--hab-primario-suave);
}
.campo--error input { border-color: var(--hab-error); }
.campo--error .ayuda { color: var(--hab-error); }

/* ---------- 6 · CHIPS DE ESTATUS (pipeline del inmueble) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--hab-display); font-weight: 700; font-size: var(--fs-xs);
  letter-spacing: .02em; padding: 5px 12px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--prospecto    { color: #635E7E; background: rgba(99,94,126,.12); }
.chip--analisis     { color: var(--hab-info); background: var(--hab-info-suave); }
.chip--oferta       { color: var(--hab-primario); background: var(--hab-primario-suave); }
.chip--firma        { color: #fff; background: var(--hab-primario); }
.chip--liquidacion  { color: var(--hab-alerta); background: var(--hab-alerta-suave); }
.chip--remodelacion { color: var(--hab-acento); background: var(--hab-acento-suave); }
.chip--enventa      { color: #fff; background: var(--hab-acento); }
.chip--apartada     { color: #B45309; background: #FEF3C7; }
.chip--tramite      { color: var(--hab-info); background: var(--hab-info-suave); }
.chip--escriturada  { color: var(--hab-exito); background: var(--hab-exito-suave); }
.chip--entregada    { color: #fff; background: var(--hab-exito); }

/* ---------- 7 · TARJETAS ---------- */
.card {
  background: var(--hab-superficie); border: 1px solid var(--hab-borde);
  border-radius: var(--r-card); box-shadow: var(--sombra-1); padding: var(--sp-5);
}
.card--hover { transition: box-shadow .2s, transform .2s; }
.card--hover:hover { box-shadow: var(--sombra-2); transform: translateY(-3px); }

/* Tarjeta de propiedad (ficha catálogo) */
.prop-card { overflow: hidden; padding: 0; }
.prop-card-foto {
  position: relative; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--hab-primario-suave), #DDD1FA);
  display: flex; align-items: center; justify-content: center; color: var(--hab-primario);
}
.prop-card-foto .chip { position: absolute; top: 12px; left: 12px; }
.prop-card-cuerpo { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.prop-precio { font-family: var(--hab-display); font-weight: 800; font-size: 24px; color: var(--hab-tinta); }
.prop-precio small { font-size: var(--fs-sm); font-weight: 600; color: var(--hab-texto-3); }
.prop-dir { font-size: var(--fs-sm); color: var(--hab-texto-2); margin: 4px 0 12px; }
.prop-datos { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--hab-texto-2); border-top: 1px solid var(--hab-borde); padding-top: 12px; }
.prop-datos b { color: var(--hab-tinta); font-weight: 700; }

/* ---------- 8 · KPI / MÉTRICAS ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); }
.kpi { background: var(--hab-superficie); border: 1px solid var(--hab-borde); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-5); }
.kpi .valor { font-family: var(--hab-display); font-weight: 800; font-size: 30px; color: var(--hab-primario); line-height: 1.1; }
.kpi .valor.acento { color: var(--hab-acento); }
.kpi .valor.exito { color: var(--hab-exito); }
.kpi .etiqueta { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hab-texto-3); margin-top: 4px; }

/* ---------- 9 · ALERTAS / AVISOS (portal comprador) ---------- */
.aviso {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--r-input); padding: 14px 18px; margin-bottom: var(--sp-3);
  font-size: var(--fs-sm); border: 1px solid;
}
.aviso b { display: block; font-family: var(--hab-display); margin-bottom: 2px; }
.aviso--info   { background: var(--hab-info-suave);   border-color: rgba(59,130,246,.25);  color: #1D4ED8; }
.aviso--exito  { background: var(--hab-exito-suave);  border-color: rgba(15,169,104,.25);  color: #047857; }
.aviso--alerta { background: var(--hab-alerta-suave); border-color: rgba(245,166,35,.30);  color: #92600A; }
.aviso--error  { background: var(--hab-error-suave);  border-color: rgba(229,72,77,.25);   color: #B3261E; }

/* ---------- 10 · TABLAS ---------- */
.tabla { width: 100%; border-collapse: collapse; background: var(--hab-superficie); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--sombra-1); }
.tabla th {
  font-family: var(--hab-display); font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; text-align: left;
  color: var(--hab-texto-3); background: var(--hab-fondo);
  padding: 12px 18px; border-bottom: 1px solid var(--hab-borde-fuerte);
}
.tabla td { padding: 14px 18px; border-bottom: 1px solid var(--hab-borde); font-size: var(--fs-sm); color: var(--hab-texto-2); }
.tabla tr:last-child td { border-bottom: none; }
.tabla td b { color: var(--hab-tinta); }

/* ---------- 11 · PROCESOS (diagramas de flujo) ---------- */
.flujo { counter-reset: paso; }
.fase {
  display: grid; grid-template-columns: 200px 1fr; gap: var(--sp-5);
  padding: var(--sp-5) 0; border-top: 2px dashed var(--hab-borde-fuerte);
}
.fase:first-child { border-top: none; }
.fase-titulo { position: sticky; top: 90px; align-self: start; }
.fase-titulo .num {
  font-family: var(--hab-display); font-weight: 800; font-size: 13px;
  color: var(--hab-primario); letter-spacing: .12em; text-transform: uppercase;
}
.fase-titulo h3 { margin: 4px 0 6px; }
.fase-titulo .actor { font-size: var(--fs-xs); color: var(--hab-texto-3); font-weight: 600; }
.pasos { display: flex; flex-direction: column; gap: 10px; }
.paso {
  counter-increment: paso; position: relative;
  background: var(--hab-superficie); border: 1px solid var(--hab-borde);
  border-radius: var(--r-input); padding: 14px 18px 14px 58px;
  box-shadow: var(--sombra-1); font-size: var(--fs-sm); color: var(--hab-texto-2);
}
.paso::before {
  content: counter(paso, decimal-leading-zero);
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--hab-display); font-weight: 800; font-size: 13px;
  color: var(--hab-primario); background: var(--hab-primario-suave);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.paso b { color: var(--hab-tinta); }
.paso--decision { border-left: 4px solid var(--hab-alerta); }
.paso--decision::before { color: var(--hab-alerta); background: var(--hab-alerta-suave); }
.paso--hito { border-left: 4px solid var(--hab-exito); }
.paso--hito::before { color: var(--hab-exito); background: var(--hab-exito-suave); }
.paso--auto { border-left: 4px solid var(--hab-info); }
.paso--auto::before { color: var(--hab-info); background: var(--hab-info-suave); }
.paso .tag-sys {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--hab-info); background: var(--hab-info-suave);
  border-radius: var(--r-chip); padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}

/* Cinta de pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pipeline .flecha { color: var(--hab-texto-3); font-weight: 700; }

/* ---------- 12 · TIMELINE DE AVANCES ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--hab-primario-suave); }
.hito { position: relative; padding-bottom: var(--sp-5); }
.hito::before {
  content: ''; position: absolute; left: -26px; top: 5px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--hab-primario); border: 3px solid var(--hab-primario-suave);
}
.hito--done::before { background: var(--hab-exito); border-color: var(--hab-exito-suave); }
.hito--curso::before { background: var(--hab-acento); border-color: var(--hab-acento-suave); }
.hito--pend::before { background: #C9C3DE; border-color: #EEEBF7; }
.hito .fecha { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hab-texto-3); }
.hito h4 { margin: 3px 0 4px; }
.hito p { font-size: var(--fs-sm); margin: 0; }

/* ---------- 13 · FOOTER ---------- */
.footer { background: var(--hab-tinta); color: rgba(255,255,255,.75); padding: var(--sp-6) 0; margin-top: var(--sp-8); }
.footer .contenedor { display: flex; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; font-size: var(--fs-sm); }
.footer b { color: #fff; font-family: var(--hab-display); }
.footer a { color: #C4B5FD; }

/* ---------- 14 · UTILIDADES DS ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); }
.muestra { border: 1px dashed var(--hab-borde-fuerte); border-radius: var(--r-card); padding: var(--sp-5); background: var(--hab-superficie); }
.muestra + pre { margin-top: var(--sp-2); }
pre.codigo {
  background: var(--hab-tinta); color: #E9E4FB; font-size: 12px; line-height: 1.6;
  border-radius: var(--r-input); padding: var(--sp-4); overflow-x: auto;
}
.swatch { border-radius: var(--r-input); overflow: hidden; border: 1px solid var(--hab-borde); background: var(--hab-superficie); }
.swatch .color { height: 72px; }
.swatch .datos { padding: 10px 14px; font-size: var(--fs-xs); }
.swatch .datos b { display: block; font-family: var(--hab-display); font-size: var(--fs-sm); color: var(--hab-tinta); }
.swatch .datos code { color: var(--hab-texto-3); }

@media (max-width: 720px) {
  .fase { grid-template-columns: 1fr; gap: var(--sp-3); }
  .fase-titulo { position: static; }
  .footer .contenedor { flex-direction: column; }
}

@media print {
  .nav, .footer { display: none; }
  body { background: #fff; }
  .card, .paso, .tabla { box-shadow: none; }
  .fase { break-inside: avoid; }
}
