/**
 * Dealforge — Componentes: botones, filtros, tarjetas, estimador, tecnologías, pasos, compromisos y formulario.
 */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.65rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn--primary {
  background: var(--pine-600);
  color: var(--white);
  box-shadow: 0 10px 22px -12px rgba(20, 81, 63, 0.8);
}

.btn--primary:hover {
  background: var(--pine-700);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--pine-600);
  color: var(--pine-700);
}

.btn--ghost:hover {
  background: var(--pine-100);
}

.btn--outline {
  background: var(--white);
  border-color: var(--line);
  color: var(--pine-700);
  font-size: 0.82rem;
}

.btn--outline:hover {
  background: var(--pine-600);
  border-color: var(--pine-600);
  color: var(--white);
}

.btn--lg {
  min-height: 52px;
  padding-inline: 1.7rem;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.link {
  color: var(--pine-700);
  font-weight: 600;
}

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--pine-500);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--pine-600);
  border-color: var(--pine-600);
  color: var(--white);
}

/* ---------- Tarjetas ---------- */
.cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .cards,
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--pine-300);
  box-shadow: var(--shadow-card);
}

.card[hidden] {
  display: none;
}

.service {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
}

.service__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.service__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
}

.service__icon .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.service__icon--pine {
  background: var(--pine-100);
  color: var(--pine-700);
}

.service__icon--stone {
  background: var(--stone-200);
  color: var(--graphite-900);
}

.tag {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-100);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}

.service__title {
  margin-bottom: var(--space-2);
  font-size: 1.2rem;
  font-weight: 700;
}

.service__text {
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
  color: var(--muted);
}

.checklist {
  display: grid;
  flex: 1;
  align-content: start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  font-size: 0.84rem;
  color: var(--muted);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.checklist .icon {
  margin-top: 0.15rem;
  color: var(--pine-700);
}

.checklist strong {
  color: var(--ink);
}

/* ---------- Panel genérico ---------- */
.panel {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-card);
}

.panel__title {
  margin-bottom: var(--space-1);
  font-size: 1.25rem;
  font-weight: 700;
}

.panel__lead {
  margin-bottom: var(--space-5);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Estimador ---------- */
.calc {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 960px) {
  .calc {
    grid-template-columns: 7fr 5fr;
  }
}

.calc__controls {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.field-group {
  border: 0;
  min-width: 0;
}

.label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.options {
  display: grid;
  gap: var(--space-3);
}

.options--3 {
  grid-template-columns: repeat(3, 1fr);
}

.options--2 {
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .options--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.option {
  position: relative;
  display: block;
}

.option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.option__box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 4.25rem;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-50);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.option--check .option__box {
  flex-direction: row;
  justify-content: flex-start;
  padding-left: 2.6rem;
  text-align: left;
}

.option--check .option__box::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--pine-300);
  border-radius: 4px;
  background: var(--white);
}

.option input:checked + .option__box {
  border-color: var(--pine-600);
  background: var(--pine-100);
  color: var(--pine-700);
}

.option--check input:checked + .option__box::before {
  border-color: var(--pine-600);
  background: var(--pine-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.8' fill='none' stroke='%23F6F7F6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}

.option input:focus-visible + .option__box {
  outline: 2px solid var(--paper-50);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--pine-700);
}

.option input:focus-visible {
  box-shadow: none;
  outline: none;
}

.range__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.range__value {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--pine-700);
}

.range {
  width: 100%;
  height: 2.25rem;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: var(--paper-200);
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--paper-200);
}

.range::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--pine-600);
  box-shadow: var(--shadow-soft);
  -webkit-appearance: none;
  appearance: none;
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--pine-600);
}

.range__scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--faint);
}

.calc__result {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--graphite-900);
  border-radius: var(--radius-lg);
  color: var(--paper-50);
}

.result__badge {
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--stone-400);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--stone-200);
}

.result__list {
  display: grid;
  gap: var(--space-4);
}

.result__list dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--pine-300);
}

.result__big {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--paper-50);
}

.result__mid {
  font-size: 1.1rem;
  font-weight: 700;
}

.result__mid--stone {
  color: var(--stone-200);
}

