/* ============================================
   MyFinanceScore — Tools Section Styles
   ============================================ */

/* ── Tools Hero ───────────────────────────── */
.tools-hero {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 50%, #262626 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.tools-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(34,197,94,.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(234,179,8,.06) 0%, transparent 50%);
    pointer-events: none;
}
.tools-hero h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -.03em;
    margin-bottom: .75rem;
}
.tools-hero .lead {
    color: rgba(255,255,255,.7);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.tools-hero .btn-tools-primary {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: .75rem 2rem;
    font-weight: 600;
    border-radius: var(--ff-radius);
    font-size: 1rem;
    transition: all var(--ff-transition);
}
.tools-hero .btn-tools-primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(34,197,94,.3);
}

/* ── Tool Cards (Landing Page) ────────────── */
.tool-card {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 1.75rem;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.tool-card:hover {
    border-color: var(--ff-gray-300);
    box-shadow: var(--ff-shadow-hover);
    transform: translateY(-4px);
    color: inherit;
}
.tool-card .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #fff;
}
.tool-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.tool-card p {
    font-size: .875rem;
    color: var(--ff-gray-500);
    flex-grow: 1;
    margin-bottom: 1rem;
}
.tool-card .tool-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ff-black);
    display: flex;
    align-items: center;
    gap: 4px;
}
.tool-card:hover .tool-link {
    gap: 8px;
}

/* ── Score Ring ────────────────────────────── */
.score-ring-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}
.score-ring-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.score-ring-bg {
    fill: none;
    stroke: var(--ff-gray-200);
    stroke-width: 10;
}
.score-ring-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(.4,0,.2,1), stroke .5s;
}
.score-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.score-ring-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
    display: block;
}
.score-ring-grade {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}
.score-ring-label {
    font-size: .75rem;
    color: var(--ff-gray-500);
    display: block;
    margin-top: 2px;
}

/* ── Sub-score Cards ──────────────────────── */
.score-card {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 1.25rem;
    transition: box-shadow var(--ff-transition);
}
.score-card:hover {
    box-shadow: var(--ff-shadow);
}
.score-card .sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.score-card .sc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
}
.score-card .sc-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ff-gray-700);
}
.score-card .sc-value {
    font-size: .75rem;
    color: var(--ff-gray-500);
    margin-bottom: .5rem;
}
.score-card .sc-bar {
    height: 6px;
    background: var(--ff-gray-100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: .5rem;
}
.score-card .sc-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(.4,0,.2,1);
}
.score-card .sc-score {
    font-size: .8rem;
    font-weight: 700;
}
.score-card .sc-tip {
    font-size: .75rem;
    color: var(--ff-gray-500);
    margin-top: .5rem;
    line-height: 1.4;
}

/* ── Calculator Forms ─────────────────────── */
.calc-form {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 2rem;
}
.calc-form .form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ff-gray-700);
    margin-bottom: .35rem;
}
.calc-form .form-control,
.calc-form .form-select {
    border-radius: var(--ff-radius);
    border: 1px solid var(--ff-gray-300);
    padding: .6rem .85rem;
    font-size: .9rem;
    transition: border-color var(--ff-transition), box-shadow var(--ff-transition);
}
.calc-form .form-control:focus,
.calc-form .form-select:focus {
    border-color: var(--ff-black);
    box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
.calc-form .input-group-text {
    background: var(--ff-gray-50);
    border: 1px solid var(--ff-gray-300);
    font-size: .85rem;
    color: var(--ff-gray-500);
}
.calc-form .form-text {
    font-size: .75rem;
    color: var(--ff-gray-400);
}
.btn-calculate {
    background: var(--ff-black);
    color: #fff;
    border: none;
    padding: .7rem 2rem;
    font-weight: 600;
    border-radius: var(--ff-radius);
    font-size: .95rem;
    transition: all var(--ff-transition);
}
.btn-calculate:hover {
    background: var(--ff-gray-900);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ── Calculator Results Panel ─────────────── */
.calc-result {
    background: var(--ff-gray-50);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 2rem;
    display: none;
}
.calc-result.show {
    display: block;
    animation: fadeSlideIn .4s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.calc-result .result-big {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ff-black);
    line-height: 1.1;
}
.calc-result .result-label {
    font-size: .8rem;
    color: var(--ff-gray-500);
    font-weight: 500;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid var(--ff-gray-200);
    font-size: .875rem;
}
.result-row:last-child {
    border-bottom: none;
}
.result-row .rr-label {
    color: var(--ff-gray-500);
}
.result-row .rr-value {
    font-weight: 600;
}

/* ── Auth Forms ───────────────────────────── */
.auth-wrap {
    max-width: 440px;
    margin: 3rem auto;
}
.auth-form {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--ff-shadow);
}
.auth-form h1 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: .5rem;
}
.auth-form .auth-subtitle {
    text-align: center;
    font-size: .875rem;
    color: var(--ff-gray-500);
    margin-bottom: 1.5rem;
}
.auth-form .form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ff-gray-700);
}
.auth-form .form-control {
    border-radius: var(--ff-radius);
    border: 1px solid var(--ff-gray-300);
    padding: .65rem .85rem;
    font-size: .9rem;
}
.auth-form .form-control:focus {
    border-color: var(--ff-black);
    box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}
