/* Page « Postuler » : l'offre (colonne étroite, fixe au défilement) et le formulaire (colonne large).
   Sur téléphone : bandeau résumé de l'offre, puis le formulaire tout de suite ; le détail se déplie. */

.page-postuler { background: #f4f7fb; }

.apply {
    padding: calc(var(--nav-height, 80px) + 28px) 0 64px;
}
.apply .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.apply-back {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--primary-color, #005b9a);
    font-weight: 600;
    text-decoration: none;
}
.apply-back:hover { text-decoration: underline; }

.apply-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 28px;
    align-items: start;
}

/* ---------- L'offre ---------- */
.apply-offer {
    position: sticky;
    top: calc(var(--nav-height, 80px) + 20px);
    max-height: calc(100vh - var(--nav-height, 80px) - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 40, 80, .07);
}
.apply-offer-head {
    padding: 24px 24px 18px;
    border-bottom: 1px solid #edf1f5;
    background: linear-gradient(135deg, rgba(0, 91, 154, .06), rgba(116, 194, 225, .10));
    border-radius: 16px 16px 0 0;
}
.apply-domain {
    display: inline-block;
    margin-bottom: 8px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--primary-color, #005b9a);
}
.apply-offer-head h1 {
    margin: 0 0 10px;
    font-size: 1.45rem;
    line-height: 1.25;
    color: #10253a;
}
.apply-offer-head .status { display: inline-block; }
.apply-intro { margin: 8px 0 0; color: #456; line-height: 1.55; }

.apply-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
.apply-facts li {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dde6ee;
    font-size: .85rem;
    color: #345;
}
.apply-facts i { color: var(--primary-color, #005b9a); }
.apply-facts .apply-deadline { border-color: #f5c26b; background: #fff8eb; }

.apply-offer-more > summary {
    display: none; /* sur ordinateur, le détail reste ouvert */
}
.apply-offer-body { padding: 18px 24px 24px; color: #3a4a5a; font-size: .95rem; line-height: 1.6; }
.apply-offer-body h2 {
    margin: 18px 0 6px;
    font-size: 1rem;
    color: #10253a;
}
.apply-offer-body h2:first-child { margin-top: 0; }
.apply-offer-body ul { margin: 0; padding-left: 0; list-style: none; }
.apply-offer-body li { position: relative; padding-left: 22px; margin: 4px 0; }
.apply-offer-body li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', sans-serif;
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    font-size: .8rem;
    color: #28a745;
}
.apply-others a { color: var(--primary-color, #005b9a); font-weight: 600; }

/* ---------- Le formulaire ---------- */
.apply-form-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 40, 80, .07);
    padding: 28px 32px 32px;
}
.apply-form-title { margin: 0 0 4px; font-size: 1.5rem; color: #10253a; }
.apply-form-sub { margin: 0 0 20px; color: #6a7a8a; font-size: .9rem; }

.apply-step {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}
.apply-step legend {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #10253a;
}
.apply-step legend span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color, #005b9a);
    color: #fff;
    font-size: .85rem;
}
.apply-form select,
.apply-form input[type="date"],
.apply-form input[type="url"] {
    width: 100%;
    padding: .75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.apply-form select:focus,
.apply-form input[type="date"]:focus,
.apply-form input[type="url"]:focus { outline: none; border-color: var(--primary-color, #005b9a); }
.apply-form .form-group label:not(.cand-file) { display: block; margin-bottom: 6px; font-weight: 600; color: #2a3a4a; }
.apply-form .checkbox-group { display: flex; gap: 10px; align-items: flex-start; }
.apply-form .checkbox-group label { font-weight: 400 !important; }

.apply-done,
.apply-closed {
    padding: 24px 8px;
    text-align: center;
}
.apply-done > i { font-size: 3rem; color: #28a745; }
.apply-closed > i { font-size: 2.6rem; color: #dc3545; }
.apply-done h2,
.apply-closed h2 { margin: 12px 0 8px; color: #10253a; }
.apply-done p,
.apply-closed p { color: #4a5a6a; max-width: 520px; margin: 0 auto 10px; line-height: 1.6; }
.apply-done-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; margin-top: 18px; }
.apply-link { color: var(--primary-color, #005b9a); font-weight: 600; }

/* ---------- Téléphone et tablette : le formulaire d'abord ---------- */
@media (max-width: 900px) {
    .apply { padding-top: calc(var(--nav-height, 80px) + 16px); }
    .apply .container { padding: 0 12px; }
    .apply-grid { grid-template-columns: 1fr; gap: 14px; }

    .apply-offer {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .apply-offer-head { padding: 16px 16px 12px; }
    .apply-offer-head h1 { font-size: 1.2rem; margin-bottom: 8px; }
    .apply-facts { gap: 6px; margin-top: 10px; }
    .apply-facts li { font-size: .78rem; padding: 4px 8px; }
    .apply-intro { font-size: .9rem; }

    .apply-offer-more > summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        cursor: pointer;
        list-style: none;
        font-weight: 600;
        color: var(--primary-color, #005b9a);
    }
    .apply-offer-more > summary::-webkit-details-marker { display: none; }
    .apply-offer-more > summary::after { content: '\25BE'; transition: transform .2s; }
    .apply-offer-more[open] > summary::after { transform: rotate(180deg); }
    .apply-offer-body { padding: 4px 16px 18px; font-size: .9rem; }
    .apply-others { display: none; }

    .apply-form-card { padding: 20px 16px 24px; border-radius: 14px; }
    .apply-form-title { font-size: 1.25rem; }
    .apply-step legend { font-size: 1rem; }
    .cand-submit { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 8px 20px rgba(0, 91, 154, .25); }
}

/* Ajustements : le formulaire reste une carte blanche (les <section> du site ont un fond gris),
   et sur téléphone le bandeau de l'offre est réduit au minimum pour laisser la place au formulaire. */
.apply-form-card { background: #fff !important; }
@media (max-width: 900px) {
    .apply-offer-head h1 { font-size: 1.15rem !important; line-height: 1.3 !important; }
    .apply-offer-head .status { font-size: .7rem; padding: 3px 10px; }
    .apply-facts li:nth-child(n+4) { display: none; } /* le reste est dans « Voir le détail » */
    .apply-back { margin-bottom: 10px; font-size: .9rem; }
    .apply-intro { display: none; }
    .apply-form-title { font-size: 1.15rem !important; }
}
.apply-step-hint { margin: -4px 0 12px; font-size: .88rem; }
#precisionMetierGroup[hidden] { display: none; }
