/* ═══════════════════════════════════════════════════════════════════════════
 * FUTURE VALUE CALCULATOR — Scoped Styles
 * File: assets/css/future-value-calc.css
 *
 * All rules are namespaced under #fvc-app or .fvc-* to avoid conflicts.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── WIDGET WRAPPER ────────────────────────────────────────────────────── */
.fvc-wrap {
    width: 100%;
}

/* ── TABS ──────────────────────────────────────────────────────────────── */
.fvc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--clr-bg-muted, #f1f5f9);
    border-radius: 10px;
    padding: 4px;
}

.fvc-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-secondary, #475569);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.fvc-tab:hover {
    background: var(--clr-accent-hover, #bae6fd);
    color: var(--clr-accent-dark, #0369a1);
}

.fvc-tab--active {
    background: #ffffff;
    color: var(--clr-accent-dark, #0369a1);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── INPUT GRID ────────────────────────────────────────────────────────── */
.fvc-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin-bottom: 18px;
}

@media (max-width: 600px) {
    .fvc-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ── FIELD ─────────────────────────────────────────────────────────────── */
.fvc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fvc-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clr-text-primary, #0f172a);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    line-height: 1.2;
}

.fvc-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--clr-text-muted, #94a3b8);
    background: var(--clr-bg-muted, #f1f5f9);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.fvc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fvc-prefix,
.fvc-suffix {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--clr-text-muted, #94a3b8);
    pointer-events: none;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.fvc-prefix { left: 11px; }
.fvc-suffix { right: 11px; }

.fvc-input {
    width: 100%;
    padding: 9px 32px 9px 11px;
    border: 1.5px solid var(--clr-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--clr-text-primary, #0f172a);
    background: var(--clr-bg, #ffffff);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    min-width: 0;
}

.fvc-input::-webkit-outer-spin-button,
.fvc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fvc-input[id="fvc-principal"],
.fvc-input[id="fvc-contrib"] {
    padding-left: 26px;
}

.fvc-input:focus {
    border-color: var(--clr-accent, #0ea5e9);
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(14,165,233,0.15));
}

.fvc-input:hover:not(:focus) {
    border-color: var(--clr-text-muted, #94a3b8);
}

.fvc-desc {
    font-size: 0.7rem;
    color: var(--clr-text-muted, #94a3b8);
    line-height: 1.3;
}

/* ── SELECT ─────────────────────────────────────────────────────────────── */
.fvc-select-wrap {
    position: relative;
}

.fvc-select-wrap::after {
    content: '';
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--clr-text-muted, #94a3b8);
    pointer-events: none;
}

.fvc-select {
    width: 100%;
    padding: 9px 32px 9px 11px;
    border: 1.5px solid var(--clr-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--clr-text-primary, #0f172a);
    background: var(--clr-bg, #ffffff);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.fvc-select:focus {
    border-color: var(--clr-accent, #0ea5e9);
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(14,165,233,0.15));
}

/* ── ACTION BUTTONS ─────────────────────────────────────────────────────── */
.fvc-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.fvc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 22px;
    transition: background 0.18s ease, color 0.18s ease,
                box-shadow 0.18s ease, transform 0.1s ease;
    white-space: nowrap;
    outline: none;
    line-height: 1;
}

.fvc-btn:active {
    transform: translateY(1px);
}

.fvc-btn--primary {
    background: var(--clr-accent, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(14,165,233,0.28);
}

.fvc-btn--primary:hover {
    background: var(--clr-accent-dark, #0369a1);
    box-shadow: 0 4px 14px rgba(14,165,233,0.38);
}

.fvc-btn--primary:focus-visible {
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(14,165,233,0.15));
}

.fvc-btn--ghost {
    background: var(--clr-bg-muted, #f1f5f9);
    color: var(--clr-text-secondary, #475569);
    border: 1.5px solid var(--clr-border, #e2e8f0);
}

.fvc-btn--ghost:hover {
    background: var(--clr-bg-soft, #f8fafc);
    border-color: var(--clr-text-muted, #94a3b8);
    color: var(--clr-text-primary, #0f172a);
}

/* ── RESULTS ────────────────────────────────────────────────────────────── */
.fvc-results {
    margin-top: 22px;
    border-top: 1.5px solid var(--clr-border-soft, #f1f5f9);
    padding-top: 20px;
    animation: fvcFadeIn 0.32s ease;
}

@keyframes fvcFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Results grid */
.fvc-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

@media (max-width: 700px) {
    .fvc-results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .fvc-results-grid {
        grid-template-columns: 1fr;
    }
}

.fvc-result-card {
    background: var(--clr-bg-soft, #f8fafc);
    border: 1.5px solid var(--clr-border, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.18s ease;
}

.fvc-result-card:hover {
    border-color: var(--clr-accent, #0ea5e9);
}

.fvc-result-card--primary {
    background: var(--clr-accent-light, #e0f2fe);
    border-color: var(--clr-accent, #0ea5e9);
    grid-column: span 1;
}

.fvc-result-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--clr-text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.fvc-result-card--primary .fvc-result-label {
    color: var(--clr-accent-dark, #0369a1);
}

.fvc-result-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-text-primary, #0f172a);
    line-height: 1.2;
    word-break: break-word;
}

.fvc-result-card--primary .fvc-result-value {
    color: var(--clr-accent-dark, #0369a1);
    font-size: 1.3rem;
}

/* ── BREAKDOWN BAR ──────────────────────────────────────────────────────── */
.fvc-breakdown {
    margin-bottom: 16px;
}

.fvc-breakdown-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--clr-text-secondary, #475569);
    margin-bottom: 7px;
}

.fvc-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--clr-bg-muted, #f1f5f9);
    margin-bottom: 8px;
}

.fvc-bar__principal {
    background: var(--clr-accent, #0ea5e9);
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    height: 100%;
}

.fvc-bar__interest {
    background: var(--clr-interest, #fbbf24);
    transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
    height: 100%;
}

.fvc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.fvc-legend__item {
    font-size: 0.75rem;
    color: var(--clr-text-secondary, #475569);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fvc-legend__item::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.fvc-legend__principal::before { background: var(--clr-accent, #0ea5e9); }
.fvc-legend__interest::before  { background: var(--clr-interest, #fbbf24); }

/* ── TABLE TOGGLE ───────────────────────────────────────────────────────── */
.fvc-table-toggle {
    margin-top: 4px;
}

.fvc-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1.5px solid var(--clr-border, #e2e8f0);
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--clr-text-secondary, #475569);
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
    outline: none;
}

.fvc-toggle-btn:hover {
    border-color: var(--clr-accent, #0ea5e9);
    color: var(--clr-accent-dark, #0369a1);
    background: var(--clr-accent-light, #e0f2fe);
}

.fvc-toggle-btn:focus-visible {
    box-shadow: var(--shadow-focus, 0 0 0 4px rgba(14,165,233,0.15));
}

/* ── GROWTH TABLE ───────────────────────────────────────────────────────── */
.fvc-table-wrap {
    margin-top: 14px;
    animation: fvcFadeIn 0.25s ease;
}

.fvc-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1.5px solid var(--clr-border, #e2e8f0);
    border-radius: 10px;
}

.fvc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 560px;
}

.fvc-table thead {
    background: var(--clr-bg-muted, #f1f5f9);
    position: sticky;
    top: 0;
    z-index: 1;
}

.fvc-table th {
    padding: 9px 12px;
    text-align: right;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--clr-text-secondary, #475569);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1.5px solid var(--clr-border, #e2e8f0);
}

.fvc-table th:first-child {
    text-align: left;
    border-radius: 10px 0 0 0;
}

.fvc-table th:last-child {
    border-radius: 0 10px 0 0;
}

.fvc-table td {
    padding: 8px 12px;
    text-align: right;
    color: var(--clr-text-secondary, #475569);
    border-bottom: 1px solid var(--clr-border-soft, #f1f5f9);
    white-space: nowrap;
}

.fvc-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--clr-text-primary, #0f172a);
}

.fvc-table tbody tr:last-child td {
    border-bottom: none;
    font-weight: 700;
    color: var(--clr-text-primary, #0f172a);
    background: var(--clr-accent-light, #e0f2fe);
}

.fvc-table tbody tr:hover:not(:last-child) td {
    background: var(--clr-bg-soft, #f8fafc);
}

.fvc-table tbody tr:nth-child(even):not(:last-child) td {
    background: var(--clr-bg-soft, #f8fafc);
}

.fvc-table tbody tr:nth-child(even):hover:not(:last-child) td {
    background: var(--clr-accent-light, #e0f2fe);
}

/* ── CONTRIBUTION FIELDS TRANSITION ────────────────────────────────────── */
.fvc-contrib-field {
    transition: opacity 0.2s ease;
}