.btn-auth {
    background: var(--ff-black);
    color: #fff;
    border: none;
    padding: .7rem;
    font-weight: 600;
    border-radius: var(--ff-radius);
    width: 100%;
    font-size: .95rem;
    transition: all var(--ff-transition);
}
.btn-auth:hover {
    background: var(--ff-gray-900);
    color: #fff;
}
.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--ff-gray-500);
}
.auth-footer a {
    color: var(--ff-black);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover {
    text-decoration: underline;
}
.auth-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--ff-radius);
    padding: .65rem 1rem;
    font-size: .85rem;
    margin-bottom: 1rem;
}
.auth-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    border-radius: var(--ff-radius);
    padding: .65rem 1rem;
    font-size: .85rem;
    margin-bottom: 1rem;
}

/* ── Dashboard ────────────────────────────── */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.dash-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0;
}
.dash-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.dash-stat {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius);
    padding: 1rem 1.25rem;
    text-align: center;
}
.dash-stat .ds-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ff-black);
}
.dash-stat .ds-label {
    font-size: .75rem;
    color: var(--ff-gray-500);
    margin-top: 2px;
}
.dash-tips {
    background: var(--ff-gray-50);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 1.5rem;
}
.dash-tips h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.tip-item {
    display: flex;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--ff-gray-200);
    font-size: .875rem;
}
.tip-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.tip-item i {
    flex-shrink: 0;
    margin-top: 2px;
}
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}
.qa-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ff-gray-700);
    text-decoration: none;
    transition: all var(--ff-transition);
}
.qa-link:hover {
    border-color: var(--ff-gray-300);
    box-shadow: var(--ff-shadow-sm);
    color: var(--ff-black);
}
.qa-link i {
    font-size: 1.1rem;
}

/* ── How It Works ─────────────────────────── */
.how-step {
    text-align: center;
    padding: 1.5rem 1rem;
}
.how-step .step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ff-black);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0 auto .75rem;
}
.how-step h4 {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.how-step p {
    font-size: .85rem;
    color: var(--ff-gray-500);
    margin-bottom: 0;
}

/* ── Stats Row ────────────────────────────── */
.stats-row {
    background: var(--ff-gray-50);
    border-top: 1px solid var(--ff-gray-200);
    border-bottom: 1px solid var(--ff-gray-200);
    padding: 2.5rem 0;
}
.stat-item {
    text-align: center;
}
.stat-item .si-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ff-black);
}
.stat-item .si-label {
    font-size: .8rem;
    color: var(--ff-gray-500);
}

/* ── CTA Section ──────────────────────────── */
.tools-cta {
    background: var(--ff-black);
    color: #fff;
    border-radius: var(--ff-radius-lg);
    padding: 3rem 2rem;
    text-align: center;
}
.tools-cta h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
}
.tools-cta p {
    color: rgba(255,255,255,.7);
    margin-bottom: 1.5rem;
    font-size: .95rem;
}
.tools-cta .btn-tools-cta {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: .7rem 2rem;
    font-weight: 600;
    border-radius: var(--ff-radius);
    font-size: .95rem;
    transition: all var(--ff-transition);
    text-decoration: none;
    display: inline-block;
}
.tools-cta .btn-tools-cta:hover {
    background: #16a34a;
    color: #fff;
    transform: translateY(-1px);
}

/* ── Breadcrumb (tools pages) ─────────────── */
.tools-breadcrumb {
    padding: 1rem 0;
    font-size: .8rem;
}
.tools-breadcrumb a {
    color: var(--ff-gray-500);
    text-decoration: none;
}
.tools-breadcrumb a:hover {
    color: var(--ff-black);
}
.tools-breadcrumb .separator {
    color: var(--ff-gray-400);
    margin: 0 .35rem;
}
.tools-breadcrumb .current {
    color: var(--ff-gray-700);
    font-weight: 500;
}

/* ── Debt Table ───────────────────────────── */
.debt-entry {
    background: var(--ff-gray-50);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius);
    padding: 1rem;
    margin-bottom: .75rem;
}
.debt-entry .form-control {
    border-radius: var(--ff-radius);
    border: 1px solid var(--ff-gray-300);
    padding: .5rem .7rem;
    font-size: .85rem;
}
.btn-remove-debt {
    background: none;
    border: none;
    color: var(--ff-gray-400);
    font-size: 1.1rem;
    padding: .25rem .5rem;
    cursor: pointer;
    transition: color var(--ff-transition);
}
.btn-remove-debt:hover {
    color: #ef4444;
}

