/* ── costs.css — Stili per pagina /costi (CostiPage handoff) ── */

/* ── Page layout ── */
.costi-page-main {
    padding-top: calc(var(--header-h, 76px) + 0.5rem);
    padding-bottom: 92px;
}

.costi-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Desktop: più padding laterale */
@media (min-width: 769px) {
    .costi-page-main {
        padding: calc(var(--header-h, 76px) + 2rem) 2rem 2rem;
    }
}

/* ── Hero savings card ── */
.costi-hero {
    background: linear-gradient(155deg, #2ECC40, #1f8f2f);
    border-radius: 22px;
    padding: 22px;
    color: #fff;
    box-shadow: 0 16px 36px rgba(46, 204, 64, 0.25);
    position: relative;
    overflow: hidden;
    margin: 0 12px 14px;
}

[data-theme="dark"] .costi-hero {
    box-shadow: 0 16px 36px rgba(46, 204, 64, 0.15);
}

.costi-hero__deco {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.costi-hero__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.costi-hero__amount {
    font-size: 46px;
    font-weight: 800;
    margin-top: 4px;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.costi-hero__sub {
    font-size: 13px;
    margin-top: 6px;
    opacity: 0.9;
}

.costi-hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.25);
}

.costi-hero__grid-label {
    font-size: 10px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.costi-hero__grid-value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* ── Stat tiles row ── */
.costi-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
    margin-left: 12px;
    margin-right: 12px;
}

/* ── Segmented control ── */
.costi-segment {
    display: flex;
    background: var(--card-inset);
    border-radius: 10px;
    border: 0.5px solid var(--border, #e2e8f0);
    padding: 2px;
    margin: 18px 12px 12px;
}

[data-theme="dark"] .costi-segment {
    border-color: var(--border, #333);
}

.costi-segment__item {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 0;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.costi-segment__item.active {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

[data-theme="dark"] .costi-segment__item.active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ── Trend chart card ── */
.costi-chart-card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 0.5px solid var(--border, #e2e8f0);
    padding: 16px;
    margin: 0 12px;
}

.costi-chart-card__eyebrow {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.costi-chart-card__value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

[data-theme="dark"] .costi-chart-card {
    border-color: var(--border, #333);
}

.costi-chart-card__delta {
    font-size: 13px;
    font-weight: 600;
    color: #2ECC40;
    margin-top: 4px;
}

/* ── Goals section ── */
.costi-goals {
    margin-top: 22px;
    margin-left: 12px;
    margin-right: 12px;
}

.costi-goals__header {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 18px 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.costi-goals__list {
    border: 0.5px solid var(--border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
}

[data-theme="dark"] .costi-goals__list {
    border-color: var(--border, #333);
}

.costi-goal {
    background: var(--card-bg);
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--sep);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.costi-goal:last-child {
    border-bottom: none;
}

.costi-goal__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-inset);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.costi-goal__icon--done {
    background: rgba(46, 204, 64, 0.13);
}

.costi-goal__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.costi-goal__badge {
    font-size: 10px;
    background: #2ECC40;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: inline-block;
    margin-left: 8px;
}

.costi-goal__detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

.costi-goal__bar {
    height: 6px;
    background: var(--card-inset);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.costi-goal__bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.costi-goal__bar-fill--done {
    background: #2ECC40;
}

.costi-goal-add {
    margin-top: 10px;
    background: var(--card-bg);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--sep);
    transition: background 0.2s, border-color 0.2s;
}

[data-theme="dark"] .costi-goal-add {
    border-color: var(--border, #333);
}

@media (hover: hover) {
    .costi-goal-add:hover {
        background: var(--card-inset);
    }
}

.costi-goal-add__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(59, 113, 219, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ── Breakdown card ── */
.costi-breakdown {
    margin-top: 22px;
    margin-left: 12px;
    margin-right: 12px;
    background: var(--card-bg);
    border-radius: 18px;
    border: 0.5px solid var(--border, #e2e8f0);
    padding: 18px;
}

[data-theme="dark"] .costi-breakdown {
    border-color: var(--border, #333);
}

.costi-breakdown__title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.costi-breakdown__row {
    margin-top: 10px;
}

.costi-breakdown__row-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
}

.costi-breakdown__bar-track {
    height: 8px;
    background: var(--card-inset);
    border-radius: 4px;
    overflow: hidden;
}

.costi-breakdown__bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
}

.costi-breakdown__bar-fill--dashed {
    background: repeating-linear-gradient(
        90deg,
        var(--primary) 0 6px,
        transparent 6px 10px
    );
}

/* ── Insight callout ── */
.costi-insight {
    margin-top: 18px;
    margin-left: 12px;
    margin-right: 12px;
    padding: 14px 16px;
    background: rgba(59, 113, 219, 0.04);
    border: 0.5px solid rgba(59, 113, 219, 0.19);
    border-radius: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

[data-theme="dark"] .costi-insight {
    background: rgba(59, 113, 219, 0.06);
    border-color: rgba(59, 113, 219, 0.25);
}

.costi-insight__icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.costi-insight__content {
    flex: 1;
}

.costi-insight__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.costi-insight__sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

/* ── Costi page: evo-grouped-card alignment ── */
.costi-content .evo-grouped-card {
    margin-left: 12px;
    margin-right: 12px;
}

/* ── Costi page: evo-section-label alignment ── */
.costi-content .evo-section-label {
    color: var(--text-muted, #64748b);
}

/* ── Costi page: value text contrast in dark ── */
.costi-content .evo-list-row__value {
    color: var(--text);
    font-weight: 600;
}
