/* ------------------------------------------------------------------
   Bac Pro AGORA - feuille de style
   ------------------------------------------------------------------ */

:root {
    --navy:        #1c3d5a;
    --navy-dark:   #142c41;
    --navy-light:  #e8eef4;
    --ink:         #16202b;
    --muted:       #5c6b7a;
    --border:      #dfe4ea;
    --bg:          #f6f8fa;
    --white:       #ffffff;
    --vert:        #1f7a44;
    --vert-bg:     #e6f2ea;
    --orange:      #8a5d00;
    --orange-bg:   #fbf1dc;
    --rouge:       #a92f2f;
    --rouge-bg:    #f8e9e9;
    --radius:      6px;
    --wrap:        1080px;
}

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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 .5rem;
    font-weight: 600;
    color: var(--navy-dark);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.02rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--navy);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.wrap.narrow {
    max-width: 560px;
}

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

/* ------------------------------------------------------------------
   Header et navigation
   ------------------------------------------------------------------ */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
    flex-wrap: wrap;
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.brand {
    display: flex;
    flex-direction: column;
    color: var(--navy-dark);
}

.brand:hover {
    text-decoration: none;
}

.brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}

.brand-sub {
    font-size: .78rem;
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    font-size: .92rem;
}

.site-nav a {
    color: var(--ink);
}

.nav-user {
    color: var(--muted);
    font-size: .88rem;
}

.nav-btn {
    padding: .38rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}

.nav-btn:hover {
    text-decoration: none;
    border-color: var(--navy);
}

/* ------------------------------------------------------------------
   Structure
   ------------------------------------------------------------------ */

.site-main {
    min-height: 60vh;
    padding-bottom: 3rem;
}

.section {
    padding: 2.25rem 1.25rem 0;
}

.section-intro {
    color: var(--muted);
    max-width: 62ch;
    margin-bottom: 1.25rem;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--white);
    padding: 1.5rem 0;
    font-size: .88rem;
}

.footer-inner p {
    margin: 0;
}

.footer-note {
    color: var(--muted);
}

/* ------------------------------------------------------------------
   Accueil
   ------------------------------------------------------------------ */

.hero {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 0;
}

.eyebrow {
    font-size: .82rem;
    text-transform: none;
    color: var(--muted);
    margin-bottom: .6rem;
}

.hero h1 {
    font-size: 2.4rem;
    letter-spacing: -.02em;
    margin-bottom: .75rem;
}

.lead {
    font-size: 1.06rem;
    color: var(--muted);
    max-width: 60ch;
}

.hero-actions {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ------------------------------------------------------------------
   Boutons
   ------------------------------------------------------------------ */

.btn {
    display: inline-block;
    padding: .6rem 1.1rem;
    border: 1px solid var(--navy);
    border-radius: var(--radius);
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-size: .94rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    text-decoration: none;
    color: var(--white);
}

.btn-ghost {
    background: var(--white);
    color: var(--navy);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--white);
    color: var(--navy-dark);
    border-color: var(--navy);
}

.btn-small {
    padding: .32rem .7rem;
    font-size: .85rem;
}

/* ------------------------------------------------------------------
   Cards et grilles
   ------------------------------------------------------------------ */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card h3 {
    margin-bottom: .5rem;
}

.card p {
    color: var(--muted);
    font-size: .94rem;
}

.card-flat {
    background: var(--white);
}

.grid {
    display: grid;
    gap: 1rem;
}

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

/* ------------------------------------------------------------------
   Ressources de l'espace eleve
   ------------------------------------------------------------------ */

.sommaire {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .5rem;
    padding: .9rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 2rem;
}

.sommaire a {
    padding: .2rem .55rem;
    border-radius: 4px;
    color: var(--muted);
}

.sommaire a:hover {
    background: var(--navy-light);
    color: var(--navy-dark);
    text-decoration: none;
}

.ressource {
    margin-bottom: 2.5rem;
    scroll-margin-top: 1.5rem;
}

.ressource h2 {
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .75rem;
}

.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .94rem;
}

.doc:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.doc-absent span:first-child {
    color: var(--muted);
}

.doc-link {
    font-weight: 500;
}

.tag {
    flex-shrink: 0;
    font-size: .78rem;
    color: var(--muted);
    white-space: nowrap;
}

.tag-muted {
    color: #8d99a6;
}

.badge {
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .45rem;
    border-radius: 4px;
    background: var(--navy-light);
    color: var(--navy);
    font-size: .72rem;
    font-weight: 500;
    vertical-align: middle;
}

.toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    font-size: .88rem;
}

.toggle-item {
    padding: .4rem .85rem;
    color: var(--muted);
}

.toggle-item:hover {
    text-decoration: none;
    background: var(--bg);
}

.toggle-item.is-active {
    background: var(--navy);
    color: var(--white);
}