/* ── Net Worth Groups ─────────────────────── */
.nw-group {
    margin-bottom: 1.5rem;
}
.nw-group h5 {
    font-size: .9rem;
    font-weight: 700;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--ff-gray-200);
    margin-bottom: 1rem;
}
.nw-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}
.nw-item label {
    flex: 0 0 140px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--ff-gray-700);
}
.nw-item .form-control {
    flex: 1;
}

/* ── Chart Placeholder ────────────────────── */
.chart-wrap {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.chart-wrap h4 {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
}
.chart-bar {
    flex: 1;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    transition: height .5s cubic-bezier(.4,0,.2,1);
    position: relative;
}
.chart-bar:hover {
    opacity: .8;
}

/* ── Amortization Table ───────────────────── */
.amort-table {
    width: 100%;
    font-size: .8rem;
    border-collapse: collapse;
}
.amort-table th {
    background: var(--ff-gray-50);
    font-weight: 600;
    color: var(--ff-gray-700);
    padding: .5rem .6rem;
    border-bottom: 2px solid var(--ff-gray-200);
    text-align: left;
}
.amort-table td {
    padding: .45rem .6rem;
    border-bottom: 1px solid var(--ff-gray-100);
    color: var(--ff-gray-700);
}
.amort-table tbody tr:hover {
    background: var(--ff-gray-50);
}

/* ── Financial Tools Sidebar CTA ──────────── */
.sidebar-tools-cta {
    background: linear-gradient(135deg, #111 0%, #262626 100%);
    border-radius: var(--ff-radius-lg);
    padding: 1.25rem;
    text-align: center;
    color: #fff;
}
.sidebar-tools-cta h5 {
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .35rem;
}
.sidebar-tools-cta p {
    font-size: .75rem;
    color: rgba(255,255,255,.65);
    margin-bottom: .75rem;
}
.sidebar-tools-cta .btn-sm {
    background: #22c55e;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: .8rem;
    padding: .4rem 1.25rem;
    border-radius: var(--ff-radius);
    text-decoration: none;
    transition: all var(--ff-transition);
    display: inline-block;
}
.sidebar-tools-cta .btn-sm:hover {
    background: #16a34a;
    color: #fff;
}

/* ── Update Finance Modal ─────────────────── */
.finance-modal .modal-content {
    border-radius: var(--ff-radius-lg);
    border: none;
    box-shadow: var(--ff-shadow-lg);
}
.finance-modal .modal-header {
    border-bottom: 1px solid var(--ff-gray-200);
    padding: 1.25rem 1.5rem;
}
.finance-modal .modal-body {
    padding: 1.5rem;
}
.finance-modal .modal-footer {
    border-top: 1px solid var(--ff-gray-200);
    padding: 1rem 1.5rem;
}

/* ── Pie Chart (CSS) ──────────────────────── */
.pie-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
}
.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: 1rem;
}
.pie-legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--ff-gray-700);
}
.pie-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Comparison Cards ─────────────────────── */
.compare-card {
    background: var(--ff-white);
    border: 1px solid var(--ff-gray-200);
    border-radius: var(--ff-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow var(--ff-transition);
}
.compare-card:hover {
    box-shadow: var(--ff-shadow);
}
.compare-card.recommended {
    border-color: #22c55e;
    position: relative;
}
.compare-card.recommended::after {
    content: 'Recommended';
    position: absolute;
    top: -.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    padding: .2rem .75rem;
    border-radius: 99px;
}
.compare-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 991.98px) {
    .tools-hero {
        padding: 3rem 0 2.5rem;
    }
    .tools-hero h1 {
        font-size: 1.75rem;
    }
    .score-ring-wrap {
        width: 160px;
        height: 160px;
    }
    .score-ring-number {
        font-size: 2rem;
    }
    .calc-form,
    .calc-result {
        padding: 1.5rem;
    }
}
@media (max-width: 575.98px) {
    .tools-hero h1 {
        font-size: 1.5rem;
    }
    .tools-hero .lead {
        font-size: .95rem;
    }
    .score-ring-wrap {
        width: 140px;
        height: 140px;
    }
    .score-ring-number {
        font-size: 1.75rem;
    }
    .calc-form,
    .calc-result {
        padding: 1.25rem;
    }
    .auth-form {
        padding: 1.75rem 1.25rem;
    }
    .dash-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-actions {
        grid-template-columns: 1fr;
    }
    .nw-item {
        flex-direction: column;
        align-items: stretch;
    }
    .nw-item label {
        flex: none;
    }
}
