/* ============================================================
   VALORAPARTAMENTO — DESIGN SYSTEM
   Mobile-first · Minimalista · Premium
   ============================================================ */

:root {
	--primary: #0F172A;
	--indigo: #4F46E5;
	--teal: #14B8A6;
	--bg: #F8FAFC;
	--card: #FFFFFF;
	--border: #E2E8F0;
	--text: #020617;
	--text-2: #64748B;
	--success: #10B981;
	--warning: #F59E0B;
	--error: #EF4444;

	--r-card: 24px;
	--r-btn: 16px;
	--r-input: 16px;

	--shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
	--shadow-2: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 32px rgba(15, 23, 42, 0.08);

	--t: 250ms cubic-bezier(0.4, 0, 0.2, 1);
	--font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.va-body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "cv11", "ss01";
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
	overscroll-behavior-y: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.lucide { width: 18px; height: 18px; stroke-width: 2; }

/* ---------- Layout ---------- */
.va-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.va-main {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 20px 16px 110px;
	flex: 1;
}
@media (min-width: 768px) { .va-main { padding: 32px 32px 80px; } }
@media (min-width: 1120px) { .va-main { padding-top: 40px; } }

/* ---------- Tipografía ---------- */
.va-h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.va-h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.va-muted { color: var(--text-2); font-size: 14px; }
.va-pos { color: var(--success); }
.va-neg { color: var(--error); }
.va-grad-text {
	background: linear-gradient(90deg, var(--indigo), var(--teal));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
@media (min-width: 768px) { .va-h1 { font-size: 34px; } }

/* ---------- Header ---------- */
.va-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(248, 250, 252, 0.85);
	backdrop-filter: saturate(180%) blur(16px);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	border-bottom: 1px solid var(--border);
}
.va-header__inner {
	max-width: 1120px; margin: 0 auto;
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding: 14px 16px;
}
@media (min-width: 768px) { .va-header__inner { padding: 16px 32px; } }

.va-brand { display: flex; align-items: center; gap: 12px; text-align: left; }
.va-brand__slogan {
	display: none; font-size: 12px; font-weight: 600; color: var(--text-2);
	letter-spacing: 0.01em; padding-left: 12px; border-left: 1px solid var(--border);
	line-height: 1.35; max-width: 150px;
}
@media (min-width: 1080px) { .va-brand__slogan { display: block; } }
.va-logo__img {
	height: 62px; width: auto; max-width: 320px;
	object-fit: contain; display: block;
}
@media (min-width: 768px) { .va-logo__img { height: 80px; max-width: 420px; } }
.va-brand__texto { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.va-brand__texto b { font-weight: 600; }
.va-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.va-brand__name { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); }
.va-brand__name--light { font-weight: 600; }
.va-brand__dot { color: var(--teal); font-weight: 700; }
.va-brand__tag { font-size: 11px; color: var(--text-2); }
.va-brand__tag b { color: var(--indigo); font-weight: 600; }

.va-nav { display: none; gap: 4px; }
@media (min-width: 900px) { .va-nav { display: flex; } }
.va-nav__link {
	padding: 8px 14px; border-radius: 12px;
	font-size: 14px; font-weight: 600; color: var(--text-2);
	transition: color var(--t), background var(--t);
	text-decoration: none; display: inline-flex; align-items: center;
}
.va-nav__link:hover { color: var(--text); background: rgba(15, 23, 42, 0.05); }
.va-nav__link.is-active { color: var(--indigo); background: rgba(79, 70, 229, 0.08); }

.va-header__cta { display: none; }
@media (min-width: 600px) { .va-header__cta { display: inline-flex; } }

/* ---------- Botones ---------- */
.va-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border-radius: var(--r-btn);
	font-size: 14px; font-weight: 600;
	padding: 10px 18px;
	transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
	user-select: none;
	text-decoration: none;
}
.va-btn:active { transform: scale(0.97); }
.va-btn--primary {
	background: var(--primary); color: #fff;
	box-shadow: var(--shadow-1);
}
.va-btn--primary:hover { background: #1E293B; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.va-btn--ghost { color: var(--text); background: transparent; border: 1px solid var(--border); background: var(--card); }
.va-btn--ghost:hover { border-color: #CBD5E1; box-shadow: var(--shadow-1); transform: translateY(-1px); }
.va-btn--lg { padding: 14px 24px; font-size: 15px; }
.va-btn--xl { padding: 17px 28px; font-size: 16px; width: 100%; border-radius: 18px; }

/* ---------- Cards ---------- */
.va-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	padding: 24px;
	box-shadow: var(--shadow-1);
	transition: transform var(--t), box-shadow var(--t);
}
.va-card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.va-card__head {
	display: flex; align-items: baseline; justify-content: space-between;
	flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
}

/* ---------- Chips / badges ---------- */
.va-chip {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 12px; font-weight: 600;
	padding: 6px 14px; border-radius: 999px;
	background: var(--card); border: 1px solid var(--border);
	color: var(--text-2);
}
.va-chip--live { color: var(--text); }
.va-chip__pulse {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--success);
	animation: va-pulse 2s infinite;
}
@keyframes va-pulse {
	0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
	70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
	100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Vistas ---------- */
.va-view { display: none; animation: va-in 250ms cubic-bezier(0.4, 0, 0.2, 1); }
.va-view.is-active { display: block; }
@keyframes va-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}
.va-view__head { margin-bottom: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Hero ---------- */
.va-hero { padding: 28px 4px 34px; display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; }
.va-hero__title { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.va-noti-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.va-noti-brand__slogan {
	display: none; font-size: 12px; font-weight: 600; color: var(--text-2);
	letter-spacing: 0.01em; padding-left: 12px; border-left: 1px solid var(--border);
	line-height: 1.35; max-width: 150px;
}
@media (min-width: 1080px) { .va-noti-brand__slogan { display: block; } }
.va-hero__fuentes {
	display: flex; flex-wrap: wrap; gap: 8px 10px; padding-top: 4px; justify-content: center;
}
.va-hero__fuentes span {
	display: inline-flex; align-items: center; gap: 7px;
	background: var(--card); border: 1px solid var(--border);
	border-radius: 999px; padding: 8px 14px;
	font-size: 13.5px; font-weight: 600; color: var(--primary);
	box-shadow: var(--sh-1);
}
.va-hero__fuentes svg { width: 15px; height: 15px; color: var(--teal); }
@media (min-width: 768px) {
	.va-hero__fuentes { justify-content: center; gap: 10px 12px; }
	.va-hero__fuentes span { font-size: 14.5px; padding: 9px 16px; }
}
/* Aval de datos — credibilidad del hero */
.va-aval {
	display: flex; align-items: center; gap: 14px;
	background: var(--card); border: 1px solid var(--border);
	border-radius: 20px; padding: 16px 20px; margin-top: 6px;
	box-shadow: var(--sh-1); text-align: left; max-width: 560px; width: 100%;
}
.va-aval__sello {
	flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px;
	display: grid; place-items: center;
	background: rgba(20,184,166,0.10); border: 1px solid rgba(20,184,166,0.22);
}
.va-aval__sello svg { width: 21px; height: 21px; color: var(--teal); }
.va-aval__cuerpo { min-width: 0; }
.va-aval__txt {
	margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); font-weight: 500;
}
.va-aval__txt b { color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; }
.va-aval__fuente {
	margin: 5px 0 0; font-size: 10.5px; font-weight: 700; color: var(--text-2);
	letter-spacing: 0.07em; text-transform: uppercase; opacity: 0.8;
}
@media (min-width: 768px) {
	.va-aval { padding: 18px 24px; margin-top: 10px; }
	.va-aval__txt { font-size: 15.5px; }
}
.va-footer__eslogan {
	font-size: 13px; font-weight: 700; color: var(--teal);
	letter-spacing: 0.07em; text-transform: uppercase; margin: 0 0 4px;
}
.va-hero__eslogan {
	font-size: 14px; font-weight: 700; color: var(--teal);
	letter-spacing: 0.06em; text-transform: uppercase; margin: 0;
}
.va-hero__sub { color: var(--text-2); font-size: 16px; max-width: 560px; }
.va-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 768px) {
	.va-hero { padding: 48px 4px 52px; align-items: center; text-align: center; }
	.va-hero__title { font-size: 54px; }
	.va-hero__sub { font-size: 17px; }
	.va-hero__eslogan { font-size: 15px; }
	.va-hero__actions { justify-content: center; }
}

