/**
 * Calculadora BASE360 — estilos del shortcode [base360_calc].
 * Todo bajo .ync para no colisionar con Elementor ni con el tema.
 *
 * Correcciones de contraste respecto al HTML del cliente (KD exige WCAG 2.1 AA "Plenamente Conforme"):
 *   - hints y titulares de grupo: #9A988F sobre blanco = 2,89:1  FALLA  -> #6B6A64 = 5,43:1
 *   - readout de los sliders:     #FF5B35 sobre blanco = 3,10:1  FALLA  -> #C2390F = 5,40:1
 *   - borde de los inputs:        #E6E5E1 sobre blanco = 1,20:1  FALLA (1.4.11) -> #888680 = 3,64:1
 * El coral vivo (#FF5B35) solo se usa sobre tinta (6,27:1) o como relleno/borde no textual.
 */

.ync {
  --ync-ink: #0D0D0D;
  --ync-white: #FFFFFF;
  --ync-off: #F3F3F1;
  --ync-coral: #FF5B35;
  --ync-coral-deep: #E8431F;
  --ync-coral-tx: #C2390F;   /* coral accesible para texto sobre claro */
  --ync-hint: #6B6A64;       /* gris accesible para texto pequeño sobre claro */
  --ync-line: #E6E5E1;
  --ync-border-input: #888680;
  --ync-lead: #46453F;

  font-family: 'Archivo', system-ui, sans-serif;
  color: var(--ync-ink);
}

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

.ync-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 30px;
  align-items: start;
}

/* ── Panel de resultado ───────────────────────────────────────────── */

.ync-result {
  background: var(--ync-ink);
  color: var(--ync-white);
  border-radius: 8px;
  padding: 40px;
  position: sticky;
  top: 110px;
  overflow: hidden;
}

.ync-result::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 91, 53, .22);
  border-radius: 50%;
  animation: ync-spin 40s linear infinite;
  pointer-events: none;
}

@keyframes ync-spin { to { transform: rotate(360deg); } }

.ync-result-label {
  position: relative;
  z-index: 2;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ync-coral);          /* 6,27:1 sobre tinta */
  margin: 0 0 26px;
}

.ync-kpis {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.ync-kpi { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.ync-kpi-main {
  padding-right: 18px;
  border-right: 1px solid rgba(255, 255, 255, .15);
}

.ync-kl {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.ync-kv {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 2.5rem;
  letter-spacing: -.03em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.ync-kv.ync-sm { font-size: 1.6rem; }

/* Veredicto del semáforo: es TEXTO, no solo color (WCAG 1.4.1). */
.ync-verdict {
  position: relative;
  z-index: 2;
  margin: 0 0 22px;
  font-size: 14px;
  font-weight: 700;
}

.ync-flow-caption {
  position: relative;
  z-index: 2;
  margin: 0 0 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
}

.ync-bar {
  position: relative;
  z-index: 2;
  display: flex;
  height: 32px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
  gap: 1.5px;
}

.ync-seg {
  transition: flex-grow .4s cubic-bezier(.4, 0, .2, 1), background .25s;
  min-width: 0;
}

.ync-striped {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 5px,
      rgba(255, 255, 255, .35) 5px, rgba(255, 255, 255, .35) 10px);
}

.ync-legend {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
}

.ync-legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-size: 13px;
}

.ync-legend li:last-child { border-bottom: none; }

.ync-dot { width: 11px; height: 11px; border-radius: 3px; }
.ync-lg-label { color: rgba(255, 255, 255, .92); }

.ync-lg-val {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 500;
}

.ync-lg-pct {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
  width: 46px;
  text-align: right;
}

.ync-result-cta {
  position: relative;
  z-index: 2;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  background: var(--ync-coral);
  color: var(--ync-ink);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: .98rem;
  transition: background .25s ease;
}

.ync-result-cta:hover,
.ync-result-cta:focus-visible { background: var(--ync-white); color: var(--ync-ink); }
.ync-result-cta .ync-arr { font-family: 'Spline Sans Mono', ui-monospace, monospace; }

/* ── Panel de inputs ──────────────────────────────────────────────── */

.ync-inputs {
  background: var(--ync-white);
  border: 1px solid var(--ync-line);
  border-radius: 8px;
  padding: 10px 30px 30px;
}

.ync-group { padding: 24px 0; border-bottom: 1px solid var(--ync-line); }
.ync-group:last-of-type { border-bottom: none; }

.ync-group-title {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ync-hint);
  margin: 0 0 18px;
}

.ync-group-body { display: grid; gap: 22px; }
.ync-field { display: grid; gap: 8px; }

.ync-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ync-ink);
}

.ync-readout {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: var(--ync-coral-tx);       /* 5,40:1 sobre blanco */
  white-space: nowrap;
}

.ync-hint { font-size: 12px; color: var(--ync-hint); line-height: 1.45; }

.ync-inputwrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--ync-border-input);   /* 3,64:1 -> WCAG 1.4.11 */
  border-radius: 4px;
  background: var(--ync-off);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}

.ync-inputwrap:focus-within {
  border-color: var(--ync-coral-deep);
  box-shadow: 0 0 0 3px rgba(255, 91, 53, .22);
}

.ync-inputwrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 13px 4px 13px 14px;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 16px;                 /* 16px evita el zoom automático de iOS al enfocar */
  font-weight: 500;
  color: var(--ync-ink);
  outline: none;
  width: 100%;
}

.ync-unit {
  padding: 0 14px 0 6px;
  color: var(--ync-hint);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.ync-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--ync-coral) var(--p, 0%), var(--ync-line) var(--p, 0%));
  outline: none;
  margin: 6px 0;
}

.ync-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ync-coral-deep);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .12s;
}

.ync-slider::-webkit-slider-thumb:active { transform: scale(1.12); }

.ync-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ync-coral-deep);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

/* Foco visible en TODO lo interactivo (WCAG 2.4.7). */
.ync a:focus-visible,
.ync button:focus-visible,
.ync input:focus-visible {
  outline: 3px solid var(--ync-coral-deep);
  outline-offset: 2px;
}

.ync-reset {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  border-radius: 4px;
  border: 1px solid var(--ync-ink);
  background: var(--ync-white);
  color: var(--ync-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.ync-reset:hover { background: var(--ync-ink); color: var(--ync-white); }

.ync-fees-note {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ync-hint);
}

/* Visible solo para lectores de pantalla. */
.ync-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .ync-grid { grid-template-columns: 1fr; gap: 24px; }
  /* En móvil el usuario rellena primero y mira el resultado después.
     OJO: 'relative', no 'static'. Con static el panel deja de ser bloque contenedor, el círculo
     decorativo (::before, absolute) escapa del overflow:hidden y provoca scroll horizontal. */
  .ync-result { position: relative; top: auto; order: 2; padding: 28px 22px; }
  .ync-inputs { order: 1; padding: 6px 20px 26px; }
}

@media (max-width: 480px) {
  .ync-kpis { grid-template-columns: 1fr 1fr; gap: 18px 14px; }
  .ync-kpi-main {
    grid-column: 1 / -1;
    border-right: none;
    padding-right: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
  }
  .ync-kv { font-size: 2.1rem; }
  .ync-kv.ync-sm { font-size: 1.5rem; }
  .ync-legend li { grid-template-columns: 14px 1fr auto; row-gap: 2px; }
  .ync-lg-pct { grid-column: 2 / -1; width: auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .ync *,
  .ync *::before,
  .ync *::after {
    animation: none !important;
    transition: none !important;
  }
}
