/* ==============================================
   MDX Associé — Simulation d'économies d'énergie
   Thème : Bleu marine & Or
   ============================================== */

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

:root {
    /* Palette principale */
    --navy:         #0A1628;
    --navy2:        #0F1E38;
    --navy3:        #162544;
    --navy-light:   #1E3358;

    /* Or / Jaune */
    --gold:         #F5C400;
    --gold2:        #FFD740;
    --gold-dark:    #C49A00;
    --gold-faint:   rgba(245, 196, 0, 0.10);
    --gold-border:  rgba(245, 196, 0, 0.28);

    /* Statuts */
    --red:          #E24B4A;
    --red-faint:    rgba(226, 75, 74, 0.12);
    --red-border:   rgba(226, 75, 74, 0.25);
    --green:        #3DBE6E;
    --green-faint:  rgba(61, 190, 110, 0.12);
    --green-border: rgba(61, 190, 110, 0.25);

    /* Texte */
    --white:        #FFFFFF;
    --text-soft:    rgba(255, 255, 255, 0.80);
    --text-muted:   rgba(255, 255, 255, 0.45);

    /* Bordures */
    --border:       rgba(255, 255, 255, 0.09);

    /* Layout */
    --r:   10px;
    --rL:  16px;
    --max: 880px;

    /* Transitions */
    --t: 0.18s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', system-ui, sans-serif;
    background: var(--navy);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==============================================
   HEADER
   ============================================== */
.hdr {
    background: var(--navy2);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.hdr-in {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-badge {
    background: var(--gold);
    color: var(--navy);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.04em;
    width: 52px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t);
    flex-shrink: 0;
}

.brand-badge:hover {
    transform: scale(1.06);
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
}

.brand-name span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.hdr-tagline {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    line-height: 1.5;
}

/* ==============================================
   HERO
   ============================================== */
.hero {
    background: var(--navy3);
    border-bottom: 1px solid var(--border);
    padding: 36px 28px 32px;
}

.hero-in {
    max-width: var(--max);
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--gold-faint);
    border: 1px solid var(--gold-border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--white);
    margin-bottom: 10px;
}

.accent {
    color: var(--gold);
}

.hero p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.7;
}

/* ==============================================
   MAIN
   ============================================== */
.main {
    flex: 1;
    max-width: var(--max);
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==============================================
   CARDS
   ============================================== */
.card {
    background: var(--navy2);
    border: 1px solid var(--border);
    border-radius: var(--rL);
    padding: 26px 28px;
    animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-ttl {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-ttl::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.period-label {
    font-weight: 400;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    opacity: 0.7;
    margin-left: 4px;
}

.hidden {
    display: none !important;
}

/* ==============================================
   FORMULAIRE
   ============================================== */
.duration-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.duration-row label {
    font-size: 14px;
    color: var(--text-soft);
    font-weight: 500;
    white-space: nowrap;
}

.duration-input {
    background: var(--navy3);
    border: 1px solid var(--border);
    border-radius: var(--r);
    height: 44px;
    padding: 0 16px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: var(--gold);
    width: 110px;
    outline: none;
    text-align: center;
    transition: border-color var(--t), box-shadow var(--t);
    -moz-appearance: textfield;
}

.duration-input::-webkit-inner-spin-button,
.duration-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.duration-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.15);
}

.duration-unit {
    font-size: 14px;
    color: var(--text-muted);
}

/* Solutions grid */
.sols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.sol-block {
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--navy3);
    padding: 18px 20px;
}

.sol-client {
    border-color: var(--red-border);
    background: var(--red-faint);
}

.sol-mdx {
    border-color: var(--gold-border);
    background: var(--gold-faint);
}

.sol-hdr {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
}

.sol-pip {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pip-red  { background: var(--red); }
.pip-gold { background: var(--gold); }

.sol-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}

/* Champs */
.fld {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.fld:last-child {
    margin-bottom: 0;
}

.fld label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.fld input,
.fld select {
    background: var(--navy2);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    font-family: 'Sora', sans-serif;
    color: var(--white);
    outline: none;
    width: 100%;
    transition: border-color var(--t), box-shadow var(--t);
    -webkit-appearance: none;
    appearance: none;
}

.fld select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.fld select option {
    background: var(--navy2);
    color: var(--white);
}

.fld input:focus,
.fld select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.12);
}

.fld input::placeholder {
    color: rgba(255, 255, 255, 0.18);
}

