/* Tokens et composants unifiés */
@import url("./base/_tokens.css");
@import url("./base/_variables.css");
@import url("./components/_header-unified.css");
@import url("./components/_buttons-unified.css");
@import url("./components/_forms-unified.css");
@import url("./components/_utilities-simulators.css");
@import url("./pages/_simulator-per.css");

/* le reste de simulator.css ensuite */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-weight: var(--font-light);
    background: var(--gradient-background);
    padding: 20px;
    min-height: 100vh;
    color: var(--rivaria-ink);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.header {
    background: var(--gradient-hero);
    color: white;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header-left p {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    font-size: 1.1em;
    opacity: 0.95;
}
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-help, .btn-pdf {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    min-width: 140px;
    justify-content: center;
}

.btn-help:hover, .btn-pdf:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-help:active, .btn-pdf:active {
    transform: translateY(0);
}
/* Tooltip */
.info-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: help;
    position: relative;
}
.info-tip .tip-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #023A68;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}
.info-tip .tip-content {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    border: 1px solid #334155;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    white-space: normal;
    min-width: 240px;
    max-width: 360px;
    z-index: 50;
    font-size: 0.85em;
    display: none;
}
.info-tip:hover .tip-content { display: block; }

.logo {
    height: 60px;
}

.content {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
}

.sidebar {
    background: #F4F4F4;
    padding: 30px;
    border-right: 1px solid #677E84;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.main-content {
    padding: 30px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 0;
    margin-bottom: 20px;
    border: 1px solid #677E84;
}
#glossaire .section { margin-bottom: 0; }

.section h3 {
    font-family: 'Instrument Sans', sans-serif;
    color: #023A68;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 300;
    color: #000000;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #677E84;
    border-radius: 0;
    font-size: 1em;
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1870EF;
}

.btn-calculate {
    width: 100%;
    padding: 15px;
    background: #023A68;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 1.1em;
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s, box-shadow 0.3s;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(2, 58, 104, 0.2);
}

.btn-calculate:hover {
    background: #1870EF;
    box-shadow: 0 8px 18px rgba(24, 112, 239, 0.35);
    transform: translateY(-2px);
}
.btn-calculate:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(24,112,239,0.25); }

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

