/* Página de Juros Simples */

.simple-layout {
    width: min(1280px, calc(100vw - 48px));
    max-width: 1280px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 32px;
    align-items: stretch;
}

.simple-form {
    width: 100%;
    max-width: 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.simple-form .button-primary {
    margin-top: auto;
}

.simple-result-card {
    width: 100%;
    max-width: none;
}

/* Nota visual dentro do formulário */

.simple-form-note {
    margin-top: 10px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.simple-form-note strong {
    display: block;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.simple-note-list {
    display: grid;
    gap: 8px;
}

.simple-note-list span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.simple-note-list span::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* Cards do resultado */

.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.result-summary-grid > div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
}

.result-summary-grid > div span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 7px;
}

.result-summary-grid > div strong {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 900;
}

.result-summary-grid > div:last-child {
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.18);
}

/* Composição do resultado */

.composition-card {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.composition-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.composition-header h3 {
    color: var(--text);
    margin-bottom: 6px;
}

.composition-header p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.composition-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

.composition-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 26px;
    align-items: center;
}

.composition-donut {
    width: 170px;
    height: 170px;
}

.composition-breakdown {
    display: grid;
    gap: 14px;
}

.composition-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
}

.composition-item div {
    display: grid;
    gap: 3px;
}

.composition-item strong {
    color: var(--text);
}

.composition-item small {
    color: var(--muted);
    font-weight: 800;
}

.composition-final {
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.2);
}

.composition-final-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 900;
}

/* Botão evolução */

.cf-evolution-button {
    width: 100%;
    margin-top: 22px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.10);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    text-align: left;
    font: inherit;
}

.cf-evolution-button:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.16);
}

.cf-evolution-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 900;
    font-size: 1.15rem;
}

.cf-evolution-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cf-evolution-copy strong {
    color: var(--text);
    font-size: 1rem;
}

.cf-evolution-copy small {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.cf-evolution-meta {
    padding: 7px 11px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 900;
    border: 1px solid rgba(37, 99, 235, 0.18);
    white-space: nowrap;
}

.cf-evolution-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
    transition: transform 0.15s ease;
}

.cf-evolution-button[aria-expanded="true"] .cf-evolution-arrow {
    transform: rotate(180deg);
}

/* Área larga da evolução */

.cf-evolution-wide-area {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.cf-evolution-panel[hidden] {
    display: none !important;
}

.cf-evolution-content-wide {
    margin-top: 28px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.cf-bar-chart-card-wide {
    width: 100%;
    margin-top: 20px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.cf-bar-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.cf-bar-chart-header h3 {
    color: var(--text);
    margin-bottom: 6px;
}

.cf-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.9rem;
}

.cf-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cf-bar-chart-scroll {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.cf-bar-chart-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 380px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.cf-chart-axis {
    stroke: #cbd5e1;
    stroke-width: 1;
}

.cf-chart-grid {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.cf-chart-y-label,
.cf-chart-x-label,
.cf-chart-axis-label {
    fill: var(--muted);
    font-size: 10px;
    font-weight: 800;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.cf-bar-contributed {
    fill: #475569;
}

.cf-bar-interest {
    fill: #bfdbfe;
}

.cf-bar-group:hover .cf-bar-contributed {
    fill: #334155;
}

.cf-bar-group:hover .cf-bar-interest {
    fill: #93c5fd;
}

.cf-evolution-table {
    margin-top: 22px;
    max-width: 100%;
    overflow-x: auto;
}

/* Mobile */

@media (max-width: 1023px) {
    .simple-layout {
        width: min(100%, calc(100vw - 32px));
        grid-template-columns: 1fr;
    }

    .simple-form {
        max-width: none;
        height: auto;
    }

    .simple-form .button-primary {
        margin-top: 18px;
    }
}

@media (max-width: 860px) {
    .composition-header,
    .cf-bar-chart-header {
        flex-direction: column;
    }

    .composition-body {
        grid-template-columns: 1fr;
    }

    .composition-donut {
        margin: 0 auto;
    }

    .cf-evolution-button {
        grid-template-columns: auto 1fr auto;
    }

    .cf-evolution-meta {
        display: none;
    }

    .result-summary-grid {
        grid-template-columns: 1fr;
    }
}

.result-card-empty {
    align-self: start;
    height: auto;
    min-height: 0;
}

.result-empty-state {
    padding: 4px 0 2px;
}

.result-empty-state .muted {
    margin: 0;
}