/* ============================================= */
/* Patrimoine — Design System v2                 */
/* Intentional. Financial. Serious.              */
/* ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---- Design Tokens ---- */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* One primary, deeply intentional */
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-surface: rgba(26, 58, 92, 0.04);

    /* Warm neutrals, not cold grays */
    --bg: #f8f7f5;
    --surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;
    --border: #eae8e4;

    /* Desaturated semantic — color the number, not the card */
    --positive: #1a7a4a;
    --positive-bg: rgba(26, 122, 74, 0.06);
    --warning: #9a6700;
    --warning-bg: rgba(154, 103, 0, 0.06);
    --negative: #b53030;
    --negative-bg: rgba(181, 48, 48, 0.06);

    /* Shadows: real depth, no borders */
    --shadow-rest: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-raised: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-elevated: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --ease: all 0.2s ease;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    letter-spacing: -0.011em;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

/* ---- Navbar ---- */
.navbar-premium {
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

/* Brand */
.navbar-brand-premium {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
    letter-spacing: -0.03em;
}
.navbar-brand-premium:hover { color: var(--primary); }
.navbar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.875rem;
}

/* Desktop nav pills */
.navbar-nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.03);
    border-radius: 980px;
    padding: 3px;
}
.navbar-nav-item {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 7px 16px;
    border-radius: 980px;
    text-decoration: none;
    transition: var(--ease);
    white-space: nowrap;
}
.navbar-nav-item i { font-size: 0.75rem; margin-right: 4px; }
.navbar-nav-item:hover {
    color: var(--text-primary);
}
.navbar-nav-item.active {
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* User pill */
.navbar-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 980px;
    padding: 4px 6px 4px 4px;
}
.navbar-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.navbar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--ease);
    flex-shrink: 0;
}
.navbar-logout-btn:hover {
    background: var(--negative-bg);
    color: var(--negative);
}

/* ---- Buttons ---- */
.btn-premium {
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 980px;
    border: none;
    cursor: pointer;
    transition: var(--ease);
    letter-spacing: -0.01em;
}
.btn-premium-primary {
    background: var(--primary);
    color: #fff;
}
.btn-premium-primary:hover {
    background: var(--primary-light);
    color: #fff;
}
.btn-premium-secondary {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}
.btn-premium-secondary:hover {
    background: rgba(0,0,0,0.09);
}
.btn-premium-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--primary);
}
.btn-premium-outline:hover {
    border-color: var(--primary);
    background: var(--primary-surface);
}
.btn-premium-danger {
    background: var(--negative-bg);
    color: var(--negative);
}
.btn-premium-danger:hover {
    background: rgba(181, 48, 48, 0.12);
}
.btn-premium-success {
    background: var(--primary);
    color: #fff;
}
.btn-premium-success:hover {
    background: var(--primary-light);
    color: #fff;
}

/* ---- Cards: shadow-first, no border ---- */
.card-premium {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-rest);
    transition: var(--ease);
    overflow: hidden;
}
.card-premium:hover {
    box-shadow: var(--shadow-raised);
}
.card-premium .card-body {
    padding: 28px 32px;
}

/* ---- Metric Cards ---- */
.metric-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow-rest);
    transition: var(--ease);
}
.metric-card:hover {
    box-shadow: var(--shadow-raised);
}

.metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}

/* Color the number only, not the card */
.metric-value.accent { color: var(--primary); }
.metric-value.success { color: var(--positive); }
.metric-value.danger { color: var(--negative); }
.metric-value.warning { color: var(--warning); }

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* ---- Hero Metric: the story's headline ---- */
.metric-hero {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-raised);
    text-align: center;
}
.metric-hero .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.metric-hero .metric-label {
    font-size: 0.75rem;
    margin-bottom: 12px;
}
.metric-hero .metric-sub {
    margin-top: 8px;
}

/* ---- Emphasized metric: key insight, stands out ---- */
.metric-card.metric-emphasis {
    box-shadow: var(--shadow-raised);
    position: relative;
}
.metric-card.metric-emphasis::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Quiet metric: supporting data, less visual weight */
.metric-card.metric-quiet {
    background: var(--bg);
    box-shadow: none;
}
.metric-card.metric-quiet .metric-value {
    font-size: 1.375rem;
    color: var(--text-secondary);
}

