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

:root {
    --dauphine-blue: #003a63;
    --dauphine-blue-light: #005c96;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --border-subtle: #e5e7eb;
    --border-strong: #d1d5db;
    --text-main: #111827;
    --text-muted: #6b7280;
    --success: #15803d;
    --warning: #d97706;
    --danger: #b91c1c;
}

/* Page */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    padding: 24px;
}

/* Conteneur principal */

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

/* Header institutionnel */

.header {
    border-bottom: 1px solid var(--border-subtle);
    background: #ffffff;
}

.institution-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: var(--dauphine-blue);
    color: #f9fafb;
}

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

.inst-logo {
    height: 30px;
    width: auto;
    display: block;
}

.institution-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
}

.inst-name {
    font-weight: 500;
}

.inst-program {
    opacity: 0.9;
}

.inst-year {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.header-main {
    padding: 18px 24px 16px;
}

.header-main h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-main p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Contenu général */

.content {
    padding: 20px 24px 24px;
}

/* Blocs semestre */

.semestre {
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.semestre-header {
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dauphine-blue);
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-subtle);
}

.semestre-content {
    padding: 12px 14px 14px;
}

/* Liste d’UE : une par ligne */

.ue-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ue-item {
    background: var(--bg-card);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    padding: 10px 12px 8px;
}

/* En-tête d’UE */

.ue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ue-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.ue-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ects-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--dauphine-blue);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

/* Note finale */

.final-note {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.final-note.success {
    background: #ecfdf3;
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.3);
}

.final-note.warning {
    background: #fffbeb;
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.35);
}

/* Composantes */

.components {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 6px;
}

.component {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 130px;
}

.component-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.coeff {
    margin-left: 4px;
    font-size: 0.75rem;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #f9fafb;
    color: var(--text-muted);
}

/* Inputs */

.component input,
.alternance-item input {
    padding: 7px 9px;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    font-size: 0.85rem;
    outline: none;
    background: #ffffff;
}

.component input:focus,
.alternance-item input:focus {
    border-color: var(--dauphine-blue-light);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

/* Formule */

.formula {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Barre de progression */

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.25s ease-out;
}

/* Alternance */

.alternance {
    margin-top: 8px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    padding: 12px 14px 10px;
    background: #f9fafb;
}

.alternance h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.alternance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.alternance-item {
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    padding: 10px 10px 8px;
}

.alternance-item label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Résultats */

.results {
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    padding: 16px 16px 14px;
    background: #f9fafb;
}

.results h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.result-item {
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    padding: 10px;
    text-align: center;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Statut de validation */

.validation-status {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 4px solid var(--border-strong);
    background: #f3f4f6;
    color: var(--text-main);
}

.validation-status.success {
    background: #ecfdf3;
    border-left-color: var(--success);
    color: var(--success);
}

.validation-status.rattrapage {
    background: #fffbeb;
    border-left-color: var(--warning);
    color: var(--warning);
}

/* Liste rattrapage */

.rattrapage-details {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.rattrapage-details h4 {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.rattrapage-list {
    list-style: none;
}

.rattrapage-list li {
    font-size: 0.83rem;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.rattrapage-list li:first-child {
    border-top: none;
}

/* Disclaimer */

.disclaimer {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Responsive */

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .content {
        padding: 16px 14px 18px;
    }

    .semestre-content {
        padding: 10px 10px 12px;
    }

    .institution-bar {
        padding: 8px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .header-main {
        padding: 14px 14px 12px;
    }
}
