/* ==========================================================
   MINI-STAGES — THÈME « FRAMEWORK JEAN PROUVÉ »
   ----------------------------------------------------------
   Fichier : /ministages/jp-theme/jpm-theme.css
   Rôle    : aligner toutes les pages de gestion des immersions
             sur le design du site www.lycee-jean-prouve.fr
             (couleurs, typographie, bandeau Hero, cartes,
             formulaires, boutons, tableaux).

   Chargement : en DERNIER dans le <head> de chaque page, avec
   jpm-theme.js. Toutes les règles sont préfixées par html.jpm
   pour l'emporter sur les anciennes feuilles (Bootstrap, CSS
   locales) sans toucher au fonctionnement des pages.

   Les couleurs reprennent assets/css/core/jp-design-tokens.css
   et assets/css/jp-forms.css du thème astra_ministages.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Montserrat:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700&display=swap');

/* ----------------------------------------------------------
   1. Jetons de design (identiques au site)
   ---------------------------------------------------------- */
:root {
    --jpm-navy-950: #07162d;
    --jpm-navy-900: #0d2448;
    --jpm-navy-800: #18345d;
    --jpm-navy-700: #244a7d;
    --jpm-blue: #0a3f70;
    --jpm-blue-600: #24659b;
    --jpm-teal: #198f9b;
    --jpm-orange: #E8701E;
    --jpm-orange-600: #d2621a;
    --jpm-apricot: #F8A040;
    --jpm-green: #258653;
    --jpm-bordeaux: #7f1d35;
    --jpm-red: #c0392b;

    --jpm-text: #26364d;
    --jpm-heading: #153d5d;
    --jpm-muted: #52627a;
    --jpm-line: #dce5ea;
    --jpm-line-strong: #cfdbe3;
    --jpm-bg: #f4f8fb;
    --jpm-surface: #fff;
    --jpm-surface-soft: #fbfcfd;

    --jpm-font-body: "Montserrat", Arial, sans-serif;
    --jpm-font-heading: "Poppins", "Montserrat", Arial, sans-serif;
    --jpm-font-script: "Caveat", cursive;

    --jpm-radius-sm: 9px;
    --jpm-radius-md: 14px;
    --jpm-radius-lg: 20px;
    --jpm-radius-xl: 42px;
    --jpm-shadow-sm: 0 4px 16px rgba(13, 36, 72, .08);
    --jpm-shadow-md: 0 14px 42px rgba(18, 55, 85, .08);
    --jpm-shadow-lg: 0 24px 60px rgba(7, 22, 45, .18);

    /* Bootstrap 5.3 (pages d'administration) */
    --bs-primary: #0d2448;
    --bs-primary-rgb: 13, 36, 72;
    --bs-secondary: #52627a;
    --bs-secondary-rgb: 82, 98, 122;
    --bs-success: #258653;
    --bs-success-rgb: 37, 134, 83;
    --bs-info: #198f9b;
    --bs-info-rgb: 25, 143, 155;
    --bs-warning: #E8701E;
    --bs-warning-rgb: 232, 112, 30;
    --bs-danger: #c0392b;
    --bs-danger-rgb: 192, 57, 43;
    --bs-body-font-family: "Montserrat", Arial, sans-serif;
    --bs-body-color: #26364d;
    --bs-body-bg: #f4f8fb;
    --bs-link-color: #0a3f70;
    --bs-link-color-rgb: 10, 63, 112;
    --bs-link-hover-color: #d2621a;
    --bs-link-hover-color-rgb: 210, 98, 26;
    --bs-border-color: #dce5ea;
    --bs-light-rgb: 244, 248, 251;

    /* Anciennes variables du secrétariat (secretariat_verification.css) */
    --bleu-vert-primaire: #0d2448;
    --bleu-vert-secondaire: #244a7d;
    --bleu-vert-clair: #eef6fc;
    --vert: #258653;
    --vert-clair: #198f9b;
    --orange-doux: #E8701E;
    --orange-survol: #d2621a;
    --orange-texte: #d2621a;
    --rouge: #c0392b;
    --gris-texte: #26364d;
    --gris-fond: #f4f8fb;
    --gris-border: #dce5ea;
    --ombre: 0 4px 16px rgba(13, 36, 72, .08);
    --ombre-survol: 0 12px 32px rgba(13, 36, 72, .12);
}

/* ----------------------------------------------------------
   2. Base de page
   ---------------------------------------------------------- */
html.jpm body {
    max-width: none !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    text-align: left;
    color: var(--jpm-text);
    background: var(--jpm-bg) !important;
    font-family: var(--jpm-font-body) !important;
    -webkit-font-smoothing: antialiased;
}

html.jpm body :where(input, select, textarea, button) {
    font-family: var(--jpm-font-body);
}

html.jpm body :where(h1, h2, h3, h4, h5) {
    font-family: var(--jpm-font-heading);
    color: var(--jpm-heading);
    letter-spacing: -.01em;
}

html.jpm body a {
    color: var(--jpm-blue);
}

html.jpm body a:hover {
    color: var(--jpm-orange-600);
}

/* Page affichée dans une iframe : pas de mise en page flex */
html.jpm.jpm-embedded body {
    display: block;
    min-height: 0;
    padding: 12px !important;
}

/* Contenu des pages (le JS y range le contenu existant) */
html.jpm .jpm-main {
    flex: 1 0 auto;
    width: min(calc(100% - 40px), 1100px);
    margin: 34px auto 60px;
}