.result__small {
  font-size: 0.85rem;
  color: var(--paper-200);
}

.result__legal {
  padding-top: var(--space-3);
  border-top: 1px solid var(--graphite-800);
  font-size: 0.72rem;
  color: var(--paper-200);
}

.calc__result .btn--primary {
  background: var(--pine-300);
  color: var(--graphite-900);
  box-shadow: none;
}

.calc__result .btn--primary:hover {
  background: var(--paper-50);
}

/* ---------- Tecnologías ---------- */
.stack {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 720px) {
  .stack {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .stack {
    grid-template-columns: repeat(6, 1fr);
  }

  .stack__group {
    grid-column: span 2;
  }

  .stack__group:nth-child(4) {
    grid-column: span 4;
  }

  .stack__group:not(:nth-child(4)) .techs {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack__group:nth-child(4) .techs {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stack__group {
  padding: var(--space-5);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.stack__title {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine-700);
}

.techs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
  gap: var(--space-3);
}

.tech {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 5.6rem;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-md);
  background: var(--paper-50);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.tech:hover {
  border-color: var(--brand, var(--pine-300));
  transform: translateY(-2px);
}

.tech__logo {
  width: 1.9rem;
  height: 1.9rem;
  fill: var(--pine-700);
  transition: fill 0.2s;
}

.tech:hover .tech__logo {
  fill: var(--brand, var(--pine-700));
}

.tech__name {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

/* ---------- Metodología (sobre banda oscura) ---------- */
.steps {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step {
  padding: var(--space-5);
  background: var(--graphite-800);
  border: 1px solid rgba(246, 247, 246, 0.14);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  color: var(--paper-200);
}

.step__num {
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--pine-300);
}

.step--accent .step__num {
  color: var(--stone-400);
}

.step__title {
  margin-bottom: var(--space-2);
  font-size: 1.05rem;
  color: var(--paper-50);
}

/* ---------- Compromisos ---------- */
.pledge {
  padding: var(--space-5);
  font-size: 0.875rem;
  color: var(--muted);
}

.pledge__icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
}

.pledge__icon--pine {
  background: var(--pine-100);
  color: var(--pine-700);
}

.pledge__icon--stone {
  background: var(--stone-200);
  color: var(--graphite-900);
}

.pledge__title {
  margin-bottom: var(--space-2);
  font-size: 1.1rem;
  color: var(--ink);
}

.pledge__list {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.pledge__list li::before {
  content: "• ";
  color: var(--graphite-900);
}

/* ---------- Formulario ---------- */
.form {
  display: grid;
  gap: var(--space-4);
}

.form__row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-50);
  font-size: 0.95rem;
}

textarea.input {
  resize: vertical;
}

.input::placeholder {
  color: var(--faint);
}

.input:hover {
  border-color: var(--pine-300);
}

.input[aria-invalid="true"] {
  border-color: var(--graphite-900);
}

.field__error {
  margin-top: var(--space-1);
  font-size: 0.8rem;
  color: var(--graphite-900);
}

.field--trap {
  position: absolute;
  left: -9999px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.85rem;
  color: var(--muted);
}

.check input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: var(--pine-600);
}

.form__status {
  min-height: 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.form__status--ok,
.form__status--error {
  padding: var(--space-4);
}

.form__status--ok {
  border: 1px solid var(--pine-500);
  background: var(--pine-100);
  color: var(--pine-700);
}

.form__status--error {
  border: 1px solid var(--graphite-900);
  background: var(--paper-100);
  color: var(--graphite-900);
}

/* ---------- Página de texto (privacidad, 404) ---------- */
.doc {
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--space-7) clamp(1rem, 4vw, 2rem) var(--space-8);
}

.doc h1 {
  margin-bottom: var(--space-4);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.doc h2 {
  margin-block: var(--space-6) var(--space-2);
  font-size: 1.25rem;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc ul {
  display: grid;
  gap: var(--space-2);
  margin-block: var(--space-3);
  padding-left: var(--space-5);
  list-style: disc;
}

.doc__draft {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--stone-400);
  border-radius: var(--radius-md);
  background: var(--stone-200);
  font-size: 0.85rem;
  color: var(--ink);
}