.summary-card {
    padding: 15px;
    background: linear-gradient(135deg, #F7F7F7 0%, #ffffff 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #023A68;
}

.summary-card.secondary {
    border-left-color: #2D7A4F;
}

.summary-card.tertiary {
    border-left-color: #1870EF;
}

.summary-card h4,
.summary-card .label {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 500;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.summary-card .value {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 1.8em;
    font-weight: bold;
    color: #023A68;
}

.summary-card.secondary .value {
    color: #2D7A4F;
}

.summary-card.tertiary .value {
    color: #1870EF;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}

table th {
    background: #023A68;
    color: white;
    padding: 12px 8px;
    text-align: right;
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 600;
    position: sticky;
    top: 0;
}

table th:first-child {
    text-align: center;
}

table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #677E84;
}

table td:first-child {
    text-align: center;
    font-weight: 500;
    color: #023A68;
}

table tr:hover {
    background: #F4F4F4;
}

.scenario-pessimiste { color: #B91C1C; }
.scenario-realiste { color: #023A68; font-weight: 500; }
.scenario-optimiste { color: #2D7A4F; }

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

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.info-badge {
    background: #F7F7F7;
    color: #023A68;
    padding: 10px;
    border-radius: 0;
    font-size: 0.85em;
    margin-top: 10px;
    border-left: 3px solid #1870EF;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

.sortie-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.sortie-card {
    background: #F4F4F4;
    padding: 25px;
    border-radius: 0;
    border: 2px solid #677E84;
}

.sortie-card h4 {
    font-family: 'Instrument Sans', sans-serif;
    color: #023A68;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.sortie-card table {
    font-size: 0.95em;
    margin: 0;
}

.sortie-card table tr {
    background: transparent;
}

.sortie-card table td {
    padding: 8px 0;
    border: none;
}

.sortie-card .highlight-row {
    background: white;
}

.sortie-card .highlight-row td {
    padding: 12px 8px;
    font-weight: 500;
    font-size: 1.1em;
}

.recommandation {
    margin-top: 20px;
    padding: 20px;
    border-radius: 0;
    font-weight: 500;
    border-left: 4px solid;
}

.recommandation.capital {
    background: rgba(45, 122, 79, 0.1);
    color: #2D7A4F;
    border-color: #2D7A4F;
}

.recommandation.rente {
    background: rgba(24, 112, 239, 0.1);
    color: #023A68;
    border-color: #1870EF;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F4F4F4;
}

::-webkit-scrollbar-thumb {
    background: #023A68;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1870EF;
}
.report-container {
    display: none;
}
.report {
    background: #ffffff;
    color: #000000;
    font-family: 'Instrument Sans', sans-serif;
}
.report-header {
    background: linear-gradient(135deg, #023A68 0%, #1870EF 100%);
    color: #ffffff;
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.report-header h1 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 1.8em;
    margin-bottom: 6px;
    font-weight: 700;
}
.report-meta {
    font-size: 0.9em;
    opacity: 0.95;
}
.report-section {
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
}
.report-section h2 {
    font-family: 'Instrument Sans', sans-serif;
    color: #023A68;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 12px;
}
.report-chart-img {
    width: 100%;
    height: 230px;
    object-fit: contain;
}

.report-graphics-section .report-card {
    margin-bottom: 28px;
}

.report-graphics-section .report-card:first-of-type {
    margin-bottom: 250px;
}

.report-graphics-section .report-card:last-of-type {
    margin-bottom: 55px;
}
.report-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.report-card {
    border: 1px solid #677E84;
    padding: 12px;
    background: #F8FAFB;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.report-table th, .report-table td {
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    padding: 6px 8px;
}

.page-break {
    page-break-before: always;
    break-before: page;
}

.report-footer {
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    padding: 8px 20px;
    font-size: 0.65em;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 20px;
    text-align: center;
}

@media print {
    .report-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #f8f9fa;
        border-top: 1px solid #e5e7eb;
        padding: 6px 15px;
        font-size: 0.6em;
        color: #6b7280;
        line-height: 1.2;
        text-align: center;
        page-break-inside: avoid;
        z-index: 1000;
    }
}
@media print {
    .sidebar, .header-actions, .btn-calculate {
        display: none !important;
    }
    .content {
        grid-template-columns: 1fr;
    }
    .report-container {
        display: block !important;
    }
}
/* PER only */
body[data-sim="per"] {
  background: var(--bg);
}

body[data-sim="per"] .page {
  max-width: 1200px;
  margin: 18px auto 48px;
  padding: 0 18px;
}

body[data-sim="per"] .hero {
  border-radius: calc(var(--radius) + 10px);
  border: 1px solid rgba(2,58,104,.12);
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

body[data-sim="per"] .hero-inner {
  padding: 18px;
}

body[data-sim="per"] .hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* PER only */
body[data-sim="per"] .hero{
  background: linear-gradient(135deg, rgba(7,57,109,.95), rgba(36,120,214,.9));
  color: #fff;
}

body[data-sim="per"] .hero-inner{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  min-height: 160px;
}

body[data-sim="per"] .hero-left h1,
body[data-sim="per"] .hero-left p,
body[data-sim="assurance-vie"] .hero-left h1,
body[data-sim="assurance-vie"] .hero-left p {
  color: #fff;
}

body[data-sim="per"] .hero-actions,
body[data-sim="assurance-vie"] .hero-actions {
  margin-top: 12px;
}

/* base bouton pour tes classes existantes */
body[data-sim="per"] .btn-calculate,
body[data-sim="per"] .btn-help,
body[data-sim="per"] .btn-pdf,
body[data-sim="assurance-vie"] .btn-calculate,
body[data-sim="assurance-vie"] .btn-help,
body[data-sim="assurance-vie"] .btn-pdf {
  appearance: none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

body[data-sim="per"] .btn-calculate,
body[data-sim="assurance-vie"] .btn-calculate {
  background: rgba(255,255,255,.18);
}

body[data-sim="per"] .btn-calculate:hover,
body[data-sim="per"] .btn-help:hover,
body[data-sim="per"] .btn-pdf:hover,
body[data-sim="assurance-vie"] .btn-calculate:hover,
body[data-sim="assurance-vie"] .btn-help:hover,
body[data-sim="assurance-vie"] .btn-pdf:hover {
  background: rgba(255,255,255,.20);
}




