.ci-sim-financiamento {
    --ci-sim-accent: var(--primary, #1f2937);
    --ci-sim-accent-text: #ffffff;
    --ci-sim-bg: transparent;
    --ci-sim-card: transparent;
    --ci-sim-border: #d1d5db;
    --ci-sim-text: #111827;
    --ci-sim-muted: #4b5563;
    --ci-sim-value: var(--ci-sim-accent);
    --ci-sim-highlight: #f3f4f6;
    clear: both;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--ci-sim-text);
    font-size: 0.95rem;
    line-height: 1.45;
}

.ci-sim-financiamento--embedded {
    margin-top: 0;
}

.ci-sim-financiamento [hidden] {
    display: none !important;
}

.ci-sim-financiamento *,
.ci-sim-financiamento *::before,
.ci-sim-financiamento *::after {
    box-sizing: border-box;
}

.ci-sim-financiamento__subtitulo {
    margin: 0 0 1rem;
    color: var(--ci-sim-muted);
    font-size: 0.9rem;
}

.ci-sim-financiamento__grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .ci-sim-financiamento__grid {
        grid-template-columns: 1.15fr 0.85fr;
        align-items: start;
    }
}

.ci-sim-financiamento__campos {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: var(--ci-sim-text);
}

.ci-sim-financiamento__resultados {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1rem;
    color: #111827;
}

.ci-sim-financiamento__campo {
    margin-bottom: 1rem;
}

.ci-sim-financiamento__campo:last-child {
    margin-bottom: 0;
}

.ci-sim-financiamento__label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 0.75rem;
    margin-bottom: 0.35rem;
}

.ci-sim-financiamento__label {
    font-weight: 600;
    color: #374151;
}

.ci-sim-financiamento__selo {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    background: var(--ci-sim-highlight);
    border: 1px solid var(--ci-sim-border);
    color: #4b5563;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ci-sim-financiamento__valor-lado {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--ci-sim-value);
    white-space: nowrap;
}

.ci-sim-financiamento__hint {
    display: block;
    margin-top: 0.25rem;
    color: #4b5563;
    font-size: 0.8rem;
}

.ci-sim-financiamento__hint strong {
    color: #111827;
    font-weight: 700;
}

.ci-sim-financiamento input[type="range"] {
    width: 100%;
    margin: 0.15rem 0;
    accent-color: var(--ci-sim-accent);
    cursor: pointer;
}

.ci-sim-financiamento input[type="range"]:focus-visible {
    outline: 2px solid var(--ci-sim-accent);
    outline-offset: 3px;
}

.ci-sim-financiamento__sistema {
    display: inline-flex;
    width: 100%;
    border: 1px solid var(--ci-sim-border);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ci-sim-financiamento__sistema-btn {
    flex: 1;
    border: 0;
    background: transparent;
    color: #4b5563;
    padding: 0.65rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.ci-sim-financiamento__sistema-btn.is-active {
    background: var(--ci-sim-accent);
    color: var(--ci-sim-accent-text);
}

.ci-sim-financiamento__sistema-btn:focus-visible {
    outline: 2px solid var(--ci-sim-accent);
    outline-offset: -2px;
    z-index: 1;
}

.ci-sim-financiamento__destaque {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.ci-sim-financiamento__destaque-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
}

.ci-sim-financiamento__destaque-valor {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ci-sim-accent);
    font-variant-numeric: tabular-nums;
}

.ci-sim-financiamento__destaque-nota {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #4b5563;
}

.ci-sim-financiamento__lista {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    color: #374151;
}

.ci-sim-financiamento__lista li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.ci-sim-financiamento__lista li:last-child {
    border-bottom: 0;
}

.ci-sim-financiamento__lista span:last-child {
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ci-sim-financiamento__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 4px;
    background: var(--ci-sim-accent);
    color: var(--ci-sim-accent-text);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ci-sim-financiamento__cta:hover {
    filter: brightness(0.94);
    color: var(--ci-sim-accent-text);
    text-decoration: none;
}

.ci-sim-financiamento__cta:focus-visible {
    outline: 2px solid var(--ci-sim-accent);
    outline-offset: 3px;
}

/* Temas escuros (ex.: deivith) */
.ci-sim-financiamento--escuro {
    --ci-sim-muted: #cbd5e1;
    --ci-sim-border: #64748b;
    --ci-sim-value: #ffffff;
    --ci-sim-highlight: rgba(255, 255, 255, 0.08);
    --ci-sim-text: #f8fafc;
    color: #f8fafc;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__subtitulo,
.ci-sim-financiamento--escuro .ci-sim-financiamento__label,
.ci-sim-financiamento--escuro .ci-sim-financiamento__hint {
    color: #e2e8f0;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__hint strong,
.ci-sim-financiamento--escuro .ci-sim-financiamento__valor-lado {
    color: #ffffff;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__selo {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #f8fafc;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados {
    background: #ffffff;
    color: #111827;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-label,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-nota,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__lista {
    color: #4b5563;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span:last-child {
    color: #111827;
}

.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-valor {
    color: var(--ci-sim-accent);
}

/* Dark mode Tailwind (srfalpha / eduardo) */
html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro),
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) {
    --ci-sim-muted: #cbd5e1;
    --ci-sim-text: #f8fafc;
    --ci-sim-value: #ffffff;
    color: #f8fafc;
}

html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__label,
html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__subtitulo,
html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__hint,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__label,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__subtitulo,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__hint {
    color: #e2e8f0;
}

html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__hint strong,
html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__valor-lado,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__hint strong,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__valor-lado {
    color: #ffffff;
}

html.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__selo,
.dark .ci-sim-financiamento:not(.ci-sim-financiamento--escuro) .ci-sim-financiamento__selo {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #f8fafc;
}

/* Painel de resultados: sempre texto escuro no card branco (não herdar !important do tema) */
html.dark .ci-sim-financiamento__resultados,
.dark .ci-sim-financiamento__resultados,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados {
    background: #ffffff !important;
    color: #111827 !important;
}

html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-label,
html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-nota,
html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista,
html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-label,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-nota,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-label,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-nota,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__lista,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span {
    color: #374151 !important;
}

html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-valor,
html.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span:last-child,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-valor,
.dark .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span:last-child,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__destaque-valor,
.ci-sim-financiamento--escuro .ci-sim-financiamento__resultados .ci-sim-financiamento__lista span:last-child {
    color: #111827 !important;
}

@media (prefers-reduced-motion: reduce) {
    .ci-sim-financiamento__cta,
    .ci-sim-financiamento__sistema-btn {
        transition: none;
    }
}