html.jpm body[data-jpm-width="narrow"] .jpm-main { width: min(calc(100% - 40px), 820px); }
html.jpm body[data-jpm-width="wide"] .jpm-main   { width: min(calc(100% - 40px), 1500px); }
html.jpm body[data-jpm-width="full"] .jpm-main   { width: calc(100% - 40px); }

/* ----------------------------------------------------------
   3. Bandeau Hero (même dessin que les pages du site)
   ---------------------------------------------------------- */
html.jpm .jpm-hero {
    position: relative;
    z-index: 20;
    flex: none;
    width: 100%;
    min-height: 330px;
    color: #fff;
    background: linear-gradient(135deg, #0d2448 0%, #18345d 58%, #244a7d 100%);
    border-bottom-left-radius: var(--jpm-radius-xl);
    border-bottom-right-radius: var(--jpm-radius-xl);
    font-family: var(--jpm-font-body);
}

/* Décor : cercles turquoise et orange, découpés dans le bandeau */
html.jpm .jpm-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}

html.jpm .jpm-hero-bg::before {
    content: "";
    position: absolute;
    width: 540px;
    height: 540px;
    right: -100px;
    top: -230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(25,143,155,.42) 0%, rgba(25,143,155,.08) 58%, transparent 72%);
}

html.jpm .jpm-hero-bg::after {
    content: "";
    position: absolute;
    width: 390px;
    height: 390px;
    right: 12%;
    bottom: -250px;
    border-radius: 50%;
    border: 58px solid rgba(232,112,30,.13);
}

/* Photo du bandeau : même traitement que les Hero du site
   (bleu foncé à gauche, photo visible à droite) */
html.jpm .jpm-hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 35%;
    z-index: 0;
}

html.jpm .jpm-hero.has-photo .jpm-hero-bg::before {
    z-index: 1;
    inset: 0;
    width: auto;
    height: auto;
    top: 0;
    right: 0;
    border-radius: 0;
    background: linear-gradient(90deg,
        rgba(8, 23, 47, .94) 0%,
        rgba(8, 23, 47, .88) 33%,
        rgba(8, 23, 47, .58) 47%,
        rgba(8, 23, 47, .20) 62%,
        rgba(8, 23, 47, .04) 100%);
}

html.jpm .jpm-hero.has-photo .jpm-hero-bg::after { display: none; }

@media (max-width: 900px) {
    html.jpm .jpm-hero.has-photo .jpm-hero-bg::before {
        background: linear-gradient(180deg, rgba(8,23,47,.80) 0%, rgba(8,23,47,.88) 100%);
    }
}

html.jpm .jpm-hero-inner {
    position: relative;
    z-index: 2;
    width: min(86%, 1500px);
    margin: 0 auto;
    padding: 34px 0 44px;
}

/* Place réservée au header du site (logo + menu) */
html.jpm.jpm-header-ready .jpm-hero-inner {
    padding-top: 165px;
}

html.jpm .jpm-hero-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}

html.jpm .jpm-hero-type {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--jpm-orange);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .045em;
    text-transform: uppercase;
}

html.jpm .jpm-hero-surtitre {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.17);
    border: 1px solid rgba(255,255,255,.17);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

html.jpm .jpm-hero h1,
html.jpm .jpm-hero .jpm-hero-title {
    max-width: 960px;
    margin: 0 0 12px !important;
    padding: 0 !important;
    color: #fff !important;
    background: none !important;
    text-align: left !important;
    font-family: var(--jpm-font-heading) !important;
    font-size: clamp(30px, 3.2vw, 50px) !important;
    font-weight: 500 !important;
    line-height: 1.06 !important;
    letter-spacing: -.018em !important;
}

html.jpm .jpm-hero-subtitle {
    max-width: 820px;
    margin: 0 !important;
    color: rgba(255,255,255,.9) !important;
    text-align: left !important;
    font-family: var(--jpm-font-body) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;
}

html.jpm .jpm-hero-script {
    display: block;
    margin-top: 16px;
    color: var(--jpm-apricot);
    font-family: var(--jpm-font-script);
    font-size: clamp(28px, 2.4vw, 38px);
    font-weight: 600;
    line-height: 1;
    transform: rotate(-1deg);
    text-shadow: 0 2px 5px rgba(0,0,0,.18);
}

/* Marque de secours si le header du site n'a pas pu être chargé */
html.jpm .jpm-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
    color: #fff !important;
    text-decoration: none !important;
}

html.jpm.jpm-header-ready .jpm-brand {
    display: none;
}

html.jpm .jpm-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 118px;
    height: 70px;
    padding: 5px 10px;
    background: #fff;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 22px rgba(0,0,0,.15);
}

html.jpm .jpm-brand-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

html.jpm .jpm-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

html.jpm .jpm-brand-copy strong {
    font-family: var(--jpm-font-heading);
    font-size: 15px;
    font-weight: 600;
}

html.jpm .jpm-brand-copy span {
    font-family: var(--jpm-font-script);
    font-size: 19px;
    color: rgba(255,255,255,.86);
}

/* Variante « administration » : bandeau compact, pas de menu du site */
html.jpm body.jpm-variant-admin .jpm-hero {
    min-height: 0;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
}

html.jpm body.jpm-variant-admin .jpm-hero-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;
    padding: 0 0 22px;
}

