/* ==========================================================================
   UNYX — calculator.css · V10 «EL PLANO TÉCNICO»
   La calculadora es la hoja de medición: papel milimetrado, tinta y cobalto.
   ========================================================================== */

.calc-shell {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--sheet);
  background-size: 26px 26px, 26px 26px, auto;
  border: 1px solid var(--ink);
  box-shadow: 7px 7px 0 var(--line);
  padding: clamp(22px, 3vw, 40px);
}

/* crucetas de registro en las esquinas de la hoja */
.calc-shell::before, .calc-shell::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  pointer-events: none;
}

.calc-shell::before { top: 8px; left: 12px; }
.calc-shell::after { bottom: 8px; right: 12px; }

.calc-progress {
  position: relative;
  height: 9px;
  margin-bottom: 26px;
  border-left: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat;
}

#calc-progress-bar {
  position: absolute; left: 0; top: 4px;
  height: 1.5px;
  width: 0%;
  display: block;
  background: var(--cobalt);
  transition: width 0.45s var(--ease-cinema);
}

.calc-body { min-height: 460px; position: relative; }

/* ---------- transición entre vistas ---------- */

.calc-view {
  position: relative;
  transition: opacity 0.34s ease, transform 0.42s var(--ease-cinema), filter 0.34s ease;
}

.calc-view.pre { opacity: 0; transform: translateY(26px); filter: blur(5px); }

.calc-view.exit {
  position: absolute; inset: 0 0 auto 0;
  opacity: 0; transform: translateY(-22px); filter: blur(5px);
  pointer-events: none;
}

.calc-step-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin: 0 0 12px;
}

.calc-q {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.018em;
  color: var(--ink);
}

.calc-hint {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* ---------- paso 1 · tipos de proyecto ---------- */

.calc-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  counter-reset: ctype;
}

.calc-type { position: relative; counter-increment: ctype; }

.calc-type::after {
  content: "0" counter(ctype);
  position: absolute;
  top: 10px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

.calc-type {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line-2);
  padding: 18px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  transition: transform 0.25s var(--ease-snap), border-color 0.25s, box-shadow 0.25s;
}

.calc-type:hover {
  transform: translate(-2px, -3px);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--line);
}

.calc-type .t-icon {
  color: var(--ink);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  background: var(--sheet);
  transition: color 0.25s, border-color 0.25s;
}

.calc-type:hover .t-icon { color: var(--cobalt); border-color: var(--cobalt); }

.calc-type .t-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
}

.calc-type .t-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}

/* ---------- preguntas ---------- */

.calc-opts { display: grid; gap: 9px; }

.calc-opt {
  display: flex; align-items: center; gap: 13px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line-2);
  padding: 15px 16px;
  min-height: 54px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-snap);
}

.calc-opt:hover {
  border-color: var(--ink);
  transform: translateX(2px);
}

.calc-opt .box {
  flex-shrink: 0;
  width: 19px; height: 19px;
  display: grid; place-items: center;
  font-size: 10px;
  color: transparent;
  border: 1px solid var(--line-2);
  background: var(--sheet);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.calc-opt[data-kind="radio"] .box { border-radius: 50%; }

.calc-opt.selected { border-color: var(--cobalt); box-shadow: 3px 3px 0 rgba(34, 64, 242, 0.16); }

.calc-opt.selected .box {
  color: #fff;
  border-color: var(--cobalt);
  background: var(--cobalt);
}

.calc-opt .opt-note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal);
  border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent);
  padding: 3px 8px;
  white-space: nowrap;
}

/* ---------- notas ---------- */

.calc-view textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 15px 16px;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  min-height: 130px;
  resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.calc-view textarea::placeholder { color: var(--ink-3); }

.calc-view textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 2px 2px 0 rgba(34, 64, 242, 0.18);
}

.calc-error {
  display: none;
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--signal);
}

.calc-error.show { display: block; }

/* ---------- navegación ---------- */

.calc-nav {
  display: flex; align-items: center; gap: 16px;
  margin-top: 24px;
}

.calc-back {
  background: none; border: none; padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.2s;
}

.calc-back:hover { color: var(--ink); }

.calc-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.calc-next { margin-left: 0; }

/* ---------- cargando ---------- */

