:root {
  --dark-blue: #012169;
  --light-blue: #00c1d5;
  --blue: #00a5c2;
  --orange: #ed8b00;
  --medium-orange: #cc6a25;
  --bg-gray: #f0f2f7;
  --border-gray: #ccc;
  --label-gray: #707070;
  --navy: #012169;
  --navy-dark: #011033;
  --ink: #012169;
  --sub: #707070;
  --teal: #00c1d5;
  --teal-dark: #009bb4;
  --teal-soft: #e0f7fb;
  --field: #f0f2f7;
  --field-border: #ccc;
  --required: #c0392b;
  --card: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 6px;
}

/* Tipografía compartida de las calculadoras (misma fuente que typography.css) */
@font-face {
  font-family: "Roboto";
  src: url("../shared/fonts/roboto/Roboto-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../shared/fonts/roboto/Roboto-Italic-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: italic;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--card);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  color: var(--dark-blue);
}

.page-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 16px 32px;
}

.app {
  width: 100%;
}

.card {
  background: var(--card);
  padding: 0 8px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* Icono de la calculadora, igual que en las demás (64x48, centrado).
   Se pinta desde el CSS porque el HTML no se puede editar. */
.card-top::before {
  content: "";
  display: block;
  width: 64px;
  height: 48px;
  background: url("/Personas/Paginas/Calculadoras/landing/assets/img/calculadora-tae.webp") center / contain no-repeat;
}

@media screen and (min-width: 768px) {
  .card-top::before {
    width: 88px;
    height: 64px;
  }
}

/* Botón de cerrar: oculto, no aplica dentro del landing */
.card-top .close-btn {
  display: none;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-blue);
  margin: 0 0 4px;
  text-align: center;
}

.subtitle {
  font-size: 12px;
  font-weight: 400;
  line-height: 19px;
  color: var(--label-gray);
  margin: 0 0 20px;
  text-align: center;
}

@media screen and (min-width: 768px) {
  h1 {
    font-size: 26px;
  }

  .subtitle {
    font-size: 16px;
  }
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

.field-select {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  padding: 4px 36px 4px 12px;
  min-height: 48px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.field-select label {
  display: block;
  font-size: 12px;
  color: var(--label-gray);
  margin-bottom: 2px;
  pointer-events: none;
}

.field-select .dd-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--dark-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-select .dd-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-30%);
  color: var(--dark-blue);
  transition: transform 0.18s ease;
  pointer-events: none;
}

.field-select:hover {
  border-color: var(--light-blue);
}

.field-select.open {
  border-color: var(--light-blue);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.field-select.open .dd-chevron {
  transform: translateY(-30%) rotate(180deg);
}

.dd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--light-blue);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  z-index: 20;
  transition:
    max-height 0.18s ease,
    opacity 0.15s ease;
}

.field-select.open .dd-panel {
  max-height: 260px;
  opacity: 1;
  overflow-y: auto;
}

.dd-option {
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--dark-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.12s ease;
}

.dd-option:hover {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.dd-option.selected {
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-weight: 700;
}

.dd-option svg {
  color: var(--teal-dark);
  flex: 0 0 auto;
  display: none;
}

.dd-option.selected svg {
  display: block;
}

.field {
  background: #fff;
  border: 1px solid var(--dark-blue);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 6px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  transition: border-color 0.15s ease;
}

.field:focus-within {
  border-color: var(--light-blue);
}

.field .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  font-weight: 400;
  line-height: 19px;
  color: var(--dark-blue);
  margin-bottom: 6px;
}

@media screen and (min-width: 768px) {
  .field-label {
    font-size: 18px;
  }
}

.field-label .req {
  color: var(--required);
}

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-icon {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--light-blue);
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
  line-height: 1;
}

.tooltip-popup {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  background: var(--light-blue);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  width: 320px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  line-height: 1.5;
}

.tooltip-popup::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--light-blue);
}

.tooltip-wrapper:hover .tooltip-popup {
  opacity: 1;
}


.tooltip-wrapper:has(.tooltip-popup:empty) .tooltip-icon {
  display: none;
}

@media (max-width: 480px) {
  .page-wrap {
    padding: 16px 10px 24px;
  }

  .card {
    padding: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .calc-question {
    font-size: 14px;
  }

  .radio-option {
    font-size: 14px;
  }

  .tooltip-popup {
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 280px;
  }

  .tooltip-popup::after {
    display: none;
  }

  @keyframes tooltip-auto-close {
    0%, 85% { opacity: 1; }
    100% { opacity: 0; }
  }

  .tooltip-wrapper:hover .tooltip-popup {
    animation: tooltip-auto-close 2s forwards;
  }
}

.field .input-row {
  display: flex;
  align-items: center;
  margin-top: 0;
  width: 100%;
}

.field .prefix {
  font-size: 16px;
  color: var(--dark-blue);
  font-weight: 500;
  margin-right: 4px;
}

.field input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--label-gray);
  width: 100%;
  font-weight: 500;
  padding: 0;
}