html.jpm body.jpm-variant-admin .jpm-brand {
    margin: 0;
    align-self: start;
}

html.jpm body.jpm-variant-admin .jpm-brand-copy { display: none; }

html.jpm body.jpm-variant-admin .jpm-hero-text { padding-top: 20px; }

html.jpm body.jpm-variant-admin .jpm-hero-badges { margin-bottom: 8px; }

html.jpm body.jpm-variant-admin .jpm-hero-type,
html.jpm body.jpm-variant-admin .jpm-hero-surtitre {
    min-height: 28px;
    padding: 5px 12px;
    font-size: 11px;
}

html.jpm body.jpm-variant-admin .jpm-hero h1 {
    margin: 0 !important;
    font-size: clamp(22px, 2vw, 32px) !important;
}

html.jpm body.jpm-variant-admin .jpm-hero-subtitle { font-size: 14px !important; margin-top: 4px !important; }

html.jpm body.jpm-variant-admin .jpm-hero-script {
    margin: 20px 0 0;
    font-size: 28px;
}

html.jpm body.jpm-variant-admin .jpm-main { margin-top: 26px; }

/* ----------------------------------------------------------
   4. Header partagé du site (chargé par l'API du thème)
   ---------------------------------------------------------- */
html.jpm .jpm-hero > .jpm-header-slot {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 10050;
    width: 100vw;
    height: 0;
    transform: translateX(-50%);
    background: transparent;
}

html.jpm .jpm-header-slot .jp-modern-header,
html.jpm .jpm-header-slot .jp-modern-header * {
    box-sizing: border-box;
}

html.jpm .jpm-header-slot .jp-modern-header,
html.jpm .jpm-header-slot .jp-modern-header__inner {
    background: transparent !important;
}

html.jpm .jpm-header-slot .jp-modern-header ul,
html.jpm .jpm-header-slot .jp-modern-header ol,
html.jpm .jpm-header-slot .jp-modern-header li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

html.jpm .jpm-header-slot .jp-modern-header img {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

html.jpm .jpm-header-slot .jp-modern-header a { text-decoration: none; }

html.jpm .jpm-header-slot .jp-modern-header button.jp-modern-header__toggle {
    margin: 0 !important;
    box-shadow: none !important;
}

/* Écriture manuscrite progressive (comme sur le site) */
html.jpm [data-jpm-char="1"] { opacity: 0; }
html.jpm [data-jpm-char="1"].is-visible { opacity: 1; }

/* ----------------------------------------------------------
   5. Pied de page
   ---------------------------------------------------------- */
html.jpm .jpm-footer {
    flex: none;
    margin-top: auto;
    padding: 20px 28px;
    background: var(--jpm-navy-900);
    color: rgba(255,255,255,.76);
    font-family: var(--jpm-font-body);
    font-size: 12px;
}

html.jpm .jpm-footer-inner {
    width: min(100%, 1500px);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

html.jpm .jpm-footer a {
    margin-left: 16px;
    color: #fff !important;
    text-decoration: none;
}

html.jpm .jpm-footer a:hover { color: #ffd2b3 !important; }

/* ----------------------------------------------------------
   6. Composants génériques réutilisables
   ---------------------------------------------------------- */

/* Carte blanche « formulaire du site » */
html.jpm .jpm-card,
html.jpm .jpm-page-form .jpm-main > .container,
html.jpm .jpm-main .reservation-form-container,
html.jpm .jpm-main #calendar {
    background: #fff;
    border: 1px solid var(--jpm-line);
    border-radius: var(--jpm-radius-lg);
    box-shadow: var(--jpm-shadow-md);
}

html.jpm .jpm-page-form .jpm-main > .container {
    box-sizing: border-box;
    max-width: none;
    width: 100%;
    padding: clamp(20px, 4vw, 38px);
}

/* Titres de sections */
html.jpm .jpm-main :where(h2) {
    font-size: clamp(20px, 1.7vw, 26px);
    font-weight: 600;
    color: var(--jpm-heading);
}

html.jpm .jpm-main :where(h3) {
    font-size: clamp(17px, 1.3vw, 20px);
    font-weight: 600;
    color: var(--jpm-heading);
}

html.jpm .jpm-main :where(h4) {
    font-size: 16px;
    font-weight: 600;
    color: var(--jpm-heading);
}

/* Champs de saisie */
html.jpm .jpm-main :where(input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], input[type=url], input:not([type]), select, textarea) {
    border: 1px solid var(--jpm-line-strong);
    border-radius: 10px;
    padding: 10px 13px;
    background-color: #fff;
    color: #1d3344;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

html.jpm .jpm-main :where(input, select, textarea):focus {
    outline: none;
    border-color: #3483ba;
    box-shadow: 0 0 0 3px rgba(52,131,186,.13);
}

html.jpm .jpm-main :where(input[readonly]) {
    background-color: #f4f8fb;
    color: var(--jpm-heading);
    font-weight: 600;
}

html.jpm .jpm-main :where(label) {
    color: var(--jpm-heading);
    font-weight: 700;
}

html.jpm .jpm-main :where(input[type=checkbox], input[type=radio]) {
    accent-color: var(--jpm-orange);
}

/* Boutons « du site » : bouton principal bleu en pilule, action orange */
html.jpm .jpm-btn,
html.jpm .jpm-main button:not([class]):not([style]),
html.jpm .jpm-main input[type=submit]:not([class]):not([style]),
html.jpm .jpm-main .submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 24px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #0a4d83, #0a3764) !important;
    color: #fff !important;
    font-family: var(--jpm-font-body) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(10,63,112,.18);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

html.jpm .jpm-btn:hover,
html.jpm .jpm-main button:not([class]):not([style]):hover,
html.jpm .jpm-main input[type=submit]:not([class]):not([style]):hover,
html.jpm .jpm-main .submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(10,63,112,.24);
    filter: brightness(1.06);
}

html.jpm .jpm-btn--orange,
html.jpm .jpm-main .submit-button {
    background: var(--jpm-orange) !important;
    box-shadow: 0 8px 20px rgba(232,112,30,.25);
}

html.jpm .jpm-btn--ghost {
    background: #fff !important;
    color: var(--jpm-blue) !important;
    border: 2px solid var(--jpm-line-strong) !important;
    box-shadow: none;
}

html.jpm .jpm-btn--danger {
    background: var(--jpm-red) !important;
    box-shadow: 0 8px 20px rgba(192,57,43,.2);
}

/* Messages */
html.jpm .jpm-main :where(.alert) {
    border-radius: 12px;
    font-weight: 600;
}

html.jpm .jpm-main .info-box,
html.jpm .jpm-main .jpm-info {
    background: #f4f8fb !important;
    border: 0 !important;
    border-left: 5px solid var(--jpm-orange) !important;
    border-radius: var(--jpm-radius-md) !important;
    padding: 18px 22px !important;
    color: #314d63;
}

html.jpm .jpm-main .warning-box {
    background: #fdecec !important;
    border: 0 !important;
    border-left: 5px solid var(--jpm-red) !important;
    border-radius: var(--jpm-radius-md) !important;
    padding: 18px 22px !important;
    color: #7a1f1f;
}

html.jpm .jpm-main :where(.info-box, .warning-box) p { margin: 6px 0 0; }
html.jpm .jpm-main :where(.info-box, .warning-box) ul { margin: 8px 0 0; padding-left: 20px; }

html.jpm .jpm-main .alert-error {
    background: #fdecec;
    color: #a12626;
    border: 1px solid #f3c9c9;
}

html.jpm .jpm-main .alert-success:not(.alert-dismissible) {
    background: #e8f6ed;
    color: #26703d;
    border: 1px solid #c7e8d1;
}

/* Tableaux */
html.jpm .jpm-main table:not(.table) {
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--jpm-line);
    border-radius: var(--jpm-radius-md);
    overflow: hidden;
}

