/* =========================================================
   MyBoursePro - STYLE.CSS
   Charte graphique officielle
   Comprendre. Analyser. Investir.
   ========================================================= */

/* ---------------------------------------------------------
   1. VARIABLES
   --------------------------------------------------------- */

:root {
    --mbp-navy: #061A36;
    --mbp-navy-2: #0B2A52;
    --mbp-blue: #123F73;

    --mbp-gold: #D6A313;
    --mbp-gold-light: #F0C84B;
    --mbp-gold-dark: #A87900;

    --mbp-white: #FFFFFF;
    --mbp-bg: #F5F7FA;
    --mbp-light: #EEF2F6;

    --mbp-text: #172033;
    --mbp-muted: #697386;

    --mbp-success: #198754;
    --mbp-danger: #C0392B;
    --mbp-warning: #F39C12;

    --border: #E1E6ED;
    --mbp-border: #E1E6ED;

    --mbp-success-soft: #E8F7EF;
    --mbp-danger-soft: #FDECEC;
    --mbp-warning-soft: #FFF5DC;
    --mbp-info-soft: #EAF4FF;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm: 0 2px 8px rgba(6, 26, 54, 0.08);
    --shadow-md: 0 6px 20px rgba(6, 26, 54, 0.12);
    --mbp-shadow-sm: var(--shadow-sm);
    --mbp-shadow: var(--shadow-md);
    --mbp-shadow-lg: 0 14px 36px rgba(6, 26, 54, 0.16);
    --mbp-radius-xl: 22px;

    --transition: all 0.25s ease;
}

/* ---------------------------------------------------------
   2. RESET
   --------------------------------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--mbp-bg);
    color: var(--mbp-text);
    line-height: 1.6;
    font-size: 15px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* ---------------------------------------------------------
   3. CONTENEUR PRINCIPAL
   --------------------------------------------------------- */

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.main-content {
    min-height: calc(100vh - 150px);
    padding: 30px 0;
}

/* ---------------------------------------------------------
   4. HEADER
   --------------------------------------------------------- */

.site-header {
    background: var(--mbp-navy);
    color: var(--mbp-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    max-height: 52px;
    width: auto;
}

.site-logo,
.mbp-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img,
.mbp-logo img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,.22));
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--mbp-gold-light);
}

/* ---------------------------------------------------------
   5. NAVIGATION
   --------------------------------------------------------- */

