/* =================================================================================================
   Anfitrion Pro · sistema de diseño compartido (landing, onboarding y páginas legales)
   Mismos tokens, tipografía, botones y formularios en todo el sitio de marketing.
   Documentado en design-system.md. Ningún color de marca se escribe fuera de este bloque :root.
   ================================================================================================= */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Identidad: verde profundo de bosque chileno + papel cálido + terracota de detalle. */
  --ink: #14211e;
  --ink-soft: #43564f;
  --brand: #0b5f57;
  --brand-deep: #08443e;
  --brand-tint: #e6f0ec;
  --accent: #ab4f29;
  --surface: #faf9f5;
  --surface-2: #f1eee6;
  --surface-3: #e7e2d7;
  --line: #ddd6ca;
  --white: #ffffff;
  --dark: #0f2b27;
  --on-dark: #f4f7f4;
  --on-dark-soft: #cfe0da;
  --ok: #1f6b4a;
  --error: #a52a2a;
  --focus: #0b5f57;

  /* Tipografía: una serif editorial para titulares + una sans humanista para interfaz y textos. */
  --font-display: "Newsreader", ui-serif, Georgia, serif;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala de espaciado 4/8. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 40px;
  --sp-8: 56px;
  --sp-9: 72px;
  --sp-10: 96px;
  --sp-11: 128px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 33, 30, 0.06);
  --shadow-md: 0 8px 24px -12px rgba(20, 33, 30, 0.22);
  --shadow-lg: 0 28px 70px -32px rgba(15, 43, 39, 0.42);

  --max: 1180px;
  --max-wide: 1320px;
  --header-h: 72px;

  color-scheme: light;
  accent-color: var(--brand);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* El atributo hidden siempre gana: sin esto, una clase con display (grid, flex, inline-flex) lo anula. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(11, 95, 87, 0.12);
}

/* Anclas del header sticky: el título no queda debajo del menú al navegar con el teclado. */
section[id],
main[id],
[id="paso-actual"] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

a,
button,
[role="button"],
input,
select,
textarea {
  touch-action: manipulation;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

p {
  margin: 0;
  text-wrap: pretty;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.35rem);
}
h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
}
h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.2;
}

::selection {
  background: var(--brand-tint);
  color: var(--brand-deep);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--brand);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}
.container--wide {
  width: min(100% - 48px, var(--max-wide));
  margin-inline: auto;
}

.section {
  padding-block: clamp(64px, 8vw, 112px);
}
.section--tight {
  padding-block: clamp(40px, 5vw, 64px);
}
.section--tint {
  background: var(--surface-2);
}
.section--dark {
  background: var(--dark);
  color: var(--on-dark);
}
.section--dark h2,
.section--dark h3 {
  color: var(--on-dark);
}

/* ------------------------------------------------------------------------------------------------
   Encabezados de sección. El «eyebrow» se usa solo en tres momentos de la página (regla del sistema).
   ------------------------------------------------------------------------------------------------ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--accent);
}

.section-head {
  max-width: 720px;
}
.section-head p {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 1.06rem;
  line-height: 1.65;
  max-width: 62ch;
}
.section-head .eyebrow,
.examples-grid .eyebrow,
.calc-copy .eyebrow {
  color: var(--accent);
}
.section--dark .section-head p {
  color: var(--on-dark-soft);
}

.lead {
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
  line-height: 1.65;
  max-width: 60ch;
}

/* ------------------------------------------------------------------------------------------------
   Botones: una sola forma (pill) y un solo acento de conversión (verde de marca).
   ------------------------------------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--white);
  --btn-border: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--btn-border);
  border-radius: var(--pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
}
.btn:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--ink-soft);
}
.btn--on-dark {
  --btn-bg: var(--white);
  --btn-fg: var(--dark);
  --btn-border: var(--white);
}
.btn--on-dark:hover {
  background: var(--surface-2);
  border-color: var(--surface-2);
}
.btn--text {
  --btn-bg: transparent;
  --btn-fg: var(--brand);
  --btn-border: transparent;
  min-height: 44px;
  padding: 8px 6px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn--text:hover {
  background: transparent;
  color: var(--brand-deep);
}
.btn--sm {
  min-height: 44px;
  padding: 9px 18px;
  font-size: 0.88rem;
}
.btn--block {
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.micro {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------------------------------------
   Formularios. Etiqueta arriba, ayuda persistente, error debajo del campo y foco visible.
   ------------------------------------------------------------------------------------------------ */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.field > label,
.field > .label {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.field .why {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}
.textarea {
  min-height: 116px;
  resize: vertical;
}
.input::placeholder,
.textarea::placeholder {
  color: #5d6d67;
  opacity: 1;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  outline: 3px solid var(--brand-tint);
  outline-offset: 0;
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--error);
}
.hint {
  color: var(--ink-soft);
  font-size: 0.79rem;
  line-height: 1.4;
}
.hint.ok {
  color: var(--ok);
  font-weight: 600;
}
.hint.bad,
.field-error {
  color: var(--error);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.4;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}
.check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .prefix,
.input-group .suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 0.86rem;
  white-space: nowrap;
}
.input-group .prefix {
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .suffix {
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-group .input {
  border-radius: 0;
  min-width: 0;
}
.input-group .prefix + .input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group .input:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------------------------------------
   Superficies y piezas reutilizables.
   ------------------------------------------------------------------------------------------------ */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card--flat {
  box-shadow: none;
}
.card--pad {
  padding: clamp(20px, 3vw, 32px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--accent {
  background: #f6e7df;
  color: var(--accent);
}

.note {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 14px 16px;
  font-size: 0.84rem;
  line-height: 1.55;
}
.note strong {
  color: var(--ink);
}

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

/* Acordeón nativo, accesible por teclado. */
.accordion {
  border-top: 1px solid var(--line);
}
.accordion details {
  border-bottom: 1px solid var(--line);
}
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 18px 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker {
  display: none;
}
.accordion summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
}
.accordion details[open] summary::after {
  content: "–";
}
.accordion .answer {
  padding: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.65;
  max-width: 72ch;
}

/* Estadísticas y tablas comparativas. */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare th,
.compare td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th {
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compare td.num,
.compare th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Aviso de estado para aria-live. */
.status {
  min-height: 1.2em;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.status[data-tone="ok"] {
  color: var(--ok);
}
.status[data-tone="bad"] {
  color: var(--error);
}

/* ------------------------------------------------------------------------------------------------
   Movimiento: solo transform/opacity, con salida elegante y respeto por reduced motion.
   ------------------------------------------------------------------------------------------------ */
.reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1), transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .container,
  .container--wide {
    width: min(100% - 32px, var(--max));
  }
  .actions .btn {
    width: 100%;
  }
  .actions .btn--text {
    width: auto;
  }
}

/* ------------------------------------------------------------------------------------------------
   Lockup de marca con el logotipo real (ícono + wordmark). Compartido por la landing y el asistente:
   los colores son los del archivo original, no tokens, para que no cambien con el tema de la página.
   ------------------------------------------------------------------------------------------------ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #036773;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.hf-brand__mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}
.hf-brand__text {
  font-size: clamp(1.06rem, 2.4vw, 1.34rem);
  line-height: 1;
}
.hf-brand__text em {
  color: #c0a062;
  font-style: normal;
  font-weight: 800;
}
.hf-brand--footer {
  align-items: flex-start;
}
.hf-brand__full {
  width: 168px;
  height: auto;
}