/* Indicator: only a subtle left accent line */
.metric-card.indicator-success { border-left: 3px solid var(--positive); }
.metric-card.indicator-warning { border-left: 3px solid var(--warning); }
.metric-card.indicator-danger { border-left: 3px solid var(--negative); }

/* ---- Section headers ---- */
.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 2px;
}

/* ---- Page headers ---- */
.page-header {
    margin-bottom: 40px;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.page-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- Forms ---- */
.form-control, .form-select {
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.9375rem;
    transition: var(--ease);
    background: var(--surface);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}
.form-control::placeholder {
    color: var(--text-muted);
}
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.input-group-text {
    font-family: var(--font);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-left: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ---- Wizard Sidebar ---- */
.wizard-sidebar {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-rest);
    overflow: hidden;
}
.wizard-sidebar-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}
.wizard-sidebar-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
}
.wizard-step-list {
    list-style: none;
    padding: 8px;
    margin: 0;
}
.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--ease);
    margin-bottom: 2px;
}
.wizard-step-item:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-primary);
}
.wizard-step-item.active {
    background: var(--primary);
    color: #fff;
}
.wizard-step-item .step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    flex-shrink: 0;
}
.wizard-step-item.active .step-dot {
    background: #fff;
    opacity: 1;
}
.wizard-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ---- Results Tabs ---- */
.results-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0,0,0,0.04);
    border-radius: var(--radius-sm);
    margin-bottom: 32px;
}
.results-nav a {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--ease);
}
.results-nav a:hover {
    color: var(--text-primary);
}
.results-nav a.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ---- Tables ---- */
.table-premium {
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
}
.table-premium thead th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}
.table-premium tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    vertical-align: middle;
    color: var(--text-primary);
}
.table-premium tbody tr:hover {
    background: rgba(0,0,0,0.015);
}
.table-premium tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Project cards (dashboard) ---- */
.project-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-rest);
    transition: var(--ease);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    box-shadow: var(--shadow-raised);
    transform: translateY(-1px);
}
.project-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.project-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.project-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* ---- Badges ---- */
.badge-premium {
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 980px;
    letter-spacing: 0.02em;
}
.badge-year {
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
}
.badge-simple {
    background: var(--primary-surface);
    color: var(--primary);
}
.badge-expert {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.75rem;
    color: var(--text-muted);
}
.empty-state h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto 24px;
    font-size: 0.9375rem;
}

/* ---- Chart containers ---- */
.chart-container {
    position: relative;
    width: 100%;
    padding: 24px;
}
.chart-container canvas {
    max-height: 380px;
}

/* ---- Loading ---- */
.loading-state {
    text-align: center;
    padding: 80px 24px;
}
.loading-state .spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-state p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Alerts ---- */
.alert-premium {
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 0.8125rem;
    font-weight: 500;
}
.alert-premium-danger {
    background: var(--negative-bg);
    color: var(--negative);
}
.alert-premium-success {
    background: var(--positive-bg);
    color: var(--positive);
}
.alert-premium-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ---- Wizard Progress ---- */
.wizard-progress {
    margin-top: 12px;
}
.wizard-progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.wizard-progress-track {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}
.wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ---- Modal ---- */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
}
.modal-header {
    padding: 28px 32px 0;
    border-bottom: none;
}
.modal-body { padding: 24px 32px; }
.modal-footer {
    padding: 0 32px 28px;
    border-top: none;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* ---- Footer ---- */
.footer-premium {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Value coloring — number only ---- */
.text-positive { color: var(--positive) !important; }
.text-negative { color: var(--negative) !important; }
.text-neutral { color: var(--warning) !important; }

/* ---- Grid spacing ---- */
.grid-metrics {
    display: grid;
    gap: 16px;
}
.grid-metrics-4 { grid-template-columns: repeat(4, 1fr); }
.grid-metrics-3 { grid-template-columns: repeat(3, 1fr); }
.grid-metrics-2 { grid-template-columns: repeat(2, 1fr); }

/* ---- Insight Banner: the story's opening line ---- */
.insight-banner {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: 36px 32px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.insight-banner .insight-main {
    flex: 1;
}
.insight-banner .insight-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.insight-banner .insight-value {
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}
.insight-banner .insight-context {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}
.insight-banner .insight-secondary {
    display: flex;
    gap: 32px;
}
.insight-banner .insight-stat {
    text-align: right;
}
.insight-banner .insight-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.insight-banner .insight-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ---- Purpose cards (new project) ---- */
.purpose-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.purpose-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--ease);
}
.purpose-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-rest);
}
.purpose-card.selected {
    border-color: var(--primary);
    background: var(--primary-surface);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.08);
}
.purpose-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 10px;
}
.purpose-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.purpose-desc {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Mode cards (new project) ---- */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.mode-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--ease);
}
.mode-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-rest);
}
.mode-card.selected {
    border-color: var(--primary);
    background: var(--primary-surface);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.08);
}
.mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 10px;
}
.mode-card-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.mode-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.mode-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 12px 0 4px;
}
.mode-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- Animations ---- */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .grid-metrics-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-metrics-3 { grid-template-columns: repeat(2, 1fr); }
    .page-header h1 { font-size: 1.75rem; }
    .metric-hero .metric-value { font-size: 2rem; }
    .insight-banner { flex-direction: column; gap: 20px; text-align: center; }
    .insight-banner .insight-secondary { justify-content: center; }
    .insight-banner .insight-stat { text-align: center; }
}