.navbar {
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar a {
    color: rgba(255,255,255,0.9);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
}

.navbar a:hover,
.navbar a.active {
    background: rgba(214,163,19,0.16);
    color: var(--mbp-gold-light);
}

/* ---------------------------------------------------------
   6. BOUTONS
   --------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: none;
    border-radius: 8px;

    padding: 11px 20px;

    font-weight: 700;
    transition: var(--transition);
}

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

.btn-primary {
    background: var(--mbp-gold);
    color: var(--mbp-navy);
}

.btn-primary:hover {
    background: var(--mbp-gold-light);
}

.btn-secondary {
    background: var(--mbp-navy);
    color: var(--mbp-white);
}

.btn-secondary:hover {
    background: var(--mbp-navy-2);
}

.btn-outline {
    background: transparent;
    color: var(--mbp-navy);
    border: 1px solid var(--mbp-navy);
}

.btn-outline:hover {
    background: var(--mbp-navy);
    color: var(--mbp-white);
}

.btn-danger {
    background: var(--mbp-danger);
    color: white;
}

.btn-success {
    background: var(--mbp-success);
    color: white;
}

/* ---------------------------------------------------------
   7. HERO
   --------------------------------------------------------- */

.hero {
    background:
        linear-gradient(
            135deg,
            var(--mbp-navy),
            var(--mbp-navy-2)
        );

    color: var(--mbp-white);
    padding: 70px 0;
}

.hero-content {
    max-width: 850px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero h1 span {
    color: var(--mbp-gold-light);
}

.hero p {
    max-width: 700px;
    color: rgba(255,255,255,0.82);
    font-size: 18px;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------------------------------------------------------
   8. TITRES DE SECTIONS
   --------------------------------------------------------- */

.section {
    padding: 50px 0;
}

.section-title {
    margin-bottom: 28px;
}

.section-title h2 {
    color: var(--mbp-navy);
    font-size: 30px;
    line-height: 1.2;
}

.section-title h2 span {
    color: var(--mbp-gold-dark);
}

.section-title p {
    margin-top: 8px;
    color: var(--mbp-muted);
}

/* ---------------------------------------------------------
   9. CARTES
   --------------------------------------------------------- */

.card {
    background: var(--mbp-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-title {
    color: var(--mbp-navy);
    font-size: 20px;
    font-weight: 750;
    margin-bottom: 10px;
}

.card-text {
    color: var(--mbp-muted);
}

/* ---------------------------------------------------------
   10. DASHBOARD
   --------------------------------------------------------- */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    background: var(--mbp-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    color: var(--mbp-muted);
    font-size: 14px;
    margin-bottom: 6px;
}

.stat-value {
    color: var(--mbp-navy);
    font-size: 27px;
    font-weight: 800;
}

.stat-value.gold {
    color: var(--mbp-gold-dark);
}

.stat-value.success {
    color: var(--mbp-success);
}

.stat-value.danger {
    color: var(--mbp-danger);
}

/* ---------------------------------------------------------
   11. INDICATEURS BRVM
   --------------------------------------------------------- */

.market-card {
    background: var(--mbp-navy);
    color: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.market-card h3 {
    color: var(--mbp-gold-light);
    margin-bottom: 15px;
}

.market-value {
    font-size: 32px;
    font-weight: 800;
}

.market-change-up {
    color: #48D597;
    font-weight: 700;
}

.market-change-down {
    color: #FF7777;
    font-weight: 700;
}

/* ---------------------------------------------------------
   12. TABLEAUX
   --------------------------------------------------------- */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--mbp-white);
}

.table th {
    background: var(--mbp-navy);
    color: var(--mbp-white);
    padding: 13px;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.table td {
    padding: 13px;
    border-bottom: 1px solid var(--border);
}

.table tr:hover td {
    background: #F8FAFC;
}

.table .positive {
    color: var(--mbp-success);
    font-weight: 700;
}

.table .negative {
    color: var(--mbp-danger);
    font-weight: 700;
}

/* ---------------------------------------------------------
   13. ACTIONS BRVM
   --------------------------------------------------------- */

.stock-card {
    background: var(--mbp-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.stock-name {
    color: var(--mbp-navy);
    font-size: 18px;
    font-weight: 800;
}

.stock-symbol {
    color: var(--mbp-muted);
    font-size: 13px;
}

.stock-price {
    color: var(--mbp-navy);
    font-size: 22px;
    font-weight: 800;
}

.score {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(214,163,19,0.15);
    color: var(--mbp-gold-dark);
    font-weight: 800;
}

/* ---------------------------------------------------------
   14. BADGES
   --------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #E8F7EF;
    color: var(--mbp-success);
}

.badge-danger {
    background: #FDECEC;
    color: var(--mbp-danger);
}

.badge-warning {
    background: #FFF5DC;
    color: #9A6800;
}

.badge-info {
    background: #EAF2FB;
    color: var(--mbp-blue);
}

/* ---------------------------------------------------------
   15. FORMULAIRES
   --------------------------------------------------------- */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    color: var(--mbp-navy);
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #CDD4DE;
    border-radius: 8px;
    background: white;
    color: var(--mbp-text);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--mbp-gold);
    box-shadow: 0 0 0 3px rgba(214,163,19,0.14);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ---------------------------------------------------------
   16. PLAN D'INVESTISSEMENT
   --------------------------------------------------------- */

.investment-plan {
    background: var(--mbp-white);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.plan-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.plan-item {
    padding: 18px;
    background: var(--mbp-light);
    border-radius: var(--radius-md);
}

.plan-item small {
    color: var(--mbp-muted);
}

.plan-item strong {
    display: block;
    color: var(--mbp-navy);
    font-size: 22px;
    margin-top: 4px;
}

/* ---------------------------------------------------------
   17. ANALYSE & RECOMMANDATIONS
   --------------------------------------------------------- */

.analysis-card {
    border-left: 5px solid var(--mbp-gold);
    background: var(--mbp-white);
    padding: 22px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: var(--shadow-sm);
}

.analysis-card h3 {
    color: var(--mbp-navy);
    margin-bottom: 10px;
}

.recommendation {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 12px 0;
}

.recommendation-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(214,163,19,0.15);
    color: var(--mbp-gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------------------------------------------------------
   18. MARCHÉ
   --------------------------------------------------------- */

.market-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.market-panel {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 22px;
}

.market-panel h3 {
    color: var(--mbp-navy);
    margin-bottom: 15px;
}

/* ---------------------------------------------------------
   19. ALERTES
   --------------------------------------------------------- */

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-success {
    background: #E9F7EF;
    color: #146C43;
    border: 1px solid #B7E4C7;
}

.alert-danger {
    background: #FDECEC;
    color: #9B2C2C;
    border: 1px solid #F5B5B5;
}

.alert-warning {
    background: #FFF6DF;
    color: #856404;
    border: 1px solid #FFE69C;
}

.alert-info {
    background: #EAF4FF;
    color: #145A86;
    border: 1px solid #B6DDF5;
}

/* ---------------------------------------------------------
   20. FOOTER
   --------------------------------------------------------- */

.site-footer {
    background: var(--mbp-navy);
    color: rgba(255,255,255,0.75);
    padding: 45px 0 25px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 35px;
}

.site-footer h3,
.site-footer h4 {
    color: var(--mbp-white);
    margin-bottom: 15px;
}

.site-footer a:hover {
    color: var(--mbp-gold-light);
}

.footer-bottom {
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    text-align: center;
    font-size: 13px;
}

/* ---------------------------------------------------------
   21. MANSA KÉÏTA
   --------------------------------------------------------- */

.mansa-card {
    background:
        linear-gradient(
            135deg,
            var(--mbp-navy),
            #0C315B
        );

    color: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.mansa-card::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -80px;
    top: -80px;
    border: 1px solid rgba(214,163,19,0.3);
    border-radius: 50%;
}

.mansa-name {
    color: var(--mbp-gold-light);
    font-size: 26px;
    font-weight: 800;
}

.mansa-title {
    color: rgba(255,255,255,0.75);
    margin-bottom: 18px;
}

.mansa-quote {
    font-size: 20px;
    font-style: italic;
    line-height: 1.5;
}

/* ---------------------------------------------------------
   22. PAGINATION
   --------------------------------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 25px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
}

.pagination .active {
    background: var(--mbp-navy);
    color: white;
    border-color: var(--mbp-navy);
}

/* ---------------------------------------------------------
   23. UTILITAIRES
   --------------------------------------------------------- */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-gold {
    color: var(--mbp-gold-dark);
}

.text-navy {
    color: var(--mbp-navy);
}

.text-muted {
    color: var(--mbp-muted);
}

.text-success {
    color: var(--mbp-success);
}

.text-danger {
    color: var(--mbp-danger);
}

.fw-bold {
    font-weight: 700;
}

.fw-extrabold {
    font-weight: 800;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 15px; }
.mt-3 { margin-top: 25px; }
.mt-4 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 15px; }
.mb-3 { margin-bottom: 25px; }
.mb-4 { margin-bottom: 40px; }

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 10px;
}

.gap-2 {
    gap: 20px;
}

/* ---------------------------------------------------------
   24. GRILLES
   --------------------------------------------------------- */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ---------------------------------------------------------
   25. RESPONSIVE TABLETTE
   --------------------------------------------------------- */

@media (max-width: 992px) {

    .dashboard-grid,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar {
        gap: 0;
    }

    .navbar a {
        padding: 8px 10px;
    }
}

/* ---------------------------------------------------------
   26. RESPONSIVE MOBILE
   --------------------------------------------------------- */

@media (max-width: 768px) {

    body {
        font-size: 14px;
    }

    .container {
        width: 94%;
    }

    .main-content {
        padding: 20px 0;
    }

    .header-inner {
        min-height: 62px;
    }

    .navbar {
        display: none;
    }

    .hero {
        padding: 45px 0;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }

    .dashboard-grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .market-grid,
    .plan-summary {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 35px 0;
    }

    .section-title h2 {
        font-size: 25px;
    }

    .stock-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }
}

/* ---------------------------------------------------------
   27. PETITS MOBILES
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .container {
        width: 92%;
    }

    .logo-text {
        font-size: 20px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .card,
    .stat-card,
    .investment-plan {
        padding: 17px;
    }

    .stat-value {
        font-size: 23px;
    }

    .market-value {
        font-size: 27px;
    }

    .mansa-card {
        padding: 22px;
    }

    .mansa-name {
        font-size: 22px;
    }

    .mansa-quote {
        font-size: 17px;
    }
}

/* ---------------------------------------------------------
   FIN MyBoursePro
   Comprendre. Analyser. Investir.
   --------------------------------------------------------- */

/* =========================================================
   28. COMPATIBILITÉ AVEC LES PAGES MYBOURSEPRO EXISTANTES
   ========================================================= */

.mbp-container {
    width: min(1220px, calc(100% - 32px));
    margin-inline: auto;
}

.mbp-flex { display: flex; }
.mbp-flex-wrap { flex-wrap: wrap; }
.mbp-justify-between { justify-content: space-between; }
.mbp-gap-2 { gap: 16px; }
.mbp-text-center { text-align: center; }
.mbp-text-muted { color: var(--mbp-muted); }
.mbp-text-primary { color: var(--mbp-blue); }

.mbp-grid {
    display: grid;
    gap: 18px;
}

.mbp-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.mbp-card {
    background: var(--mbp-white);
    border: 1px solid var(--mbp-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--mbp-shadow-sm);
    overflow: hidden;
}

.mbp-card-hover {
    transition: var(--transition);
}

.mbp-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--mbp-shadow);
}

.mbp-card-header {
    padding: 17px 20px;
    border-bottom: 1px solid var(--mbp-border);
    color: var(--mbp-navy);
    font-weight: 800;
}

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

.mbp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 750;
    text-decoration: none;
    transition: var(--transition);
}

.mbp-btn:hover { transform: translateY(-1px); }
.mbp-btn-primary { background: var(--mbp-gold); color: var(--mbp-navy); }
.mbp-btn-primary:hover { background: var(--mbp-gold-light); }
.mbp-btn-light { background: var(--mbp-white); color: var(--mbp-navy); }
.mbp-btn-warning { background: var(--mbp-warning); color: #241700; }
.mbp-btn-outline { background: transparent; color: var(--mbp-navy); border-color: var(--mbp-navy); }
.mbp-btn-outline:hover { background: var(--mbp-navy); color: var(--mbp-white); }
.mbp-btn-outline-light { background: transparent; color: var(--mbp-white); border-color: rgba(255,255,255,.65); }
.mbp-btn-outline-light:hover { background: var(--mbp-white); color: var(--mbp-navy); }

.mbp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
}

.mbp-badge-primary { background: rgba(18,63,115,.12); color: var(--mbp-blue); }
.mbp-badge-success { background: var(--mbp-success-soft); color: var(--mbp-success); }
.mbp-badge-warning { background: var(--mbp-warning-soft); color: #8A5A00; }
.mbp-badge-muted { background: var(--mbp-light); color: var(--mbp-muted); }

.mbp-icon-box {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(214,163,19,.14);
    color: var(--mbp-gold-dark);
}

.mbp-footer {
    margin-top: 50px;
    padding: 28px 0;
    background: var(--mbp-navy);
    color: rgba(255,255,255,.78);
}

*:focus-visible {
    outline: 3px solid rgba(240,200,75,.55);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .site-logo img,
    .mbp-logo img {
        width: 48px;
        height: 48px;
    }

    .mbp-grid-auto { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}