html.jpm .jpm-main table:not(.table) th {
    background: #eef3f7;
    color: var(--jpm-heading);
    font-weight: 700;
}

html.jpm .jpm-main table:not(.table) :where(th, td) {
    border: 0;
    border-bottom: 1px solid var(--jpm-line);
}

/* ----------------------------------------------------------
   7. Bootstrap (pages d'administration)
   ---------------------------------------------------------- */
html.jpm .btn {
    --bs-btn-font-family: var(--jpm-font-body);
    --bs-btn-font-weight: 700;
    --bs-btn-border-radius: 10px;
    font-family: var(--jpm-font-body);
}

html.jpm .btn-primary {
    --bs-btn-bg: #0d2448;
    --bs-btn-border-color: #0d2448;
    --bs-btn-hover-bg: #244a7d;
    --bs-btn-hover-border-color: #244a7d;
    --bs-btn-active-bg: #07162d;
    --bs-btn-active-border-color: #07162d;
    --bs-btn-disabled-bg: #0d2448;
    --bs-btn-disabled-border-color: #0d2448;
    --bs-btn-focus-shadow-rgb: 36, 74, 125;
}

html.jpm .btn-success {
    --bs-btn-bg: #258653;
    --bs-btn-border-color: #258653;
    --bs-btn-hover-bg: #1d6c43;
    --bs-btn-hover-border-color: #1d6c43;
    --bs-btn-active-bg: #1d6c43;
    --bs-btn-active-border-color: #1d6c43;
}

html.jpm .btn-warning {
    --bs-btn-color: #fff;
    --bs-btn-bg: #E8701E;
    --bs-btn-border-color: #E8701E;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #d2621a;
    --bs-btn-hover-border-color: #d2621a;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #d2621a;
    --bs-btn-active-border-color: #d2621a;
}

html.jpm .btn-info {
    --bs-btn-color: #fff;
    --bs-btn-bg: #198f9b;
    --bs-btn-border-color: #198f9b;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #137480;
    --bs-btn-hover-border-color: #137480;
}

html.jpm .btn-danger {
    --bs-btn-bg: #c0392b;
    --bs-btn-border-color: #c0392b;
    --bs-btn-hover-bg: #a12626;
    --bs-btn-hover-border-color: #a12626;
}

html.jpm .btn-outline-primary {
    --bs-btn-color: #0d2448;
    --bs-btn-border-color: #0d2448;
    --bs-btn-hover-bg: #0d2448;
    --bs-btn-hover-border-color: #0d2448;
    --bs-btn-active-bg: #0d2448;
    --bs-btn-active-border-color: #0d2448;
}

html.jpm .card {
    border: 1px solid var(--jpm-line);
    border-radius: var(--jpm-radius-lg);
    box-shadow: var(--jpm-shadow-sm);
    overflow: hidden;
}

