/* ================================================================
   Tasador de Propiedades – El Arenal
   ================================================================ */

.tar-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,.10);
  padding: 2.5rem 2rem 2rem;
  position: relative;
}

/* ── Pasos ─────────────────────────────────────────── */
.tar-step { display: none; }
.tar-step.active { display: block; }

.tar-step-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 1.6rem;
  padding-bottom: .7rem;
  border-bottom: 3px solid #e6323a;
}

/* ── Selector tipo de propiedad ───────────────────── */
.tar-tipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tar-tipo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  color: #333;
  transition: all .18s ease;
}
.tar-tipo-btn:hover { border-color: #e6323a; background: #fff5f5; }
.tar-tipo-btn.selected {
  border-color: #e6323a;
  background: #e6323a;
  color: #fff;
}
.tar-tipo-icon { font-size: 2.2rem; }

/* ── Region tabs ──────────────────────────────────── */
.tar-region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.2rem;
}
.tar-region-tab {
  padding: .45rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #f5f5f5;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all .15s;
}
.tar-region-tab.active {
  background: #1a1a2e;
  border-color: #1a1a2e;
  color: #fff;
}

.tar-select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  color: #222;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.tar-select:focus { border-color: #e6323a; }

/* ── Form grid ────────────────────────────────────── */
.tar-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.tar-field { display: flex; flex-direction: column; gap: .4rem; }
.tar-field label {
  font-size: .85rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tar-req { color: #e6323a; }

.tar-input {
  padding: .65rem .9rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
.tar-input:focus { border-color: #e6323a; }

/* ── Counter ──────────────────────────────────────── */
.tar-counter-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  height: 42px;
}
.tar-counter-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #e6323a;
  background: #fff;
  color: #e6323a;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.tar-counter-btn:hover { background: #e6323a; color: #fff; }
.tar-counter-val {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  color: #1a1a2e;
}

/* ── Radios ───────────────────────────────────────── */
.tar-section-lbl {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #777;
  margin-bottom: .7rem;
}
.tar-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}
.tar-radio-opt {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #f7f7f7;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
}
.tar-radio-opt input { display: none; }
.tar-radio-opt.selected,
.tar-radio-opt:has(input:checked) {
  border-color: #e6323a;
  background: #fff0f0;
  color: #c0212a;
  font-weight: 600;
}

/* ── Checkboxes ───────────────────────────────────── */
.tar-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .5rem;
  margin-bottom: .5rem;
}
.tar-check-opt {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border: 1.5px solid #e8e8e8;
  border-radius: 8px;
  font-size: .88rem;
  cursor: pointer;
  transition: all .15s;
}
.tar-check-opt input[type="checkbox"] { accent-color: #e6323a; }
.tar-check-opt:has(input:checked) {
  border-color: #e6323a;
  background: #fff5f5;
  font-weight: 600;
}

/* ── Botones de navegación ────────────────────────── */
.tar-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.8rem;
  gap: 1rem;
}
.tar-btn-pri, .tar-btn-sec, .tar-btn-calc {
  padding: .75rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .18s;
}
.tar-btn-pri {
  background: #1a1a2e;
  color: #fff;
}
.tar-btn-pri:hover:not(:disabled) { background: #2e2e4e; }
.tar-btn-pri:disabled { opacity: .4; cursor: default; }
.tar-btn-sec {
  background: transparent;
  border: 2px solid #ccc;
  color: #555;
}
.tar-btn-sec:hover { border-color: #999; color: #222; }
.tar-btn-calc {
  background: #e6323a;
  color: #fff;
  font-size: 1.05rem;
  padding: .85rem 2.2rem;
  letter-spacing: .02em;
}
.tar-btn-calc:hover { background: #c0212a; transform: translateY(-1px); }

/* ── Indicador de pasos ───────────────────────────── */
.tar-steps-indicator {
  display: flex;
  justify-content: center;
  gap: .7rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}
.tar-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #999;
  font-size: .8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.tar-dot.active { background: #e6323a; color: #fff; }
.tar-dot.done   { background: #1a1a2e; color: #fff; }

/* ── Resultado ────────────────────────────────────── */
.tar-resultado {
  text-align: center;
}
.tar-resultado-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #2e2e5e 100%);
  color: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
}
.tar-resultado-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .7;
  margin-bottom: .5rem;
}
.tar-resultado-valor {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1;
}
.tar-resultado-rango {
  margin-top: .8rem;
  font-size: 1rem;
  opacity: .8;
}
.tar-resultado-rango strong { color: #ffd166; }

.tar-resultado-zona {
  font-size: .9rem;
  opacity: .65;
  margin-top: .4rem;
}

/* Barra de rango visual */
.tar-rango-bar-wrap {
  margin: 1.5rem 0;
  padding: 0 .5rem;
}
.tar-rango-bar {
  position: relative;
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0, #e6323a 50%, #f0f0f0);
  border-radius: 6px;
}
.tar-rango-labels {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: #666;
  margin-top: .4rem;
}
.tar-rango-labels .tar-rango-mid {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: #e6323a;
}

/* Desglose */
.tar-desglose {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.2rem;
  margin-top: 1.2rem;
  text-align: left;
}
.tar-desglose h4 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #888;
  margin: 0 0 .8rem;
}
.tar-desglose-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid #eee;
  font-size: .9rem;
  color: #444;
}
.tar-desglose-item:last-child { border-bottom: none; }
.tar-desglose-item strong { color: #1a1a2e; font-weight: 700; }

.tar-factores {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}
.tar-factor-tag {
  background: #f0f4ff;
  border: 1px solid #c8d8ff;
  border-radius: 20px;
  padding: .3rem .8rem;
  font-size: .8rem;
  color: #3a5bd9;
  font-weight: 600;
}
.tar-factor-tag.neg { background: #fff0f0; border-color: #ffc8c8; color: #c0212a; }

/* ── Disclaimer ───────────────────────────────────── */
.tar-disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  background: #fffbeb;
  border: 1px solid #f0d080;
  border-radius: 8px;
  font-size: .82rem;
  color: #7a6200;
  line-height: 1.5;
}

/* Spinner */
.tar-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  flex-direction: column;
  gap: 1rem;
  color: #888;
  font-size: .95rem;
}
.tar-spinner::before {
  content: '';
  width: 40px; height: 40px;
  border: 4px solid #eee;
  border-top-color: #e6323a;
  border-radius: 50%;
  animation: tar-spin .7s linear infinite;
}
@keyframes tar-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 540px) {
  .tar-app { padding: 1.5rem 1rem 1rem; border-radius: 10px; }
  .tar-tipo-grid { grid-template-columns: 1fr 1fr; }
  .tar-resultado-valor { font-size: 2.1rem; }
  .tar-nav-row { flex-direction: column-reverse; }
  .tar-btn-calc, .tar-btn-pri, .tar-btn-sec { width: 100%; text-align: center; }
}
