/* ============================================================
   CALCULADORA EDAD CRONOLÓGICA — CSS para WPCode
   Prefijo: .calc-edad__ (evita conflictos con el tema)
   ============================================================ */

.calc-edad__wrap {
  font-family: inherit;
  max-width: 680px;
  margin: 0 auto 40px;
  color: #1A1714;
}

/* ── Tabs ── */
.calc-edad__tabs {
  display: flex;
  gap: 4px;
  background: #F0EDE8;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid #E2DDD6;
}
.calc-edad__tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5C564E;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.3;
}
.calc-edad__tab.activo {
  background: #ffffff;
  color: #1A1714;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.calc-edad__tab:hover:not(.activo) { color: #1A1714; }

/* ── Paneles ── */
.calc-edad__panel { display: none; }
.calc-edad__panel.activo { display: block; }

/* ── Card ── */
.calc-edad__card {
  background: #ffffff;
  border: 1px solid #E2DDD6;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

/* ── Nota informativa ── */
.calc-edad__nota {
  background: #F0EDE8;
  border-left: 3px solid #1B6CA8;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 13px;
  color: #5C564E;
  line-height: 1.55;
  margin-bottom: 18px;
}
.calc-edad__nota strong { color: #1A1714; }

/* ── Formulario ── */
.calc-edad__grupo { margin-bottom: 16px; }
.calc-edad__grupo label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #5C564E;
  margin-bottom: 6px;
}
.calc-edad__grupo input[type="date"],
.calc-edad__grupo input[type="text"],
.calc-edad__grupo input[type="number"] {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #E2DDD6;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: #1A1714;
  background: #ffffff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.calc-edad__grupo input:focus {
  border-color: #1B6CA8;
  box-shadow: 0 0 0 3px rgba(27,108,168,0.10);
}
.calc-edad__grupo input.error {
  border-color: #C0392B;
}
.calc-edad__hint {
  font-size: 12px;
  color: #9C9389;
  margin-top: 4px;
  display: block;
}
.calc-edad__error {
  font-size: 12px;
  color: #C0392B;
  margin-top: 5px;
  display: none;
}
.calc-edad__error.visible { display: block; }

/* ── Fila 2 columnas ── */
.calc-edad__fila-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Fila RUT ── */
.calc-edad__fila-rut {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

/* ── Botón principal ── */
.calc-edad__btn {
  width: 100%;
  padding: 12px;
  background: #1B6CA8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: 4px;
}
.calc-edad__btn:hover { background: #134F7A; }
.calc-edad__btn:active { transform: scale(0.99); }
.calc-edad__btn--sm {
  width: auto;
  padding: 10px 22px;
  margin-top: 0;
}

/* ── Resultado exacto ── */
.calc-edad__resultado {
  display: none;
  margin-top: 20px;
  background: #E8F1F8;
  border: 1.5px solid #B8D4EC;
  border-radius: 12px;
  padding: 22px;
  animation: calcEdadFadeUp .3s ease;
}
.calc-edad__resultado.visible { display: block; }

@keyframes calcEdadFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calc-edad__res-principal {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 600;
  color: #134F7A;
  line-height: 1.2;
  margin-bottom: 4px;
}
.calc-edad__res-sub {
  font-size: 14px;
  color: #1B6CA8;
  margin-bottom: 18px;
}
.calc-edad__res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.calc-edad__res-stat {
  background: rgba(255,255,255,0.75);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.calc-edad__res-stat-val {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #134F7A;
}
.calc-edad__res-stat-lbl {
  font-size: 11px;
  color: #1B6CA8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-edad__res-extra {
  font-size: 13px;
  color: #1B6CA8;
  padding-top: 12px;
  border-top: 1px solid #B8D4EC;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Resultado RUT ── */
.calc-edad__rut-resultado {
  display: none;
  margin-top: 20px;
  animation: calcEdadFadeUp .3s ease;
}
.calc-edad__rut-resultado.visible { display: block; }

.calc-edad__rut-rango-box {
  background: #EBF5ED;
  border: 1.5px solid #A8D4B0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 10px;
}
.calc-edad__rut-rango {
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  color: #2D7A3A;
  margin-bottom: 4px;
  line-height: 1.2;
}
.calc-edad__rut-desc {
  font-size: 14px;
  color: #3a7a46;
  line-height: 1.5;
}
.calc-edad__rut-aviso {
  background: #FFF4DC;
  border: 1px solid #F0D080;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8A5C00;
  line-height: 1.55;
  margin-bottom: 10px;
}
.calc-edad__rut-cta {
  background: #F0EDE8;
  border: 1px solid #E2DDD6;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #5C564E;
  line-height: 1.5;
}
.calc-edad__rut-cta strong { color: #1A1714; }
.calc-edad__rut-cta a { color: #1B6CA8; text-decoration: none; font-weight: 500; }
.calc-edad__rut-cta a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 500px) {
  .calc-edad__card { padding: 18px; }
  .calc-edad__tabs { flex-direction: column; }
  .calc-edad__tab { text-align: left; }
  .calc-edad__fila-2 { grid-template-columns: 1fr; }
  .calc-edad__fila-rut { grid-template-columns: 1fr; }
  .calc-edad__btn--sm { width: 100%; }
  .calc-edad__res-grid { grid-template-columns: 1fr 1fr; }
}