/* JH-ARQ · Cuestionario de cliente (hola.jh-arq.com) */
:root {
  --ink: #181818;
  --paper: #ffffff;
  --stone: #D5D5CD;
  --stone-soft: rgba(213, 213, 205, 0.35);
  --line: #C7C7C7;
  --muted: #6b6b66;
  --error: #a63d2f;

  --font-head: "Poppins", "Avenir Next", "Avenir", sans-serif;
  --font-body: "Avenir Next", "Avenir", "Nunito Sans", sans-serif;

  --wrap: 720px;
  --gutter: 16px;
  --ease: 180ms ease;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--muted); }

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

[hidden] { display: none !important; }

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

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; z-index: 50; text-decoration: none;
  font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.skip:focus { top: 8px; color: var(--paper); }

/* ---------- Header ---------- */
.top {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo { display: inline-flex; line-height: 0; }
.logo img { height: 36px; width: auto; display: block; }

.progress { flex: 1; max-width: 260px; text-align: right; }
.progress-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress-track { height: 1px; background: var(--line); position: relative; overflow: hidden; }
.progress-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0; background: var(--ink);
  transition: width 320ms ease;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 56px var(--gutter) 96px;
  outline: none;
}

.screen { animation: fade 260ms ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  margin: 0 0 20px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3, .title, .title-xl {
  font-family: var(--font-head);
  font-weight: 200;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin: 0;
}
.title-xl { font-size: clamp(2.1rem, 6vw, 3rem); margin-bottom: 24px; }
.title { font-size: clamp(1.7rem, 4.6vw, 2.2rem); margin-bottom: 10px; outline: none; }
.title-xl:focus, .title:focus { outline: none; }

.lead { font-size: 1.08rem; color: var(--muted); max-width: 34em; margin: 0 0 40px; }
.intro { color: var(--muted); margin: 0 0 8px; }

.step-head { margin-bottom: 36px; }

/* ---------- Questions ---------- */
.q { margin: 0 0 40px; padding: 0; border: 0; min-width: 0; }
.q-label, .q legend {
  display: block;
  padding: 0;
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.req { color: var(--muted); margin-left: 2px; }
.help { margin: -6px 0 14px; font-size: 0.88rem; color: var(--muted); }

.field { position: relative; display: flex; align-items: baseline; gap: 10px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  width: 100%;
  font: inherit;
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 0 10px;
  transition: border-color var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
input[type="number"] { max-width: 200px; -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #a3a39c; opacity: 1; }

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus,
input[type="number"]:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-bottom-color: var(--error); }

.unit { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }

/* Pills / tiles */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opt label {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.opt label:hover { border-color: var(--ink); background: var(--stone-soft); }
.opt input:checked + label { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.opt input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 3px; }
.opt input[type="checkbox"] + label::before {
  content: "";
  width: 9px; height: 9px;
  margin-right: 10px;
  border: 1px solid currentColor;
  flex: none;
  opacity: 0.6;
}
.opt input[type="checkbox"]:checked + label::before { background: currentColor; opacity: 1; }
.q[data-invalid="true"] .opt label { border-color: var(--error); }

.other-input { margin-top: 12px; max-width: 420px; }

.err {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 0.88rem;
}
.err:empty { display: none; }

/* Files */
.file-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 18px;
  border: 1px dashed var(--line);
  background: var(--stone-soft);
}
.file-drop.is-over { border-color: var(--ink); }
.file-drop .hint { color: var(--muted); font-size: 0.88rem; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-size { color: var(--muted); margin-left: 8px; }
.file-remove {
  flex: none;
  background: none; border: 0; padding: 4px 0;
  font: inherit; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.file-remove:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.actions-start { justify-content: flex-start; border-top: 0; padding-top: 0; margin-top: 0; }
#btn-next { margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--ease), color var(--ease), opacity var(--ease);
}
.btn:hover { background: #333; border-color: #333; color: var(--paper); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--stone-soft); color: var(--ink); border-color: var(--ink); }

.link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px;
}
.link-btn:hover { color: var(--muted); }

/* ---------- Review ---------- */
.review-section { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.review-head h3 { font-size: 1.3rem; font-weight: 300; }
.review-list { margin: 0; }
.review-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 20px; padding: 8px 0; }
.review-row dt { color: var(--muted); font-size: 0.92rem; }
.review-row dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.review-empty { color: var(--muted); font-size: 0.92rem; margin: 0; }

.form-error {
  margin-top: 32px;
  padding: 16px 18px;
  border-left: 2px solid var(--error);
  background: rgba(166, 61, 47, 0.06);
  color: var(--ink);
}
.form-error p { margin: 0 0 12px; }

.notice { padding: 16px; background: var(--stone-soft); }

/* ---------- Estimate ---------- */
.estimate-card {
  position: fixed;
  z-index: 20;
  left: 0; right: 0; bottom: 0;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 260ms ease both;
}
.estimate-kicker {
  margin: 0 0 2px;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.estimate-text { margin: 0; font-size: 0.95rem; line-height: 1.4; }
.estimate-text strong { font-family: var(--font-head); font-weight: 300; letter-spacing: 0.02em; }
body.has-estimate .wrap { padding-bottom: 150px; }
body.has-estimate .foot { padding-bottom: 110px; }

@media (min-width: 1180px) {
  .estimate-card {
    left: auto; right: 32px; bottom: auto; top: 140px;
    width: 220px;
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--paper);
  }
  .estimate-text { font-size: 1rem; }
  body.has-estimate .wrap { padding-bottom: 96px; }
  body.has-estimate .foot { padding-bottom: 32px; }
}

.estimate-detail { margin-top: 40px; }
.estimate-detail h3 { font-size: 1.3rem; font-weight: 300; margin-bottom: 6px; }
.estimate-detail .note { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; }
.estimate-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.estimate-table caption { text-align: left; }
.estimate-table th, .estimate-table td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.estimate-table th { font-weight: 400; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.estimate-table .num { text-align: right; white-space: nowrap; padding-left: 16px; }
.estimate-table .tag { color: var(--muted); font-size: 0.82rem; margin-left: 6px; }
.estimate-table tfoot td { border-bottom: 0; border-top: 1px solid var(--line); font-weight: 400; }
.estimate-table tfoot tr:first-child td { border-top-color: var(--ink); }
.estimate-table tbody tr.sub td { color: var(--muted); }

.back-link { margin-top: 48px; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- Footer ---------- */
.foot {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.foot a { color: var(--muted); }

@media (max-width: 520px) {
  .top { padding-top: 18px; gap: 16px; }
  .progress { max-width: 150px; }
  .wrap { padding-top: 40px; }
  .review-row { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 auto; }
  #btn-next { margin-left: 0; }
  .opt label { padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
