/* oszczedzanie.css: styles for the savings calculator only
   (the shared theme lives in ../wspolne/style.css) */

/* === The answer: one big number, then the details === */
.answer-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--accent-text);
    margin: 6px 0 0;
}

.answer-label {
    color: var(--text);
    font-size: 15px;
    margin: 4px 0 0;
}

.answer-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 16px;
}

/* === Option cards: name, result bar, IKE switch, parameters === */
.option-card {
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--option-color);
    border-radius: 8px;
    background: var(--panel-deep);
    padding: 12px 14px 4px;
    margin-bottom: 12px;
}

.option-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.option-swatch {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--option-color);
    filter: var(--series-filter);
}

.option-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-name {
    color: var(--text-strong);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.option-desc {
    color: var(--text-muted);
    font-size: 12px;
}

.option-remove {
    flex: none;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
}

.option-remove:hover,
.option-remove:focus-visible {
    color: var(--pink);
    border-color: var(--pink);
}

/* bar: value in today's money; the thin mark = what you paid in (also in today's money) */
.option-bar {
    position: relative;
    height: 10px;
    margin: 12px 0 8px;
    border-radius: 5px;
    background: var(--input);
}

.option-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 5px;
    background: var(--option-color);
    filter: var(--series-filter);
}

.option-bar-paid {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    background: var(--text);
}

/* over the cards: what the bar and the mark mean (the same shapes, small) */
.bar-legend {
    display: block;
    margin-top: 6px;
}

.legend-bar {
    display: inline-block;
    width: 22px;
    height: 8px;
    border-radius: 4px;
    background: var(--text-muted);
    vertical-align: middle;
}

.legend-mark {
    display: inline-block;
    width: 2px;
    height: 14px;
    margin: 0 2px;
    background: var(--text);
    vertical-align: middle;
}

/* PPK card: what leaves your pocket, and the button that puts it in the plan */
.ppk-pocket {
    margin: 0 0 10px;
}

.ppk-pocket .option-costs {
    margin-bottom: 6px;
}

.ppk-set-plan {
    flex: 0 0 auto;
}

.option-numbers {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0;
    line-height: 1.6;
}

.option-numbers b {
    color: var(--text-strong);
}

.option-numbers b.more {
    color: var(--green);
}

.option-numbers b.less {
    color: var(--pink);
}

.option-costs {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 8px;
}

.option-card .option-ike {
    justify-content: flex-start;
    padding-right: 0;
    margin: 0 0 4px;
}

.option-card .param-details {
    margin: 0;
    padding: 0;
    border: none;
}

/* the parameter fields stay near their labels on wide screens (the explanation uses the full width) */
.option-card .option-params {
    max-width: 560px;
}

.option-card .param-details .details-title {
    font-size: 12px;
}

.option-fee {
    margin: 0 0 12px;
}

/* name of the own option */
.param .text-input {
    grid-column: 2 / 4;
    width: 100%;
    max-width: 220px;
    justify-self: end;
    background: var(--input);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
}

.param .text-input:focus {
    outline: none;
    border-color: #6d4aff;
    box-shadow: 0 0 0 2px rgba(109, 74, 255, 0.25);
}

/* the reference card ("no interest") and the assumptions shared by every calculation */
.option-reference {
    border-style: dashed;
    border-left-style: solid;
}

.common {
    font-size: 12px;
    color: var(--text-soft);
    margin: 0 0 8px;
}

.common b {
    color: var(--text);
}

.common ul {
    margin: 4px 0 0;
    padding-left: 18px;
    line-height: 1.6;
}

/* "Skąd ten wynik": label · amount · what it depends on */
.explain {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 13px;
}

.explain-row {
    display: grid;
    grid-template-columns: 220px 110px 1fr;
    gap: 4px 12px;
    align-items: baseline;
    color: var(--text-soft);
}

.explain-amount {
    text-align: right;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.explain-note {
    font-size: 12px;
    color: var(--text-muted);
}

.explain-row.sum {
    border-top: 1px solid var(--border-strong);
    padding-top: 6px;
}

.explain-row.sum .explain-label {
    color: var(--text);
    font-weight: 600;
}

.explain .more {
    color: var(--green);
}

.explain .less {
    color: var(--pink);
}

.explain-extra {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.6;
}

.explain-extra b {
    color: var(--text);
}

.option-numbers .param-help {
    margin-left: 6px;
}

/* "Na koniec okresu": two buttons in the place of the input */
.param.at-end .segmented {
    grid-column: 2 / 4;
    justify-self: end;
    margin: 0;
}

.param.at-end .param-label {          /* like the labels of the other fields (wspolne/style.css) */
    flex: 1;
    color: var(--text-soft);
    font-size: 13px;
    text-align: right;
}

/* === Adding an option === */
.add-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-soft);
}

.add-option select {
    background: var(--input);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    max-width: 100%;
}

.add-option .segment {
    flex: none;
}

/* === Notes and glossary === */
.notes-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.notes-list li + li {
    margin-top: 8px;
}

.notes-list b {
    color: var(--text);
}

.glossary {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.glossary dt {
    color: var(--text-strong);
    font-weight: 600;
    margin-top: 12px;
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dd {
    margin: 2px 0 0;
    color: var(--text-soft);
}

.glossary a,
.notes-list a {
    color: var(--accent-soft);
}

#glossary .param-details {
    margin: 0;
    padding: 0;
    border: none;
}

/* === Phones: label above the field (same breakpoint as the shared form fields) === */
@media (max-width: 560px) {
    .answer-value {
        font-size: 28px;
    }

    .param .text-input {
        grid-column: 1 / -1;
        max-width: none;
    }

    .explain-row {
        grid-template-columns: 1fr auto;
    }

    .param.at-end .segmented {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .param.at-end .param-label {
        flex: 0 1 auto;
        text-align: left;
    }

    .explain-note {
        grid-column: 1 / -1;
    }
}

/* export under the chart: "Pobierz tabelę: [Arkusz z wykresem (ODS)] albo CSV: rok po roku · miesiąc po miesiącu" */
.export {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-soft);
}

.export-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.export .segment {
    flex: 0 0 auto;
}

.export .hint {
    margin-top: 6px;
}

/* a button that looks like a link (CSV) */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--accent-soft);
    text-decoration: underline;
    cursor: pointer;
}

.link-button:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 2px;
}