.calc-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  min-height: 380px;
  text-align: center;
}

.calc-spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  border-top-color: var(--cobalt);
  animation: calcspin 0.85s linear infinite;
  position: relative;
}

@keyframes calcspin { to { transform: rotate(360deg); } }

.calc-loading p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  transition: opacity 0.22s ease;
}

.calc-loading small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- resultado · hoja de especificaciones ---------- */

.calc-result { text-align: left; }

.res-figures {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 20px;
}

.res-fig {
  border: 1px solid var(--line-2);
  background: var(--paper);
  padding: 18px 20px;
  min-width: 0;
}

.res-fig .lab {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.res-fig .val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}

.res-fig--price { border-color: var(--cobalt); border-width: 1.5px; position: relative; }

.res-fig--price .val {
  font-size: clamp(34px, 4.6vw, 56px);
  color: var(--cobalt);
}

.res-fig--price::after {
  content: "±0";
  position: absolute; top: 12px; right: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}

/* ---- dos opciones de pago ---- */
.res-payhead {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(16px, 2.1vw, 20px);
  letter-spacing: -0.01em; color: var(--ink); margin: 10px 0 16px;
}
.res-figures.res-pay { grid-template-columns: 1fr 1fr; gap: 16px; position: relative; }
.pay-opt {
  border: 1px solid var(--line-2); background: var(--paper);
  padding: 22px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.pay-opt--plan { border-color: var(--cobalt); border-width: 2px; box-shadow: 0 0 0 3px rgba(34, 64, 242, 0.07); }
.pay-tag {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 1.9vw, 19px);
  letter-spacing: -0.01em; text-transform: none; color: var(--ink); line-height: 1.15;
}
.pay-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--cobalt); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; line-height: 1;
}
.pay-opt--once .pay-badge { background: var(--ink); }
/* separador "o" entre las dos opciones (solo escritorio) */
.res-figures.res-pay::after {
  content: "o"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-3); z-index: 3;
}
@media (max-width: 620px) { .res-figures.res-pay::after { display: none; } }
.pay-opt .val {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(23px, 3.2vw, 36px); letter-spacing: -0.015em; color: var(--cobalt);
  white-space: normal; line-height: 1.05;
}
.pay-opt .val em { font-style: normal; font-weight: 500; font-size: 0.48em; color: var(--ink-3); white-space: nowrap; }
.pay-opt .val--mo { font-size: clamp(17px, 2.3vw, 24px); margin-top: -1px; }
.pay-note { font-size: 12px; line-height: 1.5; color: var(--ink-3); margin-top: 2px; }
.res-fig--weeks { margin-bottom: 20px; }
@media (max-width: 620px) { .res-figures.res-pay { grid-template-columns: 1fr; } }

.res-detail {
  border: 1px solid var(--line-2);
  background: var(--paper);
  margin-bottom: 18px;
}

.res-detail summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.2s;
}

.res-detail summary::-webkit-details-marker { display: none; }
.res-detail summary::before { content: "+ "; color: var(--cobalt); }
.res-detail[open] summary::before { content: "− "; }
.res-detail summary:hover { color: var(--cobalt); }

.res-rows { padding: 4px 18px 14px; }

.res-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.res-row:hover { color: var(--ink); }

.res-row b { font-family: var(--font-mono); font-weight: 400; font-size: 12px; color: var(--ink); white-space: nowrap; }

.res-row--total {
  border-bottom: none;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
  color: var(--ink);
  font-weight: 600;
}

.res-row--total b { color: var(--cobalt); }

.res-disclaimer {
  position: relative;
  margin: 0 0 20px;
  padding: 13px 16px 13px 38px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--cobalt);
  background: var(--paper);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

.res-disclaimer b { color: var(--ink); }

.res-disclaimer::before {
  content: "!";
  position: absolute; left: 15px; top: 13px;
  font-family: var(--font-mono);
  color: var(--cobalt);
}

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

.calc-restart {
  background: none; border: none; padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.2s;
}

.calc-restart:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .calc-types { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .calc-shell { padding: 18px 14px; }
  .calc-types { grid-template-columns: 1fr; }
  .calc-body { min-height: 420px; }
  .res-fig--price .val { font-size: clamp(28px, 9vw, 40px); }
}