html.jpm .card-header {
    background: #f2f6f9;
    border-bottom: 1px solid var(--jpm-line);
    font-family: var(--jpm-font-heading);
    font-weight: 600;
    color: var(--jpm-heading);
}

html.jpm .card-header.bg-primary,
html.jpm .modal-header.bg-primary {
    background: linear-gradient(135deg, #0d2448, #244a7d) !important;
    color: #fff;
}

html.jpm .modal-content {
    border: 0;
    border-radius: var(--jpm-radius-lg);
    box-shadow: var(--jpm-shadow-lg);
    overflow: hidden;
}

html.jpm .modal-header {
    border-bottom: 1px solid var(--jpm-line);
}

html.jpm .modal-title {
    font-family: var(--jpm-font-heading);
    font-weight: 600;
}

html.jpm .table {
    --bs-table-border-color: var(--jpm-line);
    --bs-table-striped-bg: #f6f9fb;
    --bs-table-hover-bg: #eef5fa;
    vertical-align: middle;
}

html.jpm .table > thead > tr > th,
html.jpm .table > thead.table-dark > tr > th,
html.jpm .table-dark > tr > th {
    --bs-table-bg: #0d2448;
    --bs-table-color: #fff;
    background: #0d2448;
    color: #fff;
    border-color: #18345d;
    font-weight: 700;
    font-size: 13px;
}

html.jpm .nav-tabs .nav-link,
html.jpm .nav-pills .nav-link {
    color: var(--jpm-heading);
    font-weight: 700;
}

html.jpm .nav-tabs .nav-link.active {
    color: var(--jpm-orange-600);
    border-bottom-color: #fff;
}

html.jpm .nav-pills .nav-link.active {
    background: var(--jpm-navy-900);
    color: #fff;
}

html.jpm .badge.bg-primary { background: var(--jpm-navy-900) !important; }

html.jpm body.bg-light { background: var(--jpm-bg) !important; }

html.jpm .form-control,
html.jpm .form-select {
    border-color: var(--jpm-line-strong);
    border-radius: 10px;
}

html.jpm .form-control:focus,
html.jpm .form-select:focus {
    border-color: #3483ba;
    box-shadow: 0 0 0 3px rgba(52,131,186,.13);
}

html.jpm .form-check-input:checked {
    background-color: var(--jpm-orange);
    border-color: var(--jpm-orange);
}

/* ----------------------------------------------------------
   8. Calendrier de réservation (formulaire.php)
   ---------------------------------------------------------- */
html.jpm .jpm-main #calendar,
html.jpm .jpm-main .reservation-form-container { box-sizing: border-box; }

html.jpm .jpm-main #calendar {
    width: 100%;
    max-width: none;
    margin: 0 0 24px;
    padding: clamp(16px, 3vw, 30px);
}

html.jpm .jpm-main .jpm-step-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px !important;
    text-align: left !important;
    font-size: clamp(19px, 1.6vw, 24px) !important;
    color: var(--jpm-heading) !important;
}

html.jpm .jpm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--jpm-orange);
    color: #fff;
    font-family: var(--jpm-font-body);
    font-size: 15px;
    font-weight: 800;
}

html.jpm .calendar-header {
    padding: 0 !important;
    margin-bottom: 18px !important;
    gap: 12px;
}

html.jpm .calendar-header h2 {
    color: var(--jpm-heading) !important;
    font-family: var(--jpm-font-heading) !important;
    font-size: clamp(19px, 1.7vw, 26px) !important;
    font-weight: 600 !important;
}

html.jpm .calendar-header button {
    padding: 10px 18px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--jpm-navy-900) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    box-shadow: 0 6px 16px rgba(13,36,72,.18);
}

html.jpm .calendar-header button:hover:not(:disabled) { background: var(--jpm-navy-700) !important; }

html.jpm .calendar-header button:disabled,
html.jpm .calendar-header button.disabled-button {
    background: #b9c6d1 !important;
    box-shadow: none;
}

html.jpm .calendar-grid {
    gap: 6px !important;
    background: transparent !important;
    border: 0 !important;
}

html.jpm .calendar-day {
    border: 1px solid var(--jpm-line) !important;
    border-radius: 10px !important;
    background: #fff;
}