/* ---------- Stats ---------- */
.va-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 768px) { .va-stat-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.va-stat { display: flex; flex-direction: column; gap: 4px; }
.va-stat__label {
	display: flex; align-items: center; gap: 6px;
	font-size: 12px; font-weight: 600; color: var(--text-2);
	text-transform: uppercase; letter-spacing: 0.04em;
}
.va-stat__label .lucide { width: 14px; height: 14px; color: var(--indigo); }
.va-stat__value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.va-stat__hint { font-size: 12px; color: var(--text-2); }
@media (min-width: 768px) { .va-stat__value { font-size: 26px; } }

.va-market-today { margin-bottom: 22px; }

/* ---------- Features ---------- */
.va-feature-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .va-feature-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.va-feature { display: flex; flex-direction: column; gap: 10px; }
.va-feature h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.va-feature p { font-size: 14px; color: var(--text-2); }
.va-feature__icon {
	width: 44px; height: 44px; border-radius: 14px;
	display: flex; align-items: center; justify-content: center;
}
.va-feature__icon .lucide { width: 22px; height: 22px; color: #fff; }
.va-feature__icon--indigo { background: var(--indigo); }
.va-feature__icon--teal { background: var(--teal); }
.va-feature__icon--dark { background: var(--primary); }

/* ---------- Formulario ---------- */
.va-calc { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
@media (min-width: 900px) {
	.va-calc { max-width: none; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
	.va-calc .va-calc__submit { grid-column: 1 / -1; max-width: 480px; justify-self: center; }
}
.va-form-card { display: flex; flex-direction: column; gap: 16px; }
.va-form-card__title {
	display: flex; align-items: center; gap: 8px;
	font-size: 15px; font-weight: 700;
}
.va-form-card__title .lucide { color: var(--indigo); }

.va-field { display: flex; flex-direction: column; gap: 8px; }
.va-field > label { font-size: 13px; font-weight: 600; color: var(--text); }
.va-opt { color: var(--text-2); font-weight: 500; }
.va-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.va-input, .va-select {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--r-input);
	background: var(--bg);
	padding: 13px 14px;
	font-size: 16px;
	outline: none;
	transition: border-color var(--t), box-shadow var(--t), background var(--t);
	appearance: none;
	-webkit-appearance: none;
}
.va-input:focus, .va-select:focus {
	border-color: var(--indigo);
	background: var(--card);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}
.va-select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 40px;
}

/* Autocompletado de dirección */
.va-autocomplete { position: relative; }
.va-suggest {
	position: absolute; top: calc(100% + 6px); left: 0; right: 0;
	background: var(--card); border: 1px solid var(--border);
	border-radius: 16px; box-shadow: var(--shadow-2);
	z-index: 45; overflow: hidden; max-height: 300px; overflow-y: auto;
}
.va-suggest[hidden] { display: none; }
.va-suggest__item {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
	width: 100%; text-align: left; padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	transition: background var(--t);
}
.va-suggest__item:last-child { border-bottom: none; }
.va-suggest__item:hover { background: var(--bg); }
.va-suggest__item b { font-size: 14px; font-weight: 700; color: var(--text); }
.va-suggest__item span { font-size: 12px; color: var(--text-2); }

/* Stepper */
.va-stepper {
	display: flex; align-items: center; justify-content: space-between;
	border: 1px solid var(--border); border-radius: var(--r-input);
	background: var(--bg); padding: 6px;
}
.va-stepper__btn {
	width: 38px; height: 38px; border-radius: 12px;
	background: var(--card); border: 1px solid var(--border);
	font-size: 18px; font-weight: 600; color: var(--text);
	transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.va-stepper__btn:hover { border-color: var(--indigo); box-shadow: var(--shadow-1); }
.va-stepper__btn:active { transform: scale(0.92); }
.va-stepper__value { font-size: 15px; font-variant-numeric: tabular-nums; }
.va-stepper__value b { font-weight: 700; }

/* Segmento */
.va-segment {
	display: flex; background: var(--bg);
	border: 1px solid var(--border); border-radius: var(--r-input);
	padding: 4px; gap: 4px;
}
.va-segment__opt {
	flex: 1; padding: 9px 12px; border-radius: 12px;
	font-size: 14px; font-weight: 600; color: var(--text-2);
	transition: background var(--t), color var(--t), box-shadow var(--t);
}
.va-segment__opt.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow-1); }

/* Checkbox */
.va-check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.va-check input { position: absolute; opacity: 0; pointer-events: none; }
.va-check__box {
	width: 22px; height: 22px; flex: none;
	border: 1.5px solid var(--border); border-radius: 8px;
	background: var(--bg);
	transition: background var(--t), border-color var(--t);
	position: relative;
}
.va-check input:checked + .va-check__box { background: var(--indigo); border-color: var(--indigo); }
.va-check input:checked + .va-check__box::after {
	content: ""; position: absolute; inset: 0;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* Range */
.va-range { width: 100%; accent-color: var(--teal); height: 32px; }

/* Chips seleccionables */
.va-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.va-chip-toggle {
	padding: 8px 14px; border-radius: 999px;
	border: 1px solid var(--border); background: var(--bg);
	font-size: 13px; font-weight: 600; color: var(--text-2);
	transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
}
.va-chip-toggle:active { transform: scale(0.95); }
.va-chip-toggle.is-active { background: rgba(79, 70, 229, 0.08); border-color: var(--indigo); color: var(--indigo); }

/* ---------- Resultado ---------- */
.va-result { display: flex; flex-direction: column; gap: 16px; }
.va-result-hero {
	border-radius: var(--r-card);
	padding: 32px 24px;
	color: #fff; text-align: center;
	background: linear-gradient(120deg, var(--teal) 0%, var(--indigo) 60%, #4338CA 100%);
	box-shadow: 0 16px 40px rgba(79, 70, 229, 0.25);
	display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.va-result-hero__label { font-size: 13px; font-weight: 600; opacity: 0.9; letter-spacing: 0.02em; }
.va-result-hero__value { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.va-result-hero__range { font-size: 14px; opacity: 0.92; }
.va-result-hero__conf {
	margin-top: 6px;
	display: inline-flex; align-items: center; gap: 6px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 6px 14px; border-radius: 999px;
	font-size: 13px; font-weight: 600;
}
@media (min-width: 768px) { .va-result-hero { padding: 44px 32px; } .va-result-hero__value { font-size: 52px; } }

.va-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 768px) { .va-result-grid { grid-template-columns: repeat(3, 1fr); } }
.va-mini {
	background: var(--card); border: 1px solid var(--border);
	border-radius: 20px; padding: 18px;
	display: flex; flex-direction: column; gap: 4px;
	box-shadow: var(--shadow-1);
}
.va-mini__label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.va-mini__label .lucide { width: 14px; height: 14px; color: var(--teal); }
.va-mini__value { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.va-mini__hint { font-size: 12px; color: var(--text-2); }

/* Análisis IA */
.va-ai {
	border: 1px solid var(--border);
	border-left: 3px solid var(--indigo);
}
.va-ai__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.va-ai__badge {
	width: 34px; height: 34px; border-radius: 12px;
	background: linear-gradient(135deg, var(--indigo), var(--teal));
	display: flex; align-items: center; justify-content: center;
}
.va-ai__badge .lucide { width: 18px; height: 18px; color: #fff; }
.va-ai__title { font-size: 14px; font-weight: 700; }
.va-ai__sub { font-size: 12px; color: var(--text-2); }
.va-ai__text { font-size: 15px; line-height: 1.7; color: var(--text); min-height: 60px; white-space: pre-wrap; }
.va-ai__cursor { display: inline-block; width: 8px; height: 17px; background: var(--indigo); border-radius: 2px; vertical-align: -2px; animation: va-blink 1s steps(2) infinite; }
@keyframes va-blink { 50% { opacity: 0; } }

/* Barras oferta / demanda */
.va-bars { display: flex; flex-direction: column; gap: 14px; }
.va-bar__head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.va-bar__track { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.va-bar__fill { height: 100%; border-radius: 999px; width: 0; transition: width 900ms cubic-bezier(0.4, 0, 0.2, 1); }
.va-bar__fill--indigo { background: var(--indigo); }
.va-bar__fill--teal { background: var(--teal); }

/* Comparables */
.va-comp { display: flex; flex-direction: column; gap: 10px; }
.va-comp__item {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px;
	background: var(--bg);
	transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.va-comp__item:hover { background: var(--card); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.va-comp__info { display: flex; flex-direction: column; }
.va-comp__name { font-size: 14px; font-weight: 700; }
.va-comp__meta { font-size: 12px; color: var(--text-2); }
.va-comp__price { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.va-comp__m2 { font-size: 11px; color: var(--text-2); text-align: right; }

/* Chart */
.va-chart-wrap { width: 100%; overflow: hidden; }
.va-chart-wrap svg { width: 100%; height: auto; }

/* Mapa estilizado */
.va-map {
	position: relative; border-radius: 20px; overflow: hidden;
	border: 1px solid var(--border); background: #EEF2F7; height: 220px;
}
.va-map svg { width: 100%; height: 100%; }
.va-map__pin {
	position: absolute; left: 50%; top: 44%; transform: translate(-50%, -100%);
	display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.va-map__pin-dot {
	width: 16px; height: 16px; border-radius: 50%;
	background: var(--indigo); border: 3px solid #fff;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
	animation: va-pulse 2s infinite;
}
.va-map__pin-label {
	background: var(--primary); color: #fff;
	font-size: 11px; font-weight: 600;
	padding: 4px 10px; border-radius: 999px;
}

.va-result__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Modal de lead ---------- */
.va-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.va-modal[hidden] { display: none; }
@media (min-width: 640px) { .va-modal { align-items: center; padding: 20px; } }
.va-modal__backdrop {
	position: absolute; inset: 0;
	background: rgba(2, 6, 23, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.va-modal__card {
	position: relative;
	background: var(--card);
	border-radius: 24px 24px 0 0;
	padding: 26px 22px calc(24px + env(safe-area-inset-bottom));
	width: 100%; max-width: 480px;
	max-height: 92vh; overflow-y: auto;
	box-shadow: var(--shadow-2);
	display: flex; flex-direction: column; gap: 12px;
	animation: va-up 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 640px) { .va-modal__card { border-radius: 24px; padding: 32px; } }
@keyframes va-up {
	from { transform: translateY(28px); opacity: 0; }
	to { transform: none; opacity: 1; }
}
.va-modal__badge {
	width: 44px; height: 44px; border-radius: 14px;
	background: linear-gradient(135deg, var(--indigo), var(--teal));
	display: flex; align-items: center; justify-content: center;
}
.va-modal__badge .lucide { width: 22px; height: 22px; color: #fff; }
.va-modal__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.va-modal__sub { font-size: 14px; color: var(--text-2); margin-top: -6px; }
#va-lead-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.va-modal__habeas { font-size: 12px; color: var(--text-2); align-items: flex-start; line-height: 1.5; }
.va-modal__habeas .va-check__box { margin-top: 2px; }
.va-modal__error { color: var(--error); font-size: 13px; font-weight: 600; }

/* ---------- Índice ValorApartamento ---------- */
.va-indice__big {
	font-size: 34px; font-weight: 800; letter-spacing: -0.02em;
	background: linear-gradient(90deg, var(--indigo), var(--teal));
	-webkit-background-clip: text; background-clip: text; color: transparent;
	font-variant-numeric: tabular-nums;
}
.va-indice__foot {
	display: flex; justify-content: space-between; align-items: center;
	flex-wrap: wrap; gap: 10px; margin-top: 16px;
	border-top: 1px solid var(--border); padding-top: 16px;
}

/* ---------- Mercado / tablas ---------- */
.va-kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (min-width: 768px) { .va-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .va-kpi-row { grid-template-columns: repeat(6, 1fr); } }

.va-table-card { padding: 8px 0 0; overflow: hidden; }
.va-table-card h2 { padding: 16px 24px 8px; }
.va-table-scroll { overflow-x: auto; }
.va-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 700px; }
.va-table th {
	text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
	color: var(--text-2); font-weight: 600;
	padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.va-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.va-table tbody tr { transition: background var(--t); cursor: pointer; }
.va-table tbody tr:hover { background: var(--bg); }
.va-table tbody tr:last-child td { border-bottom: none; }
.va-table .num { text-align: right; }
.va-table b { font-weight: 700; }

.va-trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.va-trend .lucide { width: 14px; height: 14px; }

/* ---------- Barrios / Edificios ---------- */
.va-grid-cards { display: grid; gap: 14px; }
@media (min-width: 640px) { .va-grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .va-grid-cards { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.va-place { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.va-place__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.va-place__name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.va-place__sub { font-size: 12px; color: var(--text-2); }
.va-place__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.va-place__stat { display: flex; flex-direction: column; }
.va-place__stat span { font-size: 11px; color: var(--text-2); font-weight: 600; }
.va-place__stat b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }

.va-building__photo {
	height: 120px; border-radius: 16px; margin: -8px -8px 4px;
	position: relative; overflow: hidden;
	display: flex; align-items: flex-end; padding: 12px;
}
.va-building__photo .lucide { width: 28px; height: 28px; color: rgba(255, 255, 255, 0.9); }

.va-detail-back {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 14px; font-weight: 600; color: var(--text-2);
	margin-bottom: 16px; padding: 8px 12px; border-radius: 12px;
	transition: background var(--t), color var(--t);
}
.va-detail-back:hover { background: rgba(15, 23, 42, 0.05); color: var(--text); }
.va-detail { display: flex; flex-direction: column; gap: 16px; }
.va-detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 900px) { .va-detail__grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Tab bar móvil ---------- */
.va-tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	display: flex; justify-content: space-around;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: saturate(180%) blur(16px);
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	border-top: 1px solid var(--border);
	padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.va-tabbar__item {
	display: flex; flex-direction: column; align-items: center; gap: 3px;
	font-size: 10px; font-weight: 600; color: var(--text-2);
	padding: 4px 10px; border-radius: 12px;
	transition: color var(--t), transform var(--t);
	flex: 1; max-width: 90px;
}
.va-tabbar__item .lucide { width: 21px; height: 21px; }
.va-tabbar__item.is-active { color: var(--indigo); }
.va-tabbar__item:active { transform: scale(0.92); }
@media (min-width: 900px) { .va-tabbar { display: none; } .va-main { padding-bottom: 60px; } }

/* ---------- Footer ---------- */
.va-footer {
	max-width: 1120px; margin: 0 auto; width: 100%;
	padding: 24px 16px calc(90px + env(safe-area-inset-bottom));
	font-size: 13px; color: var(--text-2);
	display: flex; flex-direction: column; gap: 4px;
	border-top: 1px solid var(--border);
}
.va-footer b { color: var(--text); }
@media (min-width: 900px) { .va-footer { padding-bottom: 32px; padding-left: 32px; padding-right: 32px; } }

/* ---------- Print (reporte e índice) ---------- */
@media print {
	.va-header, .va-tabbar, .va-footer, .va-result__actions, .va-modal, .va-indice__foot .va-btn { display: none !important; }
	.va-main { padding: 0; }
	.va-view { display: none !important; }
	.va-view.is-active { display: block !important; }
	.va-card, .va-mini { box-shadow: none; }
}

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

/* ---------- Input editable dentro del stepper ---------- */
.va-stepper__input {
	width: 68px; border: none; background: transparent;
	font-size: 16px; font-weight: 700; text-align: center;
	font-variant-numeric: tabular-nums; outline: none;
	padding: 2px 0; border-bottom: 1px dashed var(--border);
	-moz-appearance: textfield;
}
.va-stepper__input::-webkit-outer-spin-button,
.va-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.va-stepper__input:focus { border-bottom-color: var(--indigo); }

/* ---------- Pantalla de análisis ---------- */
.va-loading {
	position: fixed; inset: 0; z-index: 110;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	background: rgba(2, 6, 23, 0.6);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.va-loading[hidden] { display: none; }
.va-loading__card {
	background: var(--card); border-radius: var(--r-card);
	padding: 32px 26px; width: 100%; max-width: 420px;
	box-shadow: var(--shadow-2); text-align: center;
	animation: va-up 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.va-loading__ring {
	width: 52px; height: 52px; margin: 0 auto 16px;
	border-radius: 50%;
	border: 3px solid var(--border);
	border-top-color: var(--indigo);
	border-right-color: var(--teal);
	animation: va-spin 900ms linear infinite;
}
@keyframes va-spin { to { transform: rotate(360deg); } }
.va-loading__title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.va-loading__sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.va-loading__steps { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; }
.va-loading__step {
	display: flex; align-items: center; gap: 10px;
	font-size: 13.5px; color: var(--text-2);
	padding: 7px 0; opacity: 0.45;
	transition: opacity var(--t), color var(--t);
}
.va-loading__step.is-active { opacity: 1; color: var(--text); font-weight: 600; }
.va-loading__step.is-done { opacity: 1; color: var(--text-2); font-weight: 500; }
.va-loading__dot {
	width: 16px; height: 16px; flex: none; border-radius: 50%;
	border: 2px solid var(--border); position: relative;
	transition: background var(--t), border-color var(--t);
}
.va-loading__step.is-active .va-loading__dot { border-color: var(--indigo); animation: va-pulse 1.2s infinite; }
.va-loading__step.is-done .va-loading__dot { background: var(--success); border-color: var(--success); }
.va-loading__step.is-done .va-loading__dot::after {
	content: ""; position: absolute; inset: 0;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
@media print { .va-loading { display: none !important; } }

/* Campo principal: el nombre del edificio */
.va-input--principal {
	font-size: 17px; font-weight: 600; padding: 15px 16px;
	border-width: 2px;
}
.va-input--principal::placeholder { font-weight: 400; color: #94A3B8; }

/* Aviso de validación del formulario */
.va-calc__aviso {
	background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C;
	border-radius: 14px; padding: 12px 16px; font-size: 13.5px; font-weight: 600;
}
@media (min-width: 900px) { .va-calc__aviso { grid-column: 1 / -1; } }

/* Desglose del avalúo */
.va-desglose { display: flex; flex-direction: column; }
.va-desglose__fila {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	padding: 14px 0; border-bottom: 1px solid var(--border);
}
.va-desglose__fila:last-child { border-bottom: none; }
.va-desglose__txt { display: flex; flex-direction: column; }
.va-desglose__txt b { font-size: 14px; font-weight: 700; }
.va-desglose__txt span { font-size: 12px; color: var(--text-2); }
.va-desglose__val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.va-desglose__fila--total {
	border-top: 2px solid var(--primary); margin-top: 4px; padding-top: 16px;
}
.va-desglose__fila--total .va-desglose__val { font-size: 19px; color: var(--indigo); }

/* Redes sociales en el pie */
.va-social { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.va-social a {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 13px; font-weight: 600; color: var(--text-2);
	text-decoration: none; padding: 6px 12px;
	border: 1px solid var(--border); border-radius: 999px;
	background: var(--card); transition: color var(--t), border-color var(--t);
}
.va-social a:hover { color: var(--indigo); border-color: var(--indigo); }
.va-social .lucide { width: 15px; height: 15px; }

/* Tarjeta de metodologia y certificacion */
.va-metodo { border-left: 3px solid var(--teal); }
.va-metodo__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.va-metodo__txt { font-size: 14.5px; line-height: 1.7; color: var(--text); margin-bottom: 16px; }
.va-metodo .va-btn { align-self: flex-start; }
@media print { .va-metodo .va-btn { display: none !important; } }

/* ---------- Pruebas de datos en el hero ---------- */
.va-hero__pruebas {
	display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px;
}
.va-hero__pruebas span {
	display: inline-flex; align-items: center; gap: 7px;
	font-size: 13px; font-weight: 600; color: var(--text-2);
}
.va-hero__pruebas .lucide { width: 15px; height: 15px; color: var(--teal); }
@media (min-width: 768px) { .va-hero__pruebas { justify-content: center; gap: 10px 26px; } }

/* ---------- Cómo funciona: 3 pasos ---------- */
.va-pasos { display: grid; gap: 14px; margin-bottom: 22px; }
@media (min-width: 768px) { .va-pasos { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.va-paso {
	background: var(--card); border: 1px solid var(--border);
	border-radius: var(--r-card); padding: 24px;
	box-shadow: var(--shadow-1);
	display: flex; flex-direction: column; gap: 8px;
	position: relative; overflow: hidden;
	transition: transform var(--t), box-shadow var(--t);
}
.va-paso:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.va-paso__num {
	width: 34px; height: 34px; border-radius: 12px;
	background: linear-gradient(135deg, var(--indigo), var(--teal));
	color: #fff; font-size: 16px; font-weight: 800;
	display: flex; align-items: center; justify-content: center;
	margin-bottom: 4px;
}
.va-paso h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.va-paso p { font-size: 14px; line-height: 1.6; color: var(--text-2); }

/* ---------- Cierre de la portada ---------- */
.va-cierre {
	margin-top: 22px; padding: 36px 28px;
	border-radius: var(--r-card); text-align: center;
	background: linear-gradient(120deg, var(--teal) 0%, var(--indigo) 65%, #4338CA 100%);
	color: #fff; box-shadow: 0 16px 40px rgba(79, 70, 229, 0.22);
	display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.va-cierre__titulo { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.va-cierre__txt { font-size: 15px; opacity: 0.92; margin-bottom: 6px; }
.va-cierre .va-btn--primary { background: #fff; color: var(--primary); }
.va-cierre .va-btn--primary:hover { background: #F1F5F9; }
@media (min-width: 768px) { .va-cierre { padding: 46px 32px; } .va-cierre__titulo { font-size: 30px; } }


/* ============================================================
   MÓVIL — pulido para celular (mobile-first real)
   ============================================================ */

@media (max-width: 899px) {

	/* Encabezado compacto: el logo manda, sin robar alto de pantalla */
	.va-header__inner { padding: 10px 14px; }

	/* Nada se sale de la pantalla */
	.va-main { overflow-x: clip; }
	.va-card { padding: 20px 18px; }
	.va-view__head { margin-bottom: 18px; }

	/* Botones grandes, pulsables con el pulgar */
	.va-btn { min-height: 46px; padding: 12px 18px; }
	.va-btn--lg { min-height: 52px; font-size: 15.5px; }
	.va-hero__actions { width: 100%; flex-direction: column; align-items: stretch; }
	.va-hero__actions .va-btn { width: 100%; }

	/* El botón de calcular viaja con el usuario mientras llena el formulario */
	.va-calc__submit {
		position: sticky; z-index: 30;
		bottom: calc(78px + env(safe-area-inset-bottom));
		box-shadow: 0 10px 30px rgba(2, 6, 23, 0.22);
	}

	/* Tab bar con área de toque cómoda */
	.va-tabbar__item { min-height: 52px; justify-content: center; }

	/* Hoja inferior: se siente app nativa */
	.va-modal__card {
		max-height: 90vh; max-height: 90dvh;
		padding-top: 14px;
	}
	.va-modal__card::before {
		content: ''; display: block; width: 42px; height: 4px; border-radius: 999px;
		background: var(--border); margin: 0 auto 8px;
	}
	.va-modal__card .va-btn--xl { position: sticky; bottom: 0; }

	/* Cifras largas nunca rompen la tarjeta */
	.va-desglose__val, .va-result__valor, .va-indice__big { font-variant-numeric: tabular-nums; }
	.va-aval { padding: 15px 16px; }
	.va-aval__txt { font-size: 14px; }
}

@media (max-width: 480px) {
	.va-hero { padding: 20px 2px 28px; gap: 15px; }
	.va-hero__title { font-size: 30px; letter-spacing: -0.03em; }
	.va-hero__fuentes span { font-size: 12.5px; padding: 7px 12px; }
	.va-hero__fuentes svg { width: 14px; height: 14px; }
	.va-logo__img { height: 54px; max-width: 240px; }
	.va-modal__title { font-size: 20px; }
	.va-h1 { font-size: 25px; }
	.va-card { border-radius: 20px; }
}

@media (max-width: 380px) {
	.va-field-row { grid-template-columns: 1fr; }
	.va-hero__title { font-size: 27px; }
	.va-logo__img { height: 48px; max-width: 200px; }
	.va-btn--lg { font-size: 15px; }
}
