/* Liberté financière — calculateur */

html:has(body.solide-liberte-financiere) {
  overflow-x: clip;
}

body.solide-liberte-financiere {
  overflow-x: clip;
  max-width: 100%;
}

body.solide-liberte-financiere .wp-content.lib-fin-content {
  width: 100%;
  max-width: min(560px, 100%);
  overflow-x: clip;
}

.lib-fin-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 560px;
  min-width: 0;
  overflow-x: clip;
  box-sizing: border-box;
}

.lib-fin-content *,
.lib-fin-content *::before,
.lib-fin-content *::after {
  box-sizing: border-box;
}

.lib-fin-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: #f8fafc;
}

/* Bloc objectif patrimoine */
.lib-fin-patrimoine {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.lib-fin-patrimoine__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.lib-fin-field--divider {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lib-fin-field__hint {
  margin-top: -4px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.78);
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* Revenu passif indicatif (sous le graphique) */
.lib-fin-chart .lib-fin-passive {
  gap: 6px;
  margin: 16px 0 0;
  padding: 16px 18px 0;
  background: none;
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lib-fin-passive[hidden] {
  display: none !important;
}

.lib-fin-chart .lib-fin-passive {
  display: grid;
}

.lib-fin-passive__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.lib-fin-passive__value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold, #e0c484);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.lib-fin-passive__hint {
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.78);
  overflow-wrap: anywhere;
}

/* Choix de méthode */
.lib-fin-picker {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.lib-fin-picker__legend {
  margin: 0 0 16px;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.lib-fin-picker__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .lib-fin-picker__options {
    grid-template-columns: 1fr;
  }
}

.lib-fin-picker__option {
  cursor: pointer;
}

.lib-fin-picker__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lib-fin-picker__card {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lib-fin-picker__option:hover .lib-fin-picker__card {
  border-color: rgba(224, 196, 132, 0.35);
}

.lib-fin-picker__input:checked + .lib-fin-picker__card {
  border-color: rgba(224, 196, 132, 0.55);
  background: rgba(224, 196, 132, 0.08);
  box-shadow: inset 0 0 0 1px rgba(224, 196, 132, 0.15);
}

.lib-fin-picker__num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold, #e0c484);
}

.lib-fin-picker__label {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f1f5f9;
}

/* Formulaire + résultat par méthode */
.lib-fin-flow[hidden],
.lib-fin-output[hidden] {
  display: none !important;
}

.lib-fin-flow {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.lib-fin-form {
  min-width: 0;
  padding: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.lib-fin-output {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.lib-fin-field {
  display: grid;
  gap: 10px;
}

.lib-fin-field__label {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.92);
}

.lib-fin-field__row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 220px;
}

.lib-fin-field__input {
  width: 100%;
  max-width: none;
  padding: 11px 40px 11px 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  background: rgba(8, 14, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -moz-appearance: textfield;
  appearance: textfield;
}

.lib-fin-field__input::-webkit-outer-spin-button,
.lib-fin-field__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lib-fin-field__input::placeholder {
  color: rgba(148, 163, 184, 0.45);
  font-weight: 500;
}

.lib-fin-field__input:focus {
  border-color: rgba(224, 196, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(224, 196, 132, 0.12);
}

.lib-fin-field__input:focus-visible {
  border-color: rgba(224, 196, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(224, 196, 132, 0.12);
}

.lib-fin-field__suffix {
  position: absolute;
  right: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  white-space: nowrap;
  pointer-events: none;
}

.lib-fin-field__row--wide {
  max-width: 280px;
}

.lib-fin-field__row--suffix-md .lib-fin-field__input {
  padding-right: 58px;
}

.lib-fin-field__row--suffix-lg .lib-fin-field__input {
  padding-right: 92px;
}

.lib-fin-field__row--suffix-lg {
  max-width: 260px;
}

@media (max-width: 520px) {
  /* ≥ 16px : évite le zoom auto iOS au focus (source fréquente de scroll horizontal) */
  .lib-fin-field__input {
    font-size: 16px;
  }

  .lib-fin-field__row,
  .lib-fin-field__row--suffix-lg {
    max-width: 100%;
  }
}

.lib-fin-result {
  min-width: 0;
  padding: 20px;
  background: rgba(224, 196, 132, 0.08);
  border: 1px solid rgba(224, 196, 132, 0.22);
  border-radius: 14px;
  overflow-x: clip;
}

.lib-fin-result__question {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
}

.lib-fin-result__value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold, #e0c484);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.lib-fin-result__note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(148, 163, 184, 0.92);
  overflow-wrap: anywhere;
}

.lib-fin-result__note[hidden] {
  display: none !important;
}

/* Graphique (dans le bloc résultat) */
.lib-fin-chart {
  min-width: 0;
  padding: 22px 22px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow-x: clip;
}

@media (max-width: 520px) {
  .lib-fin-patrimoine,
  .lib-fin-form,
  .lib-fin-chart {
    padding: 18px 16px;
  }

  .lib-fin-result {
    padding: 16px;
  }
}

.lib-fin-chart__title {
  margin: 0 0 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.9);
}

.lib-fin-chart__wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  contain: layout paint;
  background: rgba(5, 9, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  isolation: isolate;
}

.lib-fin-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  vertical-align: top;
}

.lib-fin-chart__grid {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.lib-fin-chart__grid--soft {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-dasharray: 3 4;
}

.lib-fin-chart__grid--base {
  stroke: rgba(226, 232, 240, 0.14);
  stroke-dasharray: 4 5;
}

.lib-fin-chart__grid--goal {
  stroke: rgba(224, 196, 132, 0.35);
  stroke-dasharray: 5 4;
}

.lib-fin-chart__axis--base {
  fill: rgba(226, 232, 240, 0.88);
  font-weight: 600;
}

.lib-fin-chart__axis--goal {
  fill: var(--gold, #e0c484);
  font-weight: 600;
}

.lib-fin-chart__axis {
  fill: rgba(148, 163, 184, 0.75);
  font-size: 8px;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 521px) {
  .lib-fin-chart__axis {
    font-size: 9px;
  }
}

.lib-fin-chart__stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
  min-width: 0;
}

.lib-fin-chart__stats[hidden] {
  display: none !important;
}

.lib-fin-chart__stat {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lib-fin-chart__stat:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.lib-fin-chart__leg {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5em;
  width: 100%;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(148, 163, 184, 0.95);
}

.lib-fin-chart__stat--base .lib-fin-chart__leg {
  font-size: 0.68rem;
}

.lib-fin-chart__leg-label {
  flex: 1 1 auto;
  min-width: 0;
}

.lib-fin-chart__leg::before {
  content: "";
  width: 18px;
  height: 3px;
  margin-top: 0;
  border-radius: 2px;
  flex-shrink: 0;
}

.lib-fin-chart__leg--base::before {
  background: rgba(226, 232, 240, 0.55);
}

.lib-fin-chart__leg--cap::before {
  background: repeating-linear-gradient(
    90deg,
    rgba(107, 201, 212, 0.9) 0 5px,
    transparent 5px 8px
  );
}

.lib-fin-chart__leg--int::before {
  background: #4ecf9a;
}

.lib-fin-chart__leg--total::before {
  background: #6bc9d4;
}

.lib-fin-chart__leg .lib-fin-chart__figure-value {
  display: inline;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  overflow-wrap: normal;
}