/* ------------------------------------------------------------------
   Formulaires
   ------------------------------------------------------------------ */

.form {
    margin-top: 1.25rem;
}

.field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.field-row {
    display: flex;
    gap: 1rem;
}

label {
    font-size: .88rem;
    font-weight: 500;
    margin-bottom: .3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(28, 61, 90, .1);
}

.field-hint {
    font-size: .8rem;
    color: var(--muted);
    margin-top: .25rem;
}

.field-error {
    font-size: .82rem;
    color: var(--rouge);
    margin-top: .25rem;
}

.form-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .9rem;
    color: var(--muted);
}

.inline-form {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Alertes
   ------------------------------------------------------------------ */

.alert {
    padding: .7rem .9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: .92rem;
    margin: 1.25rem 0 0;
}

.alert-success {
    background: var(--vert-bg);
    border-color: #c4e0ce;
    color: var(--vert);
}

.alert-error {
    background: var(--rouge-bg);
    border-color: #ebc9c9;
    color: var(--rouge);
}

.alert-info {
    background: var(--navy-light);
    border-color: #cbd9e5;
    color: var(--navy);
}

/* ------------------------------------------------------------------
   Tableaux et statuts (administration)
   ------------------------------------------------------------------ */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--navy-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: .84rem;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    min-width: 640px;
}

.table th,
.table td {
    padding: .7rem .9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table th {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    background: #fbfcfd;
}

.table tr:last-child td {
    border-bottom: 0;
}

.col-actions {
    white-space: nowrap;
}

.statut {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 500;
}

.statut-approuve {
    background: var(--vert-bg);
    color: var(--vert);
}

.statut-en_attente {
    background: var(--orange-bg);
    color: var(--orange);
}

.statut-refuse {
    background: var(--rouge-bg);
    color: var(--rouge);
}

/* ------------------------------------------------------------------
   Compteur de visites et graphique
   ------------------------------------------------------------------ */

.compteur {
    text-align: center;
    font-size: .88rem;
    color: var(--muted);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.compteur strong {
    color: var(--navy-dark);
    font-weight: 600;
}

.graph {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    margin-top: .75rem;
}

.graph-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    gap: .3rem;
}

.graph-bar {
    width: 100%;
    background: var(--navy);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}

.graph-label {
    font-size: .62rem;
    color: var(--muted);
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Listes
   ------------------------------------------------------------------ */

.steps {
    margin: 0 0 1.25rem;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: .94rem;
}

.steps li {
    margin-bottom: .4rem;
}

.check-list {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
    font-size: .94rem;
}

.check-list li {
    padding: .4rem 0 .4rem 1.4rem;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .95rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--vert);
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 860px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stats  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero {
        padding: 2.5rem 0;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

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

    .field-row {
        flex-direction: column;
        gap: 0;
    }

    .header-inner {
        align-items: flex-start;
    }

    .site-nav {
        gap: .8rem;
        font-size: .88rem;
    }

    .page-head {
        flex-direction: column;
    }
}

/* ==================================================================
   [ANCIEN] Habillage "portail" non utilisé - dashboard.php utilise
   désormais assets/css/portail.css à la place. Conservé ici au cas où.
   ================================================================== */

.agora-portail-inutilise {
    --ap-paper:        #F5F3EE;
    --ap-card:         #FBFAF6;
    --ap-ink:          #1C2B4A;
    --ap-ink-soft:     #4B5670;
    --ap-ink-faint:    #8B8D8A;
    --ap-stamp:        #A6402F;
    --ap-sage:         #5C7A63;
    --ap-line:         #DCD7C9;
    --ap-line-strong:  #C7C1B0;
    --ap-radius:       3px;
    --ap-c1: #1C2B4A;
    --ap-c2: #A6402F;
    --ap-c3: #5C7A63;
    --ap-c4: #B8863B;
    --ap-c5: #2C6E8E;

    max-width: 1180px;
    margin: 0 auto 3rem;
    padding: 40px 32px 56px;
    background:
        repeating-linear-gradient(180deg, transparent, transparent 37px, rgba(28,43,74,0.035) 38px),
        var(--ap-paper);
    border: 1px solid var(--ap-line);
    border-radius: 10px;
    color: var(--ap-ink);
    font-family: 'Inter', sans-serif;
    font-size: 15.5px;
    line-height: 1.6;
}

.agora-portail .page-head {
    border-bottom: 2px solid var(--ap-ink);
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.agora-portail .page-head h1 {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: clamp(26px, 4vw, 38px);
    color: var(--ap-ink);
    margin: 0 0 6px;
}

.agora-portail .page-head .muted {
    color: var(--ap-ink-soft);
    font-size: 14px;
}

.agora-portail .toggle {
    border-color: var(--ap-line-strong);
}

.agora-portail .toggle-item {
    color: var(--ap-ink-soft);
}

.agora-portail .toggle-item.is-active {
    background: var(--ap-ink);
}

.agora-portail .intro-note {
    background: var(--ap-card);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    padding: 26px 28px;
    margin: 0 0 32px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.agora-portail .intro-note .mark {
    font-family: 'Fraunces', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--ap-stamp);
    line-height: 0.8;
    flex: 0 0 auto;
}

.agora-portail .intro-note strong {
    display: block;
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ap-ink);
}

.agora-portail .intro-note p {
    margin: 0;
    color: var(--ap-ink-soft);
    font-size: 14.5px;
}

.agora-portail .sommaire {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: none;
    border: none;
    padding: 0 0 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--ap-line-strong);
}

.agora-portail .sommaire a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--ap-card);
    border: 1px solid var(--ap-line-strong);
    border-radius: 20px;
    padding: 7px 14px;
    color: var(--ap-ink-soft);
}