html.jpm .calendar-day.jour {
    min-height: 34px !important;
    border: 0 !important;
    background: var(--jpm-navy-900) !important;
    color: #fff !important;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

html.jpm .calendar-day.weekend { background: #f3f6f8 !important; }

html.jpm .calendar-day.sans-jour {
    background: transparent !important;
    border-style: dashed !important;
    border-color: #e7edf1 !important;
}

html.jpm .calendar-day.today { border: 2px solid var(--jpm-orange) !important; }

html.jpm .calendar-day.today .day-number {
    background: var(--jpm-orange) !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
}

html.jpm .day-number { color: var(--jpm-heading); }

html.jpm .calendar-day.ferie-vacances-cell {
    background: #fff6ed !important;
    border-color: #f6d9bd !important;
}

html.jpm .ferie-vacances { color: #a4570f !important; }

html.jpm .timeSlot {
    border-radius: 8px !important;
    font-weight: 600;
}

html.jpm .timeSlot.available {
    background: #e8f5ee !important;
    border-color: #6dbb8f !important;
    color: #1d5f3b !important;
}

html.jpm .timeSlot.available:hover { background: #d4eedf !important; }

html.jpm .timeSlot.full {
    background: #fdecec !important;
    border-color: #e6a3a3 !important;
    color: #8f2222 !important;
}

html.jpm .timeSlot.selected {
    background: var(--jpm-orange) !important;
    border-color: var(--jpm-orange-600) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(232,112,30,.35) !important;
}

/* Formulaire de réservation */
html.jpm .jpm-main .reservation-form-container {
    width: 100%;
    max-width: none;
    margin: 0 0 24px;
    padding: clamp(20px, 4vw, 38px);
}

html.jpm #VotreFormulaire h3,
html.jpm #VotreFormulaire h4 {
    text-align: left;
    color: var(--jpm-heading);
}

html.jpm #VotreFormulaire h4 {
    margin: 28px 0 12px !important;
    padding-bottom: 8px;
    border-bottom: 1px solid #e7edf1;
    font-size: 17px !important;
}

html.jpm #VotreFormulaire h4::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 10px 2px 0;
    border-radius: 50%;
    background: var(--jpm-orange);
}

html.jpm #VotreFormulaire :where(input[type=text], input[type=email], input[type=tel], select, textarea) {
    min-height: 44px;
    font-size: 14px !important;
}

html.jpm #VotreFormulaire .remark-box {
    width: 100% !important;
    min-height: 90px;
}

html.jpm #nonScolariseContainer label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid #d8e2e8;
    border-radius: 10px;
    background: #fbfcfd;
    font-weight: 600;
    cursor: pointer;
}

html.jpm .jpm-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #e7edf1;
}

html.jpm .jpm-form-note {
    margin: 10px 0 0 !important;
    color: #70818c;
    font-size: 12px !important;
    font-style: italic;
    text-align: center;
}

/* ----------------------------------------------------------
   9. Suivi des conventions (secretariat_verification.php)
   ---------------------------------------------------------- */
html.jpm .jpm-page-secretariat {
    font-size: 13px;
}

html.jpm .jpm-page-secretariat .jpm-main {
    margin-top: 22px;
}

html.jpm .jpm-page-secretariat .header { display: none !important; }

html.jpm .jpm-page-secretariat .page-layout {
    gap: 22px;
    align-items: flex-start;
}

html.jpm .jpm-page-secretariat .sidebar {
    padding: 12px !important;
    background: #fff !important;
    border: 1px solid var(--jpm-line) !important;
    border-radius: var(--jpm-radius-lg);
    box-shadow: var(--jpm-shadow-sm);
    top: 18px !important;
}

html.jpm .jpm-page-secretariat .tab-button {
    border-radius: 10px;
    border-left: 0 !important;
    font-size: 12px !important;
    font-weight: 700;
    color: var(--jpm-heading) !important;
}

html.jpm .jpm-page-secretariat .tab-button.active {
    background: var(--jpm-navy-900) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(13,36,72,.18);
}

html.jpm .jpm-page-secretariat .tab-button:not(.active):hover {
    background: #eef3f7 !important;
}

html.jpm .jpm-page-secretariat h2,
html.jpm .jpm-page-secretariat h3 {
    color: var(--jpm-heading);
}

html.jpm .jpm-page-secretariat :where(.convention-card, .creneau-card, .participant-card, .settings-card) {
    border-radius: var(--jpm-radius-md);
    border-color: var(--jpm-line);
}

html.jpm .jpm-page-secretariat .month-header {
    font-family: var(--jpm-font-heading);
    color: var(--jpm-heading);
}

/* ----------------------------------------------------------
   9 bis. Pages publiques : formulaires simples, signature,
          messages, inscription des participants
   ---------------------------------------------------------- */
html.jpm .jpm-main :where(input, select, textarea) { box-sizing: border-box; max-width: 100%; }

/* Annulation / téléversement de convention */
html.jpm .jpm-page-form .jpm-main > .container {
    padding: clamp(22px, 4vw, 40px);
}

html.jpm .jpm-page-form .jpm-main .form-group { margin-bottom: 22px; }

html.jpm .jpm-page-form .jpm-main label { margin-bottom: 7px; }

html.jpm .jpm-page-form .jpm-main input[type=file] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--jpm-line-strong);
    border-radius: 12px;
    background: var(--jpm-surface-soft);
    color: var(--jpm-muted);
    cursor: pointer;
}

html.jpm .jpm-page-form .jpm-main input[type=file]::file-selector-button {
    margin-right: 14px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--jpm-navy-900);
    color: #fff;
    font-family: var(--jpm-font-body);
    font-weight: 700;
    cursor: pointer;
}

html.jpm .jpm-page-form .jpm-main :where(button.btn, .btn[type=submit], input[type=submit]) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 260px;
    min-height: 46px;
    margin: 26px auto 0 !important;
    padding: 12px 28px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #0a4d83, #0a3764) !important;
    color: #fff !important;
    font-family: var(--jpm-font-body) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    box-shadow: 0 8px 20px rgba(10,63,112,.18);
    cursor: pointer;
}

/* L'annulation reste une action « danger », mais au format du site */
html.jpm .jpm-page-form .jpm-main button.btn[onclick*="confirm"] {
    background: var(--jpm-red) !important;
    box-shadow: 0 8px 20px rgba(192,57,43,.22);
}

html.jpm .jpm-page-form .jpm-main :where(button.btn, input[type=submit]):hover { filter: brightness(1.08); }

