/* Premium Fintech Theme */
:root {
    /* Colors */
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;

    --primary: #0f172a;
    /* Deep Navy */
    --accent: #22c55e;
    /* Emerald Green */
    --accent-hover: #16a34a;
    --gold: #f59e0b;

    --border: #e2e8f0;
    --input-bg: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Abstract Background */
.fintech-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.geometric-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.circle-1 {
    width: 600px;
    height: 600px;
    background: rgba(34, 197, 94, 0.15);
    /* Emerald tint */
    top: -200px;
    right: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: rgba(15, 23, 42, 0.05);
    /* Navy tint */
    bottom: -100px;
    left: -200px;
}

.glow-bg {
    position: absolute;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, transparent, var(--bg-light) 70%);
}

/* Nav */
.app-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.logo-area {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Layout */
.wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Header */
.app-header {
    text-align: center;
    margin: 2rem 0 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.header-badge {
    background: var(--primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--gold), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.input-panel h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

/* Forms & Inputs */
.fire-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    background: white;
}

.prefix,
.suffix {
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    background: transparent;
    font-size: 0.95rem;
    font-weight: 500;
}

.prefix {
    border-right: 1px solid transparent;
}

.suffix {
    border-left: 1px solid transparent;
}

input[type="number"] {
    flex-grow: 1;
    width: 100%;
    padding: 0.8rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
}

/* Remove spinner arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.highlight-group .input-wrapper {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.02);
}

.calc-btn {
    margin-top: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
    transition: all 0.2s ease;
}

.calc-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
}

/* Results Column */
.results-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid.secondary {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .stats-grid.secondary {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.primary-stat {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--primary), #1e293b);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
}

.primary-stat .stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--gold);
}

.primary-stat h3 {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.primary-stat .accent {
    color: var(--gold);
    font-weight: 700;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-sub-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-sub-val.highlight {
    color: var(--gold);
}

.stat-sub-val.success {
    color: var(--accent);
}

.stat-sub-val .tiny {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Chart Area */
.chart-panel {
    display: flex;
    flex-direction: column;
    height: 400px;
    /* Fixed height for canvas stability */
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.legend-custom {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    align-items: center;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.25rem;
}

.dot-invested {
    background: var(--primary);
}

.dot-interest {
    background: var(--accent);
}

.chart-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
}

/* Footer */
.app-footer {
    margin-top: 3rem;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.app-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}