@media (max-width: 576px) {
    .grid-metrics-4,
    .grid-metrics-3,
    .grid-metrics-2 { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.5rem; }
    .results-nav { flex-direction: column; }
    .results-nav a { text-align: left; padding: 12px 16px; }
    .card-premium .card-body { padding: 20px; }
    .metric-card { padding: 20px 16px; }
    .metric-value { font-size: 1.375rem; }
    .insight-banner { padding: 24px 20px; }
    .insight-banner .insight-value { font-size: 2rem; }
    .insight-banner .insight-secondary { flex-direction: column; gap: 12px; }
}

/* ============================================= */
/* Status Banner & Progress                      */
/* ============================================= */
.status-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.status-banner.projection {
    background: var(--warning-bg);
    color: var(--warning);
}
.status-banner.started {
    background: var(--positive-bg);
    color: var(--positive);
}
.status-banner .status-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}
.projection-badge {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 980px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(154, 103, 0, 0.2);
}
.started-badge {
    display: inline-block;
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 980px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--positive-bg);
    color: var(--positive);
    border: 1px solid rgba(26, 122, 74, 0.2);
}

/* Credit progress bar */
.progress-credit {
    width: 100%;
    margin-top: 8px;
}
.progress-credit-track {
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.progress-credit-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--positive), #2a9d5c);
    border-radius: 999px;
    transition: width 0.5s ease;
}
.progress-credit-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ============================================= */
/* Financing Bar                                 */
/* ============================================= */
.financing-bar {
    display: flex;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}
.financing-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    min-width: 2%;
    transition: var(--ease);
}
.financing-bar-segment.own-funds {
    background: var(--positive);
}
.financing-bar-segment.credit {
    background: var(--primary);
}
.financing-bar-segment.fees {
    background: var(--text-muted);
}
.financing-legend {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.financing-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.financing-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.financing-legend-dot.own-funds { background: var(--positive); }
.financing-legend-dot.credit { background: var(--primary); }
.financing-legend-dot.fees { background: var(--text-muted); }

/* ============================================= */
/* Tooltip Help                                  */
/* ============================================= */
.tooltip-help {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed var(--text-muted);
}
.tooltip-help::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    line-height: 1.4;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    box-shadow: var(--shadow-elevated);
}
.tooltip-help:hover::after {
    opacity: 1;
}
.tooltip-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    cursor: help;
}

/* ============================================= */
/* Hero Cards for "Ma situation"                 */
/* ============================================= */
.hero-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.hero-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-raised);
    text-align: center;
}
.hero-card .hero-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 4px;
}
.hero-card .hero-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.hero-card .hero-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================= */
/* Section subtitle                              */
/* ============================================= */
.section-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: -8px;
    margin-bottom: 20px;
    font-weight: 500;
    line-height: 1.5;
}