.field input::placeholder {
  color: #b0b8c4;
  font-weight: 400;
}

.rates-pop {
  display: none;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  color: #4a5563;
  line-height: 1.9;
}

.rates-pop.show {
  display: block;
}

.rates-pop strong {
  display: block;
  color: var(--navy);
  margin-bottom: 4px;
  font-size: 12.5px;
}

.slider-block {
  margin: 18px 0 22px;
}

.slider-block .amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.slider-block .amount-label {
  font-size: 13px;
  color: var(--sub);
}

.slider-block .amount-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--teal) 0%,
    var(--teal) var(--fill, 50%),
    #e2e7ee var(--fill, 50%),
    #e2e7ee 100%
  );
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  margin-top: -1px;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--teal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.slider-caption {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--sub);
  margin-top: 8px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aab1bd;
  margin-top: 6px;
}

.calc-btn {
  display: block;
  min-width: 174px;
  border: none;
  border-radius: 40px;
  padding: 19.5px 50px;
  line-height: 21px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--orange);
  cursor: pointer;
  margin: 16px auto 10px;
  box-shadow: none;
  transition: background 0.15s ease;
}

.calc-btn:hover {
  background: var(--medium-orange);
}

.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0 10px;
}

.btn-row .calc-btn {
  margin: 0;
}

.ghost-btn {
  min-width: 174px;
  border: none;
  border-radius: 40px;
  padding: 19.5px 50px;
  line-height: 21px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  display: none;
}

.ghost-btn.visible {
  display: block;
}

.ghost-btn:hover {
  background: var(--medium-blue, #00709e);
}

.link-row {
  text-align: center;
  font-size: 13px;
  color: var(--teal-dark);
  font-weight: 700;
  cursor: pointer;
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.error {
  font-size: 14px;
  color: var(--required);
  margin: -10px 0 10px;
  padding-left: 2px;
  display: none;
}

.error.show {
  display: block;
}

.results {
  display: none;
  margin-top: 8px;
}

.results.show {
  display: block;
  animation: rise 0.35s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-hero {
  background: linear-gradient(155deg, var(--navy), var(--navy-dark));
  color: #fff;
  border-radius: 20px;
  padding: 20px 20px 18px;
  margin-bottom: 14px;
}

.results-hero .hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin: 0 0 4px;
}

.results-hero .hero-value {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 10px;
}

.results-hero .hero-note {
  font-size: 11.5px;
  opacity: 0.75;
  line-height: 1.5;
  margin: 0;
}

.results-hero .divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 14px 0;
}

.results-hero .sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}

.results-hero .sub-row span:first-child {
  opacity: 0.85;
}

.results-hero .sub-row span:last-child {
  font-weight: 800;
}

.accordion {
  border: 1.5px solid var(--field-border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
}

.accordion-head span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.accordion-head svg {
  transition: transform 0.2s ease;
  color: var(--navy);
}

.accordion.open .accordion-head svg {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 0 16px 16px;
  font-size: 12.5px;
  color: #5b6675;
  line-height: 1.6;
}

.accordion.open .accordion-body {
  display: block;
}

.accordion-body .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-top: 1px dashed var(--field-border);
}

.accordion-body .row:first-of-type {
  border-top: none;
  margin-top: 8px;
}

.accordion-body .row span:last-child {
  font-weight: 700;
  color: var(--ink);
}

table.extra-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

table.extra-table th {
  text-align: left;
  color: var(--sub);
  font-weight: 600;
  padding: 6px 4px;
  border-bottom: 1.5px solid var(--field-border);
}

table.extra-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--field-border);
}

table.extra-table input {
  width: 100%;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

table.extra-table .add-row-btn {
  background: none;
  border: none;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  padding: 8px 0 0;
}

footer.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--sub);
  margin-top: 18px;
  line-height: 1.6;
}

a.pdf-link {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  margin-top: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 14px;
}

.field-group.span-2 {
  grid-column: 1 / -1;
}

.field-group.hidden {
  display: none;
}

.calc-question {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 10px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 4px;
  margin-bottom: 14px;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--dark-blue);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.radio-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--dark-blue);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.radio-option input[type="radio"]::before,
.radio-option input[type="radio"]::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.radio-option input[type="radio"]::before {
  width: 8px;
  height: 8px;
  background: #fff;
}

.radio-option input[type="radio"]::after {
  width: 13px;
  height: 13px;
  background: var(--light-blue);
}

.radio-option input[type="radio"]:checked::before,
.radio-option input[type="radio"]:checked::after {
  transform: scale(1);
}

.radio-option input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 193, 213, 0.35);
}

.tae-result {
  background: var(--dark-blue);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.tae-result .tae-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin: 0 0 8px;
}

.tae-result .tae-value {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--light-blue);
}

.tae-result .tae-note {
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.6;
  margin: 0;
}