.agora-portail .sommaire a:hover {
    color: var(--ap-stamp);
    border-color: var(--ap-stamp);
    background: #fff;
    text-decoration: none;
}

.agora-portail .ressource {
    margin-bottom: 52px;
    scroll-margin-top: 20px;
}

.agora-portail .section-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 18px;
}

.agora-portail .section-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    border: 1px solid var(--ap-ink-faint);
    color: var(--ap-ink-faint);
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.agora-portail .ressource h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 22px;
    margin: 0;
    padding: 0;
    border: none;
}

.agora-portail .section-title .rule {
    flex: 1;
    height: 1px;
    background: var(--ap-line-strong);
}

.agora-portail .section-intro {
    color: var(--ap-ink-soft);
    max-width: 74ch;
    margin: 0 0 22px;
    font-size: 14.5px;
}

.agora-portail .grid {
    gap: 20px;
}

.agora-portail .card {
    background: var(--ap-card);
    border: 1px solid var(--ap-line);
    border-left: 3px solid var(--ap-line-strong);
    border-radius: var(--ap-radius);
    padding: 22px 24px 24px;
}

.agora-portail .card h3 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 16.5px;
    color: var(--ap-ink);
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--ap-line-strong);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.agora-portail .badge {
    background: none;
    border: 1px solid var(--ap-line-strong);
    color: var(--ap-ink-soft);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10.5px;
    padding: 3px 9px;
    border-radius: 20px;
}

.agora-portail .doc {
    border-bottom: 1px solid var(--ap-line);
    font-size: 14px;
    padding: 8px 0;
}

.agora-portail .doc:last-child {
    border-bottom: none;
}

.agora-portail .doc-link {
    color: var(--ap-ink);
    font-weight: 500;
    border-bottom: 1px solid var(--ap-line-strong);
    text-decoration: none;
    padding-bottom: 1px;
}

.agora-portail .doc-link:hover {
    color: var(--ap-stamp);
    border-color: var(--ap-stamp);
    text-decoration: none;
}

.agora-portail .tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    color: var(--ap-ink-faint);
}

.agora-portail .tag-muted {
    color: var(--ap-ink-faint);
}

.agora-portail .doc-absent span:first-child {
    color: var(--ap-ink-faint);
}

/* cycle des 5 couleurs d'accent, section après section */
.agora-portail .ressource:nth-of-type(5n+1) .section-num { color: var(--ap-c1); border-color: var(--ap-c1); }
.agora-portail .ressource:nth-of-type(5n+2) .section-num { color: var(--ap-c2); border-color: var(--ap-c2); }
.agora-portail .ressource:nth-of-type(5n+3) .section-num { color: var(--ap-c3); border-color: var(--ap-c3); }
.agora-portail .ressource:nth-of-type(5n+4) .section-num { color: var(--ap-c4); border-color: var(--ap-c4); }
.agora-portail .ressource:nth-of-type(5n+5) .section-num { color: var(--ap-c5); border-color: var(--ap-c5); }

.agora-portail .ressource:nth-of-type(5n+1) .card { border-left-color: var(--ap-c1); }
.agora-portail .ressource:nth-of-type(5n+2) .card { border-left-color: var(--ap-c2); }
.agora-portail .ressource:nth-of-type(5n+3) .card { border-left-color: var(--ap-c3); }
.agora-portail .ressource:nth-of-type(5n+4) .card { border-left-color: var(--ap-c4); }
.agora-portail .ressource:nth-of-type(5n+5) .card { border-left-color: var(--ap-c5); }

@media (max-width: 640px) {
    .agora-portail {
        padding: 26px 18px 36px;
    }

    .agora-portail .intro-note {
        flex-direction: column;
    }
}

/* bouton "retour en haut", utilisé sur l'espace élève */
.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #FBFAF6;
    border: 1px solid #C7C1B0;
    color: #1C2B4A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(28,43,74,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, border-color .2s ease, visibility .2s;
    z-index: 40;
}

.to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    border-color: #A6402F;
    color: #A6402F;
}