/* ============================================= */
/* Cash/Credit toggle in wizard                  */
/* ============================================= */
.financing-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.financing-toggle-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--ease);
    text-align: center;
    background: var(--surface);
}
.financing-toggle-option:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-rest);
}
.financing-toggle-option.selected {
    border-color: var(--primary);
    background: var(--primary-surface);
}
.financing-toggle-option .toggle-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}
.financing-toggle-option .toggle-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================= */
/* Start project button area                     */
/* ============================================= */
.start-project-area {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-rest);
    text-align: center;
    margin-bottom: 24px;
    border: 1.5px dashed var(--border);
}
.start-project-area p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

@media (max-width: 992px) {
    .hero-cards { grid-template-columns: 1fr; }
    .financing-toggle { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .status-banner { flex-direction: column; text-align: center; }
    .financing-legend { justify-content: center; }
    .purpose-grid { grid-template-columns: 1fr; }
    .mode-grid { grid-template-columns: 1fr; }
}

/* ============================================= */
/* Offcanvas Burger Menu                         */
/* ============================================= */
.offcanvas-burger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--ease);
    line-height: 1;
}
.offcanvas-burger-btn:hover {
    background: rgba(0,0,0,0.04);
}

.offcanvas-premium {
    background: var(--surface);
    border-left: 1px solid var(--border);
    max-width: 300px;
    width: 85vw;
}
.offcanvas-premium .offcanvas-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.offcanvas-premium .offcanvas-body {
    padding: 16px 24px 24px;
}

.offcanvas-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--ease);
}
.offcanvas-nav-link:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}
.offcanvas-nav-link.active {
    background: var(--primary-surface);
    color: var(--primary);
    font-weight: 600;
}

.offcanvas-user-section {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.offcanvas-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--negative);
    background: var(--negative-bg);
    text-decoration: none;
    transition: var(--ease);
}
.offcanvas-logout-btn:hover {
    background: rgba(181, 48, 48, 0.12);
    color: var(--negative);
}

/* ============================================= */
/* Wizard Mobile Horizontal Bar                  */
/* ============================================= */
.wizard-mobile-bar {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.wizard-mobile-bar::-webkit-scrollbar { display: none; }

.wizard-mobile-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 980px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.04);
    transition: var(--ease);
    flex-shrink: 0;
}
.wizard-mobile-chip:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text-primary);
}
.wizard-mobile-chip.active {
    background: var(--primary);
    color: #fff;
}

/* ============================================= */
/* Responsive — Tablet/Mobile (768px)            */
/* ============================================= */
@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
    .mobile-only { display: block !important; }

    main.py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .card-premium .card-body { padding: 20px; }

    .btn-premium { min-height: 44px; }

    .modal-dialog { margin: 8px; }

    .insight-banner .insight-value { font-size: 2rem; }

    .page-header { margin-bottom: 24px; }
    .page-header h1 { font-size: 1.5rem; }

    .results-nav { flex-direction: column; }
    .results-nav a { text-align: left; padding: 12px 16px; }
}

.mobile-only { display: none; }

/* ============================================= */
/* Responsive — Small Mobile (576px)             */
/* ============================================= */
@media (max-width: 576px) {
    .table-premium { font-size: 0.75rem; }
    .table-premium thead th { padding: 8px 10px; }
    .table-premium tbody td { padding: 8px 10px; }

    .hero-card { padding: 20px 16px; }
    .hero-card .hero-value { font-size: 1.5rem; }

    .metric-hero .metric-value { font-size: 1.75rem; }

    .modal-header { padding: 20px 20px 0; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 0 20px 20px; }

    .footer-premium { font-size: 0.6875rem; }

    .insight-banner { padding: 20px 16px; }
    .insight-banner .insight-value { font-size: 1.75rem; }

    .auth-card { padding: 32px 24px; }
    .auth-submit-btn { font-size: 0.9375rem; }
}

/* ============================================= */
/* Auth Pages (Login / Register)                 */
/* ============================================= */
.auth-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: 44px 40px 36px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-brand {
    margin-bottom: 20px;
}
.auth-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 1.375rem;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

.auth-field {
    margin-bottom: 20px;
}
.auth-field .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.auth-input-wrap {
    position: relative;
}
.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9375rem;
    pointer-events: none;
    z-index: 1;
}
.auth-input {
    padding-left: 40px !important;
}

.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 24px;
    margin-top: 28px;
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--ease);
    letter-spacing: -0.01em;
}
.auth-submit-btn:hover {
    background: var(--primary-light);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.auth-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--ease);
}
.auth-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}