html.jpm .jpm-page-form .jpm-main .alert:empty { display: none; }

html.jpm .jpm-page-form .jpm-main :where(.btn-secondary, a.btn-secondary) {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border: 2px solid var(--jpm-line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--jpm-blue) !important;
    font-weight: 700;
    text-decoration: none;
}

/* Signature de la convention */
html.jpm .jpm-page-signature .jpm-main #pdf-viewer,
html.jpm .jpm-page-signature .jpm-main iframe {
    box-sizing: border-box;
    width: 100% !important;
    border: 1px solid var(--jpm-line) !important;
    border-radius: var(--jpm-radius-lg);
    background: #fff;
    box-shadow: var(--jpm-shadow-md);
}

html.jpm .jpm-page-signature .jpm-main .info-text {
    margin: 24px 0 18px;
    padding: 18px 22px;
    border: 0;
    border-left: 5px solid var(--jpm-orange);
    border-radius: var(--jpm-radius-md);
    background: #fff;
    color: #314d63;
    font-size: 15px;
    line-height: 1.55;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm .jpm-page-signature .jpm-main canvas {
    max-width: 100%;
    border: 2px dashed #9fb4c4 !important;
    border-radius: 16px;
    background: #fff !important;
    box-shadow: inset 0 0 0 6px #fbfcfd;
    cursor: crosshair;
    touch-action: none;
}

html.jpm .jpm-page-signature .jpm-main .buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

html.jpm .jpm-page-signature .jpm-main .buttons button,
html.jpm .jpm-page-signature .jpm-main .zone button {
    min-height: 44px;
    padding: 11px 24px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--jpm-orange) !important;
    color: #fff !important;
    font-family: var(--jpm-font-body) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: 0 8px 20px rgba(232,112,30,.25);
    cursor: pointer;
}

html.jpm .jpm-page-signature .jpm-main .buttons #clear,
html.jpm .jpm-page-signature .jpm-main .buttons button + button {
    background: #fff !important;
    color: var(--jpm-blue) !important;
    border: 2px solid var(--jpm-line-strong) !important;
    box-shadow: none;
}

html.jpm .jpm-page-signature .jpm-main .zone {
    margin: 22px 0;
    padding: 22px;
    border: 1px solid var(--jpm-line);
    border-radius: var(--jpm-radius-lg);
    background: #fff;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm .jpm-page-signature #modal-box,
html.jpm .jpm-page-message .modal-content {
    border-radius: var(--jpm-radius-lg) !important;
    box-shadow: var(--jpm-shadow-lg) !important;
    font-family: var(--jpm-font-body);
}

html.jpm .jpm-page-signature #modal-overlay,
html.jpm .jpm-page-signature #wait-overlay,
html.jpm .jpm-page-message .modal.show.d-block {
    background: rgba(7,22,45,.62) !important;
    backdrop-filter: blur(2px);
}

/* Pages de message (réservation impossible, convention envoyée…) */
html.jpm .jpm-page-message .jpm-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

html.jpm .jpm-page-message .jpm-main > .alert,
html.jpm .jpm-page-message .jpm-main > .jpm-card {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 22px;
    padding: 30px clamp(20px, 4vw, 40px);
    border: 1px solid var(--jpm-line);
    border-top: 5px solid var(--jpm-red);
    border-radius: var(--jpm-radius-lg);
    background: #fff;
    color: var(--jpm-text);
    font-weight: 500;
    box-shadow: var(--jpm-shadow-md);
}

html.jpm .jpm-page-message .jpm-main > .jpm-card { border-top-color: var(--jpm-orange); }

html.jpm .jpm-page-message .jpm-main > .alert h2,
html.jpm .jpm-page-message .jpm-main > .jpm-card h2 {
    margin: 0 0 10px;
    color: var(--jpm-heading);
}

html.jpm .jpm-page-message .jpm-main > .alert p { margin: 6px 0 0; color: var(--jpm-muted); }

html.jpm .jpm-page-message .jpm-main > a.btn {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    margin: 0;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--jpm-orange) !important;
    color: #fff !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(232,112,30,.25);
}

