/* Espace partenaire BELA (universités et entreprises) — feuille autonome. */
:root {
    --p-navy: #1e3a8a;
    --p-navy-dark: #16296b;
    --p-orange: #f97316;
    --p-orange-dark: #dc6209;
    --p-ink: #1f2937;
    --p-muted: #6b7280;
    --p-border: #e5e7eb;
    --p-surface: #f5f6fa;
    --p-white: #fff;
    --p-success: #16a34a;
    --p-danger: #dc2626;
    --p-warning: #d97706;
    --p-info: #2563eb;
    --p-radius: 14px;
    --p-shadow: 0 6px 20px rgba(17, 24, 39, .07);
    --p-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body.p-body { margin: 0; background: var(--p-surface); color: var(--p-ink); font-family: var(--p-font); font-size: 15px; line-height: 1.55; }
.p-body a { color: var(--p-navy); text-decoration: none; }
.p-body a:hover { color: var(--p-orange-dark); }
.p-body h1, .p-body h2, .p-body h3 { font-weight: 600; color: var(--p-ink); margin: 0; }
.p-body h1 { font-size: 1.55rem; }
.p-body h2 { font-size: 1.15rem; }
.p-body h3 { font-size: 1rem; }
.p-muted { color: var(--p-muted); }
.p-small { font-size: .85rem; }
.p-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barre du haut ---------- */
.p-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; background: var(--p-white); border-bottom: 1px solid var(--p-border); }
.p-brand { display: flex; align-items: center; gap: 12px; }
.p-brand img { height: 34px; width: auto; }
.p-brand-tag { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--p-navy); background: #e8edfa; border-radius: 999px; padding: 4px 10px; }
.p-org { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-org-nom { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.p-org-type { font-size: .78rem; color: var(--p-muted); }
.p-avatar { width: 38px; height: 38px; border-radius: 10px; flex: none; object-fit: contain; background: var(--p-surface); border: 1px solid var(--p-border); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--p-white); background-color: var(--p-navy); }
img.p-avatar { background-color: var(--p-white); }

/* ---------- Mise en page ---------- */
.p-shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 63px); }
.p-nav { background: var(--p-white); border-right: 1px solid var(--p-border); padding: 22px 14px; }
.p-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--p-ink); font-weight: 500; margin-bottom: 4px; }
.p-nav a i { font-size: 1.1rem; color: var(--p-muted); }
.p-nav a:hover { background: var(--p-surface); color: var(--p-navy); }
.p-nav a.is-active { background: #e8edfa; color: var(--p-navy); }
.p-nav a.is-active i { color: var(--p-navy); }
.p-nav-sep { height: 1px; background: var(--p-border); margin: 14px 6px; }
.p-nav form button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 500; color: var(--p-danger); cursor: pointer; text-align: left; }
.p-nav form button:hover { background: #fdecec; }
.p-nav-badge { margin-left: auto; background: var(--p-orange); color: var(--p-white); font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.p-main { padding: 30px 34px 60px; max-width: 1180px; width: 100%; }
.p-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.p-head p { margin: 6px 0 0; color: var(--p-muted); max-width: 680px; }

@media (max-width: 900px) {
    .p-topbar { padding: 10px 16px; }
    .p-org-nom { max-width: 150px; }
    .p-shell { grid-template-columns: 1fr; }
    .p-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--p-border); }
    .p-nav a, .p-nav form button { white-space: nowrap; margin: 0; padding: 9px 12px; }
    .p-nav-sep { display: none; }
    .p-main { padding: 22px 16px 50px; }
}

/* ---------- Cartes, chiffres, tableaux ---------- */
.p-card { background: var(--p-white); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); padding: 22px; margin-bottom: 20px; }
.p-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.p-stat { background: var(--p-white); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 18px 20px; box-shadow: var(--p-shadow); }
.p-stat-label { font-size: .82rem; color: var(--p-muted); display: flex; align-items: center; gap: 8px; }
.p-stat-valeur { font-size: 1.9rem; font-weight: 600; color: var(--p-navy); margin-top: 4px; }
.p-stat-detail { font-size: .82rem; color: var(--p-muted); }
.p-stat.is-accent .p-stat-valeur { color: var(--p-orange-dark); }

