/* Modern Finance Theme Variables */
:root {
    --ft-primary: #0f172a; /* Deep Navy */
    --ft-secondary: #0ea5e9; /* Bright Blue */
    --ft-accent: #10b981; /* Success Green */
    --ft-danger: #ef4444; /* Alert Red */
    --ft-bg: #f8fafc; /* Light Gray Background */
    --ft-card-bg: #ffffff; /* White Card */
    --ft-text: #334155; /* Slate Text */
    --ft-text-light: #64748b; /* Lighter Text */
    --ft-border: #e2e8f0; /* Light Border */
    --ft-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ft-radius: 12px;
    --ft-font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Scoped Utility Classes */
.ft-container {
    font-family: var(--ft-font);
    color: var(--ft-text);
    max-width: 800px;
    margin: 2rem auto;
    background: var(--ft-bg);
    padding: 1rem;
    border-radius: var(--ft-radius);
    box-sizing: border-box;
}

.ft-card {
    background: var(--ft-card-bg);
    border-radius: var(--ft-radius);
    padding: 2rem;
    box-shadow: var(--ft-shadow);
    border: 1px solid var(--ft-border);
    margin-bottom: 2rem;
}

.ft-h1, .ft-h2, .ft-h3 {
    color: var(--ft-primary);
    font-weight: 700;
    margin-top: 0;
}

.ft-h1 { font-size: 2.25rem; margin-bottom: 1.5rem; }
.ft-h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.ft-h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

.ft-form-group {
    margin-bottom: 1.5rem;
}

.ft-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ft-primary);
}

.ft-input, .ft-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--ft-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box; /* Critical for keeping width checks */
}

.ft-input:focus, .ft-select:focus {
    outline: none;
    border-color: var(--ft-secondary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ft-btn {
    display: inline-block;
    background: var(--ft-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: center;
    font-size: 1rem;
}

.ft-btn:hover {
    background: #1e293b;
}

.ft-result-box {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 4px solid var(--ft-secondary);
}

.ft-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.ft-result-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ft-result-label {
    color: var(--ft-text-light);
    font-size: 0.95rem;
}

.ft-result-value {
    font-weight: 700;
    color: var(--ft-primary);
    font-size: 1.1rem;
}

.ft-result-value.highlight {
    color: var(--ft-secondary);
    font-size: 1.25rem;
}

.ft-result-value.danger {
    color: var(--ft-danger);
}

.ft-result-value.success {
    color: var(--ft-accent);
}

.ft-chart-container {
    margin-top: 2rem;
    position: relative;
    height: 300px;
    width: 100%;
}

/* Tool Specific Layouts */
.ft-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .ft-grid-2 {
        grid-template-columns: 1fr;
    }
}