.sol-client .fld input:focus,
.sol-client .fld select:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.15);
}

/* ==============================================
   BOUTONS
   ============================================== */
.actions {
    display: flex;
    gap: 10px;
}

.btn-go {
    flex: 1;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: var(--r);
    height: 50px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    letter-spacing: 0.01em;
    transition: background var(--t), transform var(--t);
}

.btn-go:hover  { background: var(--gold2); }
.btn-go:active { transform: scale(0.99); }

.btn-reset {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--r);
    height: 50px;
    padding: 0 22px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: border-color var(--t), color var(--t);
    white-space: nowrap;
}

.btn-reset:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-soft);
}

/* ==============================================
   MÉTRIQUES
   ============================================== */
.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mc {
    border-radius: var(--r);
    padding: 16px 18px;
    text-align: center;
    border: 1px solid transparent;
}

.mc-lbl {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mc-val {
    font-size: 20px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    line-height: 1.15;
}

.mc-sub {
    font-size: 11px;
    opacity: 0.65;
    margin-top: 5px;
    font-family: 'DM Mono', monospace;
}

.mc-red   { background: var(--red-faint);   border-color: var(--red-border); }
.mc-gold  { background: var(--gold-faint);  border-color: var(--gold-border); }
.mc-green { background: var(--green-faint); border-color: var(--green-border); }

.mc-red   .mc-lbl, .mc-red   .mc-val { color: #F09595; }
.mc-gold  .mc-lbl, .mc-gold  .mc-val { color: var(--gold); }
.mc-green .mc-lbl, .mc-green .mc-val { color: var(--green); }

/* ==============================================
   CALLOUT ÉCONOMIES
   ============================================== */
.callout {
    background: var(--gold);
    border-radius: var(--r);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.callout-left .cl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--navy);
    opacity: 0.65;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.callout-left .cv {
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
    font-family: 'DM Mono', monospace;
    line-height: 1;
}

.callout-right {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    opacity: 0.7;
    text-align: right;
    line-height: 1.6;
}

/* ==============================================
   LÉGENDE & GRAPHIQUE
   ============================================== */
.leg {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.leg-it {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.leg-sw {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.sw-red   { background: var(--red); }
.sw-gold  { background: var(--gold); }
.sw-green { background: var(--green); }

.chart-wrap {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ==============================================
   TABLEAU
   ============================================== */
.tbl-scroll {
    overflow-x: auto;
}

.dtbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 480px;
}

.dtbl thead th {
    background: var(--navy3);
    padding: 11px 16px;
    text-align: right;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.dtbl thead th:first-child {
    text-align: left;
}

.dtbl tbody td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text-soft);
}

.dtbl tbody td:first-child {
    text-align: left;
    font-family: 'Sora', sans-serif;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 13px;
}

.dtbl tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dtbl .row-tot td {
    background: var(--navy3);
    font-weight: 700;
    font-size: 14px;
    border-top: 1px solid var(--gold-border);
    border-bottom: 1px solid var(--gold-border);
    color: var(--white);
}

.dtbl .row-avg td {
    color: rgba(255, 255, 255, 0.28);
    font-size: 11px;
    border-bottom: none;
}

.t-red   { color: #F09595; }
.t-gold  { color: var(--gold); }
.t-green { color: var(--green); }

/* ==============================================
   FOOTER
   ============================================== */
.ftr {
    background: var(--navy2);
    border-top: 1px solid var(--border);
    padding: 20px 28px;
    text-align: center;
}

.ftr-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
}

.ftr-brand span {
    color: var(--gold);
    font-weight: 400;
    margin-left: 4px;
}

.ftr-copy {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 680px) {
    .hero h1        { font-size: 22px; }
    .hero           { padding: 24px 20px; }
    .hdr-tagline    { display: none; }
    .card           { padding: 20px 18px; }
    .sols           { grid-template-columns: 1fr; }
    .metrics        { grid-template-columns: 1fr 1fr; }
    .metrics .mc:last-child { grid-column: 1 / -1; }
    .chart-wrap     { height: 240px; }
    .callout-right  { display: none; }
    .actions        { flex-direction: column; }
    .btn-reset      { width: 100%; }
    .callout .cv    { font-size: 22px; }
}

@media (max-width: 400px) {
    .metrics { grid-template-columns: 1fr; }
    .metrics .mc:last-child { grid-column: auto; }
    .mc-val  { font-size: 17px; }
}
