:root {
    --brand: #17147a;
    --brand-dark: #0b0a4f;
    --green: #16833a;
    --green-dark: #0c5d2a;
    --sky: #d8f2fb;
    --accent: #c99721;
    --soft: #f4fbf6;
    --ink: #16213d;
}

body {
    background: linear-gradient(180deg, #f6fbff 0, #f7faf4 260px, #f8fafc 100%);
    color: var(--ink);
}

.topbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 4px solid var(--green);
    box-shadow: 0 8px 24px rgba(23, 20, 122, .08);
}

/* ── Topbar 3 blocs ──────────────────────────────────────────────────────── */

/*
 * Mobile : [logo gauche] [☰ hamburger] [logo droite]
 *          [menu collapse pleine largeur en dessous]
 *
 * Desktop lg+ : [logo gauche · flex:1] [nav · auto] [logo droite · flex:1]
 *   Les deux côtés ont flex:1 égal → le nav est toujours centré.
 */

.topbar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding-top: .4rem;
    padding-bottom: .4rem;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
.topbar-brand--left  { flex: 1;        order: 1; }
.topbar-toggler      {                 order: 2; }
.topbar-brand--right { flex: 1;        order: 3; display: flex; justify-content: flex-end; }
.topbar-nav          { flex-basis: 100%; order: 10; } /* pleine largeur sous la barre */

/* ── Desktop lg+ ─────────────────────────────────────────────────────────── */
@media (min-width: 992px) {
    .topbar-inner    { flex-wrap: nowrap; }

    .topbar-brand--left  { order: 1; flex: 1; }        /* s'étire à gauche  */
    .topbar-nav          { order: 2; flex: 0 0 auto; } /* taille naturelle, centré */
    .topbar-brand--right { order: 3; flex: 1; }        /* s'étire à droite  */
    .topbar-toggler      { display: none !important; }
}

/* ── Liens logos ─────────────────────────────────────────────────────────── */
.topbar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    text-decoration: none;
    color: var(--brand);
}
.topbar-brand:hover { color: var(--green); }

.brand-label {
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    max-width: 140px;
}

/* Texte masqué sur très petit écran */
@media (max-width: 479px) {
    .brand-label { display: none; }
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(23, 20, 122, .18);
    flex-shrink: 0;
}

.navbar .nav-link {
    color: var(--brand-dark);
    font-weight: 600;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--green);
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: clamp(520px, 72vh, 680px);
    color: var(--ink);
    border-bottom: 1px solid rgba(23, 20, 122, .08);
}

.landing-hero {
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(246, 250, 252, .94) 0%, rgba(246, 250, 252, .78) 42%, rgba(246, 250, 252, .36) 100%),
        url('../img/campus-ensahv-blur.jpg');
    background-size: cover;
    background-position: center;
    filter: none;
    transform: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.landing-panel {
    max-width: 720px;
    padding: 2rem 0;
}

.landing-panel h1 {
    color: var(--brand-dark);
    line-height: 1.12;
}

.landing-panel .lead {
    max-width: 660px;
    color: #40506b;
}

.hero-logo {
    width: 76px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .95);
    background: #fff;
    box-shadow: 0 10px 28px rgba(23, 20, 122, .16);
}

.badge-soft {
    background: #e9f7ee;
    color: var(--green-dark);
    border: 1px solid #c9e9d3;
}

.section-title {
    color: var(--brand);
}

.card {
    border-radius: 8px;
}

.card,
.bg-white {
    border-top: 3px solid rgba(22, 131, 58, .14);
}

.form-control,
.form-select,
textarea.form-control {
    background: #f1f3f5;
    border-color: #d7dee6;
    border-radius: 0;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background: #f7f9fb;
    border-color: rgba(23, 20, 122, .35);
    box-shadow: 0 0 0 .2rem rgba(23, 20, 122, .08);
}

.form-select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='20' viewBox='0 0 20 20'><path d='M5 7l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: auto;
}

.btn-success {
    background-color: var(--green);
    border-color: var(--green);
}

.btn-success:hover,
.btn-success:focus {
    background-color: var(--green-dark);
    border-color: var(--green-dark);
}

.btn-outline-success {
    color: var(--brand);
    border-color: var(--brand);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background-color: var(--brand);
    border-color: var(--brand);
}

.text-success {
    color: var(--green) !important;
}

.table thead th {
    color: var(--brand-dark);
    background: #eef8fb;
    border-bottom-color: #cfe8f0;
}

.text-bg-success {
    background-color: var(--green) !important;
}

.required::after {
    color: #b02a37;
    content: " *";
}

.candidate-photo-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

.btn,
.btn-success,
.btn-outline-success {
    border-radius: 0 !important;
}

/* Champs désactivés (ex : région/dept pour non-Camerounais) */
.form-select:disabled,
.form-control:disabled {
    background-color: #c2c8d0 !important;
    color: #4a5568 !important;
    border-color: #9da5b0 !important;
    cursor: not-allowed;
    opacity: 1 !important;
}

/* Alternance de couleurs branded pour tous les tableaux */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f0f8f3;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff;
}

/* Badges de décision */
.badge-admis      { background-color: #16833a; color: #fff; }
.badge-rejete     { background-color: #b02a37; color: #fff; }
.badge-reoriente  { background-color: #c99721; color: #fff; }
.badge-non-traite { background-color: #6c757d; color: #fff; }

/* Textarea compacte dans les tableaux */
.obs-textarea {
    min-height: 54px;
    resize: vertical;
    font-size: .8rem;
}