html.jpm .jpm-page-message .modal-header {
    justify-content: center;
    border: 0;
    background: linear-gradient(135deg, #0d2448, #244a7d) !important;
    color: #fff !important;
}

html.jpm .jpm-page-message .modal-header.bg-success { border-bottom: 5px solid #3fa06c; }
html.jpm .jpm-page-message .modal-header.bg-warning,
html.jpm .jpm-page-message .modal-header.bg-danger { border-bottom: 5px solid var(--jpm-orange); }

html.jpm .jpm-page-message .modal-body { padding: 26px 28px 28px; line-height: 1.55; }

html.jpm .jpm-page-message .modal-body .btn {
    min-width: 140px;
    padding: 11px 26px;
    border-radius: 999px;
}

html.jpm .jpm-spinner {
    display: block;
    width: 38px;
    height: 38px;
    margin: 0 auto 16px;
    border: 4px solid #e2eaf0;
    border-top-color: var(--jpm-orange);
    border-radius: 50%;
    animation: jpm-spin .8s linear infinite;
}

@keyframes jpm-spin { to { transform: rotate(360deg); } }

/* Inscription des participants (immersion collective) */
html.jpm .jpm-page-participants .jpm-main > .container { padding: 0 !important; background: none; border: 0; box-shadow: none; }
html.jpm .jpm-page-participants .card img[src*="logo"] { display: none; }
html.jpm .jpm-page-participants .card-body { padding: clamp(20px, 3vw, 34px); }
html.jpm .jpm-page-participants .card-title { color: var(--jpm-heading); }

/* ----------------------------------------------------------
   10. Responsive
   ---------------------------------------------------------- */
@media (max-width: 900px) {
    html.jpm .jpm-hero {
        min-height: 0;
        border-bottom-left-radius: 26px;
        border-bottom-right-radius: 26px;
    }

    html.jpm .jpm-hero-inner {
        width: min(calc(100% - 36px), 1500px);
        padding: 26px 0 34px;
    }

    html.jpm.jpm-header-ready .jpm-hero-inner { padding-top: 135px; }

    html.jpm .jpm-hero h1 { font-size: 30px !important; }
    html.jpm .jpm-hero-subtitle { font-size: 15px !important; }
    html.jpm .jpm-hero-script { font-size: 28px; }

    html.jpm body.jpm-variant-admin .jpm-hero-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 0;
    }

    html.jpm body.jpm-variant-admin .jpm-hero-script { display: none; }

    html.jpm .jpm-main { width: calc(100% - 24px) !important; margin-top: 22px; }

    html.jpm .jpm-footer-inner { flex-direction: column; text-align: center; }
    html.jpm .jpm-footer a { margin: 0 8px; }
}

@media print {
    html.jpm .jpm-hero,
    html.jpm .jpm-footer { display: none !important; }
    html.jpm .jpm-main { margin: 0; width: 100%; }
}

/* Titres blancs dans les en-têtes colorés (Bootstrap) */
html.jpm :where(.modal-header, .card-header).bg-primary :where(h1, h2, h3, h4, h5, .modal-title),
html.jpm .jpm-page-message .modal-header .modal-title,
html.jpm .text-white :where(h1, h2, h3, h4, h5) {
    color: #fff !important;
}

/* ----------------------------------------------------------
   11. Pages d'administration — ajustements
   ---------------------------------------------------------- */

/* Suivi des conventions : la colonne de contenu ne doit pas déborder */
html.jpm .jpm-page-secretariat #secretariat-verification-container {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 !important;
}

html.jpm .jpm-page-secretariat .main-content { height: auto; min-height: 60vh; }

/* Onglets (admin_admin, admin_responsable, admin_prof) */
html.jpm .jpm-page-admin .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 8px;
    border: 1px solid var(--jpm-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm .jpm-page-admin .tabs .tab {
    margin: 0 !important;
    padding: 10px 18px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--jpm-heading) !important;
    font-family: var(--jpm-font-body) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    cursor: pointer;
}

html.jpm .jpm-page-admin .tabs .tab:hover { background: #eef3f7 !important; }

html.jpm .jpm-page-admin .tabs .tab.active {
    background: var(--jpm-navy-900) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(13,36,72,.18) !important;
}

html.jpm .jpm-page-admin .tab-content {
    border: 1px solid var(--jpm-line) !important;
    border-radius: var(--jpm-radius-lg) !important;
    background: #fff;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm .jpm-page-admin .tab-content > select {
    min-width: 280px;
    margin-bottom: 14px;
}

/* Téléversement de la convention finale : barre de retour */
html.jpm .jpm-page-form .jpm-main > .header {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 18px;
    padding: 0;
    background: none !important;
    box-shadow: none !important;
}

/* Agenda des créneaux */
html.jpm .jpm-page-agenda .jpm-main h2,
html.jpm .jpm-page-agenda .text-primary { color: var(--jpm-heading) !important; font-family: var(--jpm-font-heading); }

html.jpm .jpm-page-agenda .jpm-main .btn-outline-primary,
html.jpm .jpm-page-agenda .jpm-main .d-flex > button {
    border-radius: 999px !important;
    background: var(--jpm-navy-900) !important;
    border-color: var(--jpm-navy-900) !important;
    color: #fff !important;
    font-weight: 700;
}

html.jpm .jpm-page-agenda .jpm-main > .container {
    max-width: none;
    padding: clamp(18px, 3vw, 30px) !important;
}

/* Liste des formations (menu_agenda.php) */
html.jpm .jpm-page-menu .jpm-main ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

html.jpm .jpm-page-menu .jpm-main li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid var(--jpm-line);
    border-left: 5px solid var(--jpm-orange);
    border-radius: var(--jpm-radius-md);
    background: #fff;
    color: var(--jpm-heading);
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm .jpm-page-menu .jpm-main li a::after { content: "→"; color: var(--jpm-orange); }

/* Tableaux larges (liste des immersions à venir, loge) */
html.jpm :where(.jpm-page-liste, .jpm-page-loge) .jpm-main table {
    width: 100%;
    box-shadow: var(--jpm-shadow-sm);
}

html.jpm :where(.jpm-page-liste, .jpm-page-loge) .jpm-main table th {
    background: var(--jpm-navy-900) !important;
    color: #fff !important;
}

html.jpm .jpm-page-secretariat .main-content { min-width: 0; }

html.jpm .jpm-page-secretariat .main-content > .tab-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
}

html.jpm .jpm-page-secretariat .jpm-main h2 { font-size: 18px; line-height: 1.3; }
html.jpm .jpm-page-secretariat .jpm-main h3 { font-size: 15px; }
