:root {
    --desafio-ink: #23394e;
    --desafio-blue: #337ab7;
    --desafio-blue-deep: #245782;
    --desafio-paper: #e3e9f0;
    --desafio-muted: #596b7a;
    --desafio-border: #d1dce5;
    --desafio-white: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.desafio-page { margin: 0; background: var(--desafio-paper); color: var(--desafio-ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.5; }
.desafio-page button, .desafio-page input, .desafio-page select { font: inherit; }
.desafio-page button, .desafio-page a, .desafio-page input, .desafio-page select, .desafio-page summary { -webkit-tap-highlight-color: transparent; }
.desafio-page :focus-visible { outline: 3px solid #1f4164; outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.desafio-page [hidden] { display: none !important; }
.desafio-container { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.desafio-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.desafio-skip { position: absolute; top: -100px; left: 12px; z-index: 30; padding: 10px 14px; background: #fff; color: var(--desafio-blue-deep); }
.desafio-skip:focus { top: 10px; }

.desafio-header { background: var(--desafio-blue); border-bottom: 1px solid #286090; }
.desafio-header-inner { min-height: 74px; max-width: 1180px; padding: 0 40px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.desafio-brand { display: flex; align-items: center; gap: 16px; color: #fff; font-size: 12px; font-weight: 700; }
.desafio-brand img { width: 110px; height: auto; display: block; }
.desafio-brand-divider { width: 1px; height: 24px; background: rgba(255,255,255,.55); }
.desafio-language { display: flex; align-items: center; gap: 3px; padding: 4px; background: #286090; border-radius: 30px; }
.desafio-language-link { min-width: 41px; padding: 7px 9px; color: #fff; font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; border-radius: 30px; }
.desafio-language-link:hover { color: var(--desafio-blue-deep); background: #e5f0f9; }
.desafio-language-link.is-active { color: var(--desafio-blue-deep); background: #fff; }

.desafio-hero-copy { padding-top: 36px; }
.desafio-hero h1 { margin: 0; color: #1e3a50; font-size: clamp(30px, 3.5vw, 40px); font-weight: 700; line-height: 1.2; }
.desafio-hero-description { margin: 10px 0 0; color: #445c70; font-size: 17px; }
.desafio-privacy { margin: 7px 0 0; color: var(--desafio-muted); font-size: 13px; }

.desafio-workspace { padding-top: 24px; padding-bottom: 56px; }
.desafio-calculator-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: stretch; }
.desafio-form-card, .desafio-result-card, .desafio-chart-card { min-width: 0; border: 1px solid var(--desafio-border); border-radius: 5px; background: #fff; box-shadow: 0 2px 6px rgba(35,57,78,.08); }
.desafio-form-card, .desafio-result-card { padding: 26px; }
.desafio-card-intro h2, .desafio-result-card h3, .desafio-chart-heading h3 { margin: 0; color: #23394e; font-size: 20px; font-weight: 700; line-height: 1.3; }
.desafio-card-intro { margin-bottom: 23px; }
.desafio-field { min-width: 0; margin-bottom: 18px; }
.desafio-field label { display: block; margin-bottom: 7px; color: #29445b; font-size: 14px; font-weight: 700; }
.desafio-input-wrap, .desafio-select-wrap { min-height: 46px; display: flex; align-items: center; overflow: hidden; border: 1px solid #b9c9d7; border-radius: 4px; background: #fff; }
.desafio-input-wrap:focus-within, .desafio-select-wrap:focus-within { border-color: #337ab7; box-shadow: 0 0 0 2px rgba(51,122,183,.2); }
.desafio-input-wrap span { padding: 0 0 0 13px; color: #526b7d; font-weight: 700; }
.desafio-input-wrap input, .desafio-select-wrap select { min-width: 0; width: 100%; min-height: 44px; padding: 9px 12px; color: var(--desafio-ink); border: 0; outline: 0; background: transparent; }
.desafio-input-suffix span { padding: 0 13px 0 0; white-space: nowrap; }
.desafio-select-wrap select { cursor: pointer; }
.desafio-input-wrap.is-invalid, .desafio-select-wrap.is-invalid { border-color: #a1332d; }
.desafio-field-help { margin: 5px 0 0; color: var(--desafio-muted); font-size: 12px; }
.desafio-field-error { margin: 5px 0 0; color: #a1332d; font-size: 13px; font-weight: 600; }
.desafio-field-error:empty { display: none; }
.desafio-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.desafio-preset { min-width: 46px; min-height: 36px; padding: 6px 9px; border: 1px solid #bdcfdc; border-radius: 4px; background: #fff; color: #245782; font-size: 13px; font-weight: 700; cursor: pointer; }
.desafio-preset:hover, .desafio-preset[aria-pressed="true"] { border-color: #337ab7; background: #e8f2fa; color: #1f4164; }
.desafio-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.desafio-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 3px; }
.desafio-button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; padding: 10px 16px; font-size: 14px; font-weight: 700; line-height: 1.3; text-align: center; cursor: pointer; }
.desafio-button-primary { background: var(--desafio-blue); color: #fff; }
.desafio-button-primary:hover { background: #286090; }
.desafio-button-outline { color: #245782; border-color: #9fb7ca; background: #fff; }
.desafio-button-outline:hover { background: #edf4fa; }
.desafio-button:disabled { cursor: not-allowed; opacity: .6; }
.desafio-submit { flex: 1 1 auto; }
.desafio-form-error, .desafio-noscript { color: #a1332d; font-size: 13px; }
.desafio-form-error:empty { display: none; }

.desafio-result-card { display: flex; flex-direction: column; border-top: 4px solid var(--desafio-blue); }
.desafio-total-label { margin: 37px 0 3px; color: var(--desafio-muted); font-size: 14px; font-weight: 700; }
.desafio-total { overflow-wrap: anywhere; margin: 0; color: #245782; font-size: clamp(34px, 4vw, 46px); font-weight: 700; line-height: 1.15; }
.desafio-result-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; padding-top: 21px; border-top: 1px solid #dce5ed; }
.desafio-result-breakdown > div { min-width: 0; }
.desafio-result-breakdown p { margin: 0 0 5px; color: var(--desafio-muted); font-size: 13px; }
.desafio-result-breakdown strong { overflow-wrap: anywhere; font-size: 19px; }
.desafio-result-note { margin: auto 0 0; padding-top: 32px; color: var(--desafio-muted); font-size: 13px; }
.desafio-result-stale { margin: 13px 0 0; padding: 10px 12px; border: 1px solid #ebd8a4; border-radius: 4px; background: #fff8e7; color: #6e4b08; font-size: 13px; font-weight: 600; }

.desafio-chart-card { margin-top: 18px; padding: 26px; }
.desafio-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.desafio-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; color: #52697c; font-size: 13px; font-weight: 600; }
.desafio-legend span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.desafio-legend-line { width: 22px; border-top: 3px solid; }
.desafio-legend-total { border-color: #337ab7; }
.desafio-legend-saved { border-color: #718394; border-top-style: dashed; }
.desafio-chart { display: block; width: 100%; height: auto; margin: 20px auto 0; overflow: visible; }
.desafio-chart text { fill: #52697c; font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif; }
.desafio-chart-grid { stroke: #e3ebf1; stroke-width: 1; }
.desafio-chart-line-total { fill: none; stroke: #337ab7; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.desafio-chart-line-saved { fill: none; stroke: #718394; stroke-width: 3; stroke-dasharray: 7 6; stroke-linejoin: round; stroke-linecap: round; }
.desafio-table-details, .desafio-assumptions { padding: 14px 0; border-top: 1px solid #e3ebf1; color: #245782; font-size: 14px; }
.desafio-table-details summary, .desafio-assumptions summary { width: fit-content; cursor: pointer; font-weight: 700; }
.desafio-table-scroll { max-height: 350px; overflow: auto; margin-top: 15px; }
.desafio-table-details table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.desafio-table-details th, .desafio-table-details td { padding: 9px 10px; border-bottom: 1px solid #e3ebf1; text-align: left; }
.desafio-table-details th { color: #29445b; background: #f3f7fa; }
.desafio-assumptions p { max-width: 75ch; margin: 10px 0 0; color: var(--desafio-muted); line-height: 1.5; }
.desafio-footer { border-top: 1px solid #ccd7e0; color: #52697c; font-size: 12px; }
.desafio-footer-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.desafio-indisponivel { min-height: 55vh; padding-top: 80px; padding-bottom: 80px; }
.desafio-indisponivel h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.15; }
.desafio-indisponivel p { color: var(--desafio-muted); }

@media (max-width: 760px) {
    .desafio-header-inner { min-height: 64px; padding: 0 20px; }
    .desafio-brand { gap: 10px; font-size: 10px; }
    .desafio-brand img { width: 85px; }
    .desafio-hero-copy { padding-top: 28px; }
    .desafio-hero-description { font-size: 16px; }
    .desafio-workspace { padding-top: 20px; padding-bottom: 40px; }
    .desafio-calculator-grid { grid-template-columns: 1fr; gap: 14px; }
    .desafio-total-label { margin-top: 24px; }
    .desafio-result-note { padding-top: 24px; }
    .desafio-chart-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .desafio-chart-card { margin-top: 14px; }
}
@media (max-width: 520px) {
    .desafio-container { width: calc(100% - 32px); }
    .desafio-header-inner { padding: 0 16px; }
    .desafio-brand { gap: 7px; }
    .desafio-brand img { width: 78px; }
    .desafio-brand-divider { height: 20px; }
    .desafio-language-link { min-width: 36px; padding: 6px; }
    .desafio-form-card, .desafio-result-card, .desafio-chart-card { padding: 21px; }
    .desafio-two-fields { grid-template-columns: 1fr; gap: 0; }
    .desafio-result-breakdown { gap: 12px; }
    .desafio-result-breakdown strong { font-size: 17px; }
    .desafio-footer-inner { padding: 20px 0; align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 390px) {
    .desafio-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}