/* =============================================
   TP TEMPLATE - Style Caplogy A4 (document-based)
   Inspire du template Novatiel, adapte Caplogy
   Rouge Novatiel → Cyan Caplogy
   ============================================= */

:root {
    --tp-cyan: #6CCEC7;
    --tp-dark: #5B5B79;
    --tp-muted: #8D8D9D;
    --tp-text: #2c2c3e;
    --tp-bg: #FFFFFF;
    --tp-bg-alt: #F5F5F8;
    --tp-border: #A9A9BE;
}

/* --- Container TP --- */
.tp-template {
    max-width: 794px;
    margin: 0 auto;
    font-family: Calibri, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: var(--tp-text);
}

/* --- Page A4 --- */
.tp-page {
    position: relative;
    width: 100%;
    min-height: 1060px;
    background: var(--tp-bg);
    border-radius: 4px;
    margin-bottom: 28px;
    padding: 36px 56px 76px;
    box-shadow: 0 2px 14px rgba(91, 91, 121, 0.12);
    overflow: hidden;
}

/* --- Header de page (filiere + titre) --- */
.tp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.78rem;
    color: var(--tp-muted);
    margin-bottom: 4px;
}

.tp-page-header .tp-filiere {
    font-family: Georgia, 'Times New Roman', serif;
}

.tp-page-header .tp-cours-title {
    font-family: Georgia, 'Times New Roman', serif;
    text-align: right;
}

/* --- Barre decorative avec points (style Novatiel → Caplogy) --- */
.tp-header-bar {
    position: relative;
    height: 3px;
    margin-bottom: 28px;
    background: linear-gradient(
        to right,
        var(--tp-border) 0%,
        var(--tp-border) 22%,
        var(--tp-cyan) 22%,
        var(--tp-cyan) 35%,
        var(--tp-border) 35%,
        var(--tp-border) 65%,
        var(--tp-border) 65%,
        var(--tp-border) 100%
    );
    border-radius: 2px;
}

.tp-header-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 22px;
    background:
        radial-gradient(circle 6px at 22% 50%, var(--tp-dark) 5px, transparent 6px),
        radial-gradient(circle 4.5px at 29% 50%, var(--tp-cyan) 3.5px, transparent 4.5px),
        radial-gradient(circle 6px at 65% 50%, var(--tp-dark) 5px, transparent 6px);
    pointer-events: none;
}

/* --- Titre principal du TP --- */
.tp-main-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--tp-cyan);
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.3;
}

.tp-subtitle {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    color: var(--tp-muted);
    margin: 0 0 20px;
}

/* --- Headings --- */
.tp-template h2, .tp-page h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--tp-text);
    border-bottom: 2px solid var(--tp-cyan);
    padding-bottom: 5px;
    margin: 28px 0 12px;
    text-decoration: underline;
    text-decoration-color: var(--tp-cyan);
    text-underline-offset: 6px;
    border-bottom: none;
}

.tp-template h3, .tp-page h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tp-cyan);
    margin: 22px 0 8px;
}

.tp-template h4, .tp-page h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--tp-dark);
    margin: 16px 0 6px;
}

/* --- Paragraphs --- */
.tp-template p, .tp-page p {
    font-size: 0.9rem;
    margin: 0 0 10px;
    text-align: justify;
}

/* --- Bold/strong labels --- */
.tp-template strong {
    color: var(--tp-text);
}

/* --- Colored highlights --- */
.tp-highlight {
    color: var(--tp-cyan);
    font-weight: 600;
}

/* --- Lists --- */
.tp-template ul, .tp-page ul {
    padding-left: 22px;
    margin: 6px 0 14px;
}

.tp-template ol, .tp-page ol {
    padding-left: 24px;
    margin: 6px 0 14px;
}

.tp-template li, .tp-page li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.tp-template li::marker {
    color: var(--tp-cyan);
}

/* --- Code blocks --- */
.tp-template pre, .tp-page pre {
    background: #f4f5f8;
    border-left: 3px solid var(--tp-cyan);
    border-radius: 4px;
    padding: 14px 18px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
    margin: 10px 0 14px;
    color: var(--tp-text);
}

.tp-template code, .tp-page code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85em;
    background: rgba(108, 206, 199, 0.1);
    border-radius: 3px;
    padding: 2px 5px;
    color: var(--tp-dark);
}

.tp-template pre code, .tp-page pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* --- Tables --- */
.tp-template table, .tp-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    font-size: 0.85rem;
}

.tp-template thead th, .tp-page thead th {
    background: var(--tp-dark);
    color: #fff;
    padding: 9px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
}

.tp-template tbody td, .tp-page tbody td {
    padding: 8px 14px;
    border-bottom: 1px solid #e8e9ee;
}

.tp-template tbody tr:nth-child(even) {
    background: var(--tp-bg-alt);
}

/* --- Blockquotes / callouts --- */
.tp-template blockquote, .tp-page blockquote {
    background: rgba(108, 206, 199, 0.06);
    border-left: 3px solid var(--tp-cyan);
    padding: 12px 16px;
    margin: 12px 0 16px;
    border-radius: 0 4px 4px 0;
    font-style: normal;
}

.tp-template blockquote p {
    margin: 0;
}

/* --- Info / Warning boxes --- */
.tp-info {
    background: rgba(108, 206, 199, 0.07);
    border-left: 3px solid var(--tp-cyan);
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.88rem;
}

.tp-warning {
    background: rgba(255, 184, 92, 0.07);
    border-left: 3px solid #ffb85c;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.88rem;
}

/* --- Flag box --- */
.tp-flag-box {
    background: rgba(108, 206, 199, 0.05);
    border: 1px dashed var(--tp-cyan);
    border-radius: 6px;
    padding: 10px 16px;
    margin: 10px 0 14px;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--tp-dark);
}

/* --- Question cards TP --- */
.tp-question {
    border: 1px solid #e0e1e8;
    border-radius: 6px;
    margin: 14px 0;
    overflow: hidden;
}

.tp-question-header {
    background: var(--tp-dark);
    color: #fff;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.tp-question-header .tp-pts {
    background: var(--tp-cyan);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.tp-question-body {
    padding: 14px 16px;
    font-size: 0.88rem;
}

/* --- Footer de page --- */
.tp-page-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 56px 18px;
}

.tp-page-footer::before {
    content: '';
    display: block;
    height: 1.5px;
    background: linear-gradient(to right, var(--tp-border), var(--tp-cyan), var(--tp-border));
    margin-bottom: 10px;
}

.tp-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-footer-logo {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--tp-cyan), var(--tp-dark));
    border-radius: 5px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}

.tp-footer-copy {
    font-size: 0.68rem;
    color: var(--tp-muted);
}

.tp-page-num {
    font-size: 0.82rem;
    color: var(--tp-dark);
    font-weight: 600;
}

/* --- Separator CM / TP --- */
.section-separator {
    max-width: 960px;
    margin: 48px auto 20px;
    text-align: center;
    position: relative;
}

.section-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--tp-cyan), transparent);
}

.section-separator span {
    position: relative;
    background: var(--bg, #0a0d14);
    padding: 0 20px;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--tp-cyan);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