.p-table-wrap { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.p-table th { text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--p-muted); padding: 10px 12px; border-bottom: 1px solid var(--p-border); white-space: nowrap; }
.p-table td { padding: 14px 12px; border-bottom: 1px solid var(--p-border); vertical-align: middle; }
.p-table tr:last-child td { border-bottom: 0; }
.p-table tr.is-lien { cursor: pointer; }
.p-table tr.is-lien:hover td { background: #fafbfe; }
.p-titre-ligne { font-weight: 600; color: var(--p-ink); }
.p-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.p-actions form { margin: 0; }

.p-vide { text-align: center; padding: 46px 20px; color: var(--p-muted); }
.p-vide i { font-size: 2.2rem; color: #c7cfe6; display: block; margin-bottom: 10px; }

/* ---------- Pastilles ---------- */
.p-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.p-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-chip.is-vert { background: #e7f6ec; color: var(--p-success); }
.p-chip.is-gris { background: #eef0f3; color: #4b5563; }
.p-chip.is-rouge { background: #fdecec; color: var(--p-danger); }
.p-chip.is-orange { background: #fff3e6; color: var(--p-orange-dark); }
.p-chip.is-bleu { background: #e8effd; color: var(--p-info); }

/* ---------- Boutons ---------- */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s, color .15s; }
.p-btn:disabled { opacity: .6; cursor: progress; }
.p-btn-primaire { background: var(--p-orange); color: var(--p-white) !important; }
.p-btn-primaire:hover { background: var(--p-orange-dark); }
.p-btn-navy { background: var(--p-navy); color: var(--p-white) !important; }
.p-btn-navy:hover { background: var(--p-navy-dark); }
.p-btn-contour { background: var(--p-white); border-color: var(--p-border); color: var(--p-ink) !important; }
.p-btn-contour:hover { border-color: var(--p-navy); color: var(--p-navy) !important; }
.p-btn-danger { background: var(--p-white); border-color: #f5c2c2; color: var(--p-danger) !important; }
.p-btn-danger:hover { background: #fdecec; }
.p-btn-petit { padding: 7px 12px; font-size: .82rem; border-radius: 8px; }
.p-btn-bloc { width: 100%; }

/* ---------- Formulaires ---------- */
.p-form-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.p-form-grille .p-plein { grid-column: 1 / -1; }
@media (max-width: 700px) { .p-form-grille { grid-template-columns: 1fr; } }
.p-champ { margin-bottom: 18px; }
.p-champ label, .p-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.p-champ .p-aide { font-size: .8rem; color: var(--p-muted); margin-top: 5px; }
.p-requis { color: var(--p-orange-dark); }
.p-input, .p-select, .p-textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 11px 13px; font: inherit; font-size: .95rem; color: var(--p-ink); background: var(--p-white); }
.p-textarea { min-height: 110px; resize: vertical; }
.p-input:focus, .p-select:focus, .p-textarea:focus { outline: none; border-color: var(--p-navy); box-shadow: 0 0 0 3px rgba(30, 58, 138, .12); }
.p-champ.has-erreur .p-input, .p-champ.has-erreur .p-select, .p-champ.has-erreur .p-textarea { border-color: var(--p-danger); }
.p-erreur { color: var(--p-danger); font-size: .82rem; margin-top: 5px; }
.p-cases { display: flex; flex-wrap: wrap; gap: 10px; }
.p-case { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d1d5db; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; }
.p-case input { accent-color: var(--p-navy); }
.p-case:has(input:checked) { border-color: var(--p-navy); background: #e8edfa; color: var(--p-navy); }
.p-form-pied { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--p-border); padding-top: 18px; margin-top: 6px; }
.p-image-apercu { width: 100%; max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--p-border); display: block; margin-bottom: 10px; }

/* ---------- Messages ---------- */
.p-alerte { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 13px 16px; margin-bottom: 18px; font-size: .92rem; }
.p-alerte i { margin-top: 3px; }
.p-alerte.is-succes { background: #e7f6ec; color: #166534; border: 1px solid #bfe5cb; }
.p-alerte.is-erreur { background: #fdecec; color: #991b1b; border: 1px solid #f5c2c2; }
.p-alerte.is-info { background: #e8effd; color: #1e40af; border: 1px solid #c6d6f8; }

/* ---------- Onglets et filtres ---------- */
.p-onglets { display: flex; gap: 6px; border-bottom: 1px solid var(--p-border); margin-bottom: 18px; overflow-x: auto; }
.p-onglets a { padding: 10px 16px; font-weight: 600; color: var(--p-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.p-onglets a.is-active { color: var(--p-navy); border-bottom-color: var(--p-orange); }
.p-filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.p-filtres .p-select { width: auto; min-width: 200px; max-width: 100%; }
.p-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.p-pagination a, .p-pagination span { min-width: 38px; text-align: center; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--p-border); background: var(--p-white); font-weight: 500; }
.p-pagination span.is-active { background: var(--p-navy); border-color: var(--p-navy); color: var(--p-white); }

/* ---------- Dossier de candidature ---------- */
.p-dossier { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .p-dossier { grid-template-columns: 1fr; } }
.p-infos { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; }
.p-infos dt { color: var(--p-muted); font-size: .88rem; }
.p-infos dd { margin: 0; font-weight: 500; word-break: break-word; }
.p-doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--p-border); border-radius: 10px; margin-bottom: 8px; }
.p-doc i { font-size: 1.3rem; color: var(--p-navy); }
.p-doc span { flex: 1; font-weight: 500; }
.p-parcours { border-left: 3px solid #e8edfa; padding: 2px 0 2px 14px; margin-bottom: 12px; }
.p-message { white-space: pre-line; background: var(--p-surface); border-radius: 10px; padding: 14px; }

/* ---------- Pages d'accueil (connexion) ---------- */
.p-invite { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.p-invite-visuel { background: linear-gradient(150deg, var(--p-navy) 0%, var(--p-navy-dark) 70%); color: #dbe4ff; padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between; }
.p-invite-visuel img { height: 42px; width: auto; filter: brightness(0) invert(1); }
.p-invite-visuel h2 { color: var(--p-white); font-size: 1.9rem; line-height: 1.3; margin: 34px 0 14px; }
.p-invite-visuel ul { list-style: none; padding: 0; margin: 26px 0 0; }
.p-invite-visuel li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.p-invite-visuel li i { color: var(--p-orange); font-size: 1.2rem; margin-top: 2px; }
.p-invite-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--p-white); }
.p-invite-carte { width: 100%; max-width: 410px; }
.p-invite-carte h1 { margin-bottom: 6px; }
.p-invite-carte > p { color: var(--p-muted); margin: 0 0 26px; }
.p-invite-logo-mobile { display: none; height: 36px; margin-bottom: 26px; }
.p-mdp { position: relative; }
.p-mdp .p-input { padding-right: 46px; }
.p-mdp button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--p-muted); cursor: pointer; padding: 6px; }
.p-invite-pied { margin-top: 26px; font-size: .85rem; color: var(--p-muted); text-align: center; }
@media (max-width: 900px) {
    .p-invite { grid-template-columns: 1fr; }
    .p-invite-visuel { display: none; }
    .p-invite-logo-mobile { display: block; }
}
