/* Apostrophe – Espace apprenants & formateurs */
.apfo-espace{
  --apfo-accent:#7155FF; --apfo-ink:#29007D;
  --bg:#F6F4FB; --surface:#FFFFFF; --ink:var(--apfo-ink); --text:#2A2340; --muted:#6F6888; --line:#E7E2F3;
  --soft:color-mix(in srgb,var(--apfo-accent) 12%,#fff); --we:#FAF8FD;
  --alert:#B42318; --alert-soft:#FEECEB;
  max-width:1240px; margin:0 auto; padding:32px 20px 56px; color:var(--text);
  font-size:15px; line-height:1.5; box-sizing:border-box; -webkit-font-smoothing:antialiased;
}
.apfo-espace *,.apfo-espace *::before,.apfo-espace *::after{box-sizing:border-box}
.apfo-espace button{font:inherit;color:inherit;cursor:pointer;margin:0}
.apfo-espace a{color:var(--apfo-accent)}
.apfo-espace button:focus-visible,.apfo-espace a:focus-visible,.apfo-espace input:focus-visible{outline:2px solid var(--apfo-accent);outline-offset:2px}
.apfo-espace p{padding:0;margin:0}
.apfo-espace .apfo-h{font-family:inherit;color:var(--ink);font-weight:700;line-height:1.05;margin:0;padding:0;letter-spacing:-.01em}
.apfo-espace .apfo-h em{font-style:normal;color:var(--apfo-accent)}
.apfo-espace .apfo-xl{font-size:clamp(34px,5vw,56px)}
.apfo-espace .apfo-lg{font-size:clamp(24px,3vw,32px);text-transform:capitalize}
.apfo-espace .apfo-lg em{color:var(--muted)}
.apfo-espace .apfo-md{font-size:20px;margin-bottom:12px}
.apfo-espace .apfo-muted{color:var(--muted)}
.apfo-espace .apfo-small{font-size:13px}
.apfo-espace .apfo-kicker{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.apfo-espace .apfo-chip{display:inline-block;background:var(--apfo-accent);color:#fff;border-radius:999px;padding:3px 10px;letter-spacing:.06em;margin-right:6px}
.apfo-espace .apfo-hidden{display:none!important}

/* Barre équipe */
.apfo-espace .apfo-adminbar{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;background:#FFF8E1;border:1px dashed #E0B84F;border-radius:12px;padding:10px 14px;margin-bottom:24px;font-size:13px}
.apfo-espace .apfo-adminbar select{font-size:13px;padding:3px 6px;margin-left:6px;border-radius:6px}
.apfo-espace .apfo-adminbar a{font-weight:700;text-decoration:none}

/* En-tête */
.apfo-espace .apfo-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.apfo-espace .apfo-head .apfo-muted{margin-top:10px}
.apfo-espace .apfo-ghost{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 16px;font-weight:700;font-size:13px;text-decoration:none;color:var(--ink)}
.apfo-espace .apfo-ghost:hover{border-color:var(--apfo-accent)}
.apfo-espace .apfo-note{display:flex;gap:12px;align-items:flex-start;background:var(--soft);border-radius:14px;padding:14px 18px;margin-bottom:24px}
.apfo-espace .apfo-dot{width:10px;height:10px;border-radius:50%;background:var(--apfo-accent);margin-top:7px;flex:none}

/* Grille */
.apfo-espace .apfo-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:28px;align-items:start}
@media (max-width:960px){.apfo-espace .apfo-grid{grid-template-columns:1fr}}
.apfo-espace .apfo-side{display:flex;flex-direction:column;gap:18px;min-width:0}
.apfo-espace .apfo-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px}
.apfo-espace .apfo-infos p{font-size:14px;color:var(--text)}

/* Prochaine séance */
.apfo-espace .apfo-next-in{position:relative;background:var(--ink);color:#fff;border-radius:18px;padding:20px 22px 20px 28px;margin-bottom:22px;overflow:hidden}
.apfo-espace .apfo-next-in::before{content:"";position:absolute;left:0;top:0;bottom:0;width:8px;background:var(--c)}
.apfo-espace .apfo-next-in .apfo-kicker{color:rgba(255,255,255,.7)}
.apfo-espace .apfo-next-t{font-size:22px;font-weight:700;line-height:1.2;color:#fff}
.apfo-espace .apfo-next-m{color:rgba(255,255,255,.8);margin-top:4px;font-size:14px}
.apfo-espace .apfo-next-in .apfo-btn{position:absolute;right:18px;top:50%;transform:translateY(-50%)}
@media (max-width:640px){.apfo-espace .apfo-next-in .apfo-btn{position:static;transform:none;margin-top:12px}}
.apfo-espace .apfo-btn{display:inline-block;border:0;background:#fff;color:var(--ink);border-radius:999px;padding:8px 18px;font-weight:700;font-size:13px;text-decoration:none}
.apfo-espace .apfo-card .apfo-btn,.apfo-espace .apfo-narrow .apfo-btn{background:var(--ink);color:#fff}

/* Barre du calendrier */
.apfo-espace .apfo-calhead{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.apfo-espace .apfo-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.apfo-espace .apfo-seg{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px}
.apfo-espace .apfo-seg button{border:0;background:transparent;padding:6px 14px;border-radius:999px;font-weight:700;font-size:13px;color:var(--muted)}
.apfo-espace .apfo-seg button[aria-pressed="true"]{background:var(--ink);color:#fff}
.apfo-espace .apfo-nav{display:inline-flex;gap:6px}
.apfo-espace .apfo-nav button{border:1px solid var(--line);background:var(--surface);border-radius:999px;height:36px;min-width:36px;padding:0 14px;font-weight:700;font-size:13px}
.apfo-espace .apfo-nav .apfo-icon{padding:0;width:36px;font-size:18px;line-height:1}
.apfo-espace .apfo-nav button:hover,.apfo-espace .apfo-seg button:hover{border-color:var(--apfo-accent)}

/* Calendrier */
.apfo-espace .apfo-cal{background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;min-width:0}
.apfo-espace .apfo-scroll{overflow-x:auto}
.apfo-espace .apfo-dow{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-bottom:1px solid var(--line);min-width:640px}
.apfo-espace .apfo-dow div{padding:10px 12px;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.apfo-espace .apfo-month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-width:640px}
.apfo-espace .apfo-day{min-height:112px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:8px;display:flex;flex-direction:column;gap:4px;min-width:0}
.apfo-espace .apfo-day:nth-child(7n){border-right:0}
.apfo-espace .apfo-day.out{opacity:.4}
.apfo-espace .apfo-day.we{background:var(--we)}
.apfo-espace .apfo-num{font-size:13px;font-weight:700;width:26px;height:26px;display:grid;place-items:center;border-radius:50%}
.apfo-espace .apfo-day.today .apfo-num{background:var(--apfo-accent);color:#fff}
.apfo-espace .apfo-pill{border:0;text-align:left;border-radius:8px;padding:5px 8px;font-size:12.5px;font-weight:700;line-height:1.2;color:#1E1530;display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.apfo-espace .apfo-pill small{display:block;font-weight:500;opacity:.8;font-size:11px}
.apfo-espace .apfo-pill:hover,.apfo-espace .apfo-ev:hover{filter:brightness(.96)}
.apfo-espace .apfo-more{border:0;background:transparent;color:var(--muted);font-size:12px;font-weight:700;text-align:left;padding:0 4px}

.apfo-espace .apfo-week{display:grid;grid-template-columns:52px repeat(7,minmax(0,1fr));min-width:760px}
.apfo-espace .apfo-whead{padding:10px 6px;border-bottom:1px solid var(--line);border-left:1px solid var(--line);font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;display:flex;flex-direction:column;gap:4px}
.apfo-espace .apfo-whead:first-child{border-left:0}
.apfo-espace .apfo-whead strong{display:block;font-size:26px;line-height:1;color:var(--ink);text-transform:none}
.apfo-espace .apfo-whead.today strong{color:var(--apfo-accent)}
.apfo-espace .apfo-whead.we,.apfo-espace .apfo-wcol.we{background:var(--we)}
.apfo-espace .apfo-hours{position:relative}
.apfo-espace .apfo-hours span{position:absolute;right:8px;font-size:11px;color:var(--muted);transform:translateY(-50%)}
.apfo-espace .apfo-wcol{position:relative;border-left:1px solid var(--line);background-image:linear-gradient(var(--line) 1px,transparent 1px);background-size:100% var(--hh)}
.apfo-espace .apfo-ev{position:absolute;border:0;border-radius:10px;padding:6px 8px;text-align:left;font-size:12.5px;font-weight:700;color:#1E1530;overflow:hidden;line-height:1.25}
.apfo-espace .apfo-ev small{display:block;font-weight:500;opacity:.8}
.apfo-espace .apfo-empty{padding:40px 20px;text-align:center;color:var(--muted);font-size:14px}

.apfo-espace .apfo-list{list-style:none;margin:0;padding:6px 0}
.apfo-espace .apfo-lday{display:grid;grid-template-columns:64px 1fr;gap:12px;padding:12px 16px;border-top:1px solid var(--line);margin:0}
.apfo-espace .apfo-lday:first-child{border-top:0}
.apfo-espace .apfo-lday.past{opacity:.55}
.apfo-espace .apfo-ldate{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase}
.apfo-espace .apfo-ldate strong{display:block;font-size:28px;line-height:1;color:var(--ink)}
.apfo-espace .apfo-lday.today .apfo-ldate strong{color:var(--apfo-accent)}
.apfo-espace .apfo-lday ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.apfo-espace .apfo-lday li{margin:0;padding:0}
.apfo-espace .apfo-lday button{width:100%;text-align:left;border:0;background:var(--we);border-left:6px solid var(--c);border-radius:10px;padding:10px 14px;display:flex;flex-direction:column;gap:2px}
.apfo-espace .apfo-lday button:hover{background:var(--soft)}
.apfo-espace .apfo-lt{font-size:12px;color:var(--muted);font-weight:700}
.apfo-espace .apfo-ln{font-weight:700;color:var(--ink)}
.apfo-espace .apfo-ll{font-size:13px;color:var(--muted)}

/* Liens */
.apfo-espace .apfo-links{list-style:none;margin:0;padding:0}
.apfo-espace .apfo-links li{margin:0;padding:0;border-top:1px solid var(--line)}
.apfo-espace .apfo-links li:first-child{border-top:0}
.apfo-espace .apfo-links a{display:flex;justify-content:space-between;gap:10px;padding:10px 0;text-decoration:none;color:var(--ink);font-weight:600;font-size:14px}
.apfo-espace .apfo-links a:hover span:first-child{color:var(--apfo-accent)}
.apfo-espace .apfo-links a span:last-child{color:var(--apfo-accent)}

/* Fenêtre détail */
.apfo-espace .apfo-dialog{border:0;border-radius:18px;padding:0;max-width:400px;width:calc(100% - 32px);background:var(--surface);color:var(--text);box-shadow:0 24px 60px rgba(41,0,125,.25)}
.apfo-espace .apfo-dialog::backdrop{background:rgba(41,0,125,.3)}
.apfo-espace .apfo-dlg-top{padding:18px 20px 16px;color:#1E1530}
.apfo-espace .apfo-dlg-top .apfo-h{font-size:24px;margin-top:8px;color:#1E1530}
.apfo-espace .apfo-tag{display:inline-block;font-size:11px;font-weight:700;border-radius:999px;padding:2px 9px;background:rgba(255,255,255,.6)}
.apfo-espace .apfo-dlg-body{padding:16px 20px 4px;font-size:14px}
.apfo-espace .apfo-dlg-body dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.apfo-espace .apfo-dlg-body dt{color:var(--muted)}
.apfo-espace .apfo-dlg-body dd{margin:0;font-weight:600}
.apfo-espace .apfo-dlg-desc{margin-top:12px!important;padding:10px 12px!important;border-radius:10px;background:var(--we);white-space:pre-line;font-size:13.5px}
.apfo-espace .apfo-dlg-act{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:14px 20px 18px}
.apfo-espace .apfo-dlg-act > div{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.apfo-espace .apfo-dlg-act a,.apfo-espace .apfo-dlg-act button{border-radius:999px;padding:8px 16px;font-weight:700;font-size:13px;text-decoration:none}
.apfo-espace .apfo-dlg-act a{background:var(--ink);color:#fff}
.apfo-espace .apfo-dlg-act button{border:1px solid var(--line);background:transparent}

/* Connexion */
.apfo-espace.apfo-login{display:grid;place-items:center;min-height:60vh}
.apfo-espace .apfo-login-card,.apfo-espace .apfo-narrow{background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:36px;max-width:460px;width:100%;box-shadow:0 20px 50px rgba(41,0,125,.08)}
.apfo-espace .apfo-login-card > .apfo-muted{margin:14px 0 22px}
.apfo-espace .apfo-login-card form p{margin:0 0 14px}
.apfo-espace .apfo-login-card label{display:block;font-weight:700;font-size:13px;color:var(--ink);margin-bottom:6px}
.apfo-espace .apfo-login-card input[type=text],.apfo-espace .apfo-login-card input[type=password]{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:15px;background:var(--bg)}
.apfo-espace .apfo-login-card .login-remember label{display:flex;gap:8px;align-items:center;font-weight:500}
.apfo-espace .apfo-login-card input[type=submit]{width:100%;border:0;background:var(--apfo-accent);color:#fff;border-radius:999px;padding:13px 18px;font-weight:700;font-size:15px;cursor:pointer}
.apfo-espace .apfo-login-card input[type=submit]:hover{background:var(--ink)}
.apfo-espace .apfo-alert{background:var(--alert-soft);color:var(--alert);border-radius:12px;padding:10px 14px;margin-bottom:16px;font-size:14px;font-weight:600}

@media (prefers-reduced-motion:no-preference){
  .apfo-espace .apfo-anim{animation:apfoFade .22s ease-out}
  @keyframes apfoFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
}
@media (max-width:640px){
  .apfo-espace{padding:20px 16px 40px}
  .apfo-espace .apfo-login-card{padding:26px 20px}
}

/* Intégration Divi */
.apfo-espace-page #main-content{background:#F6F4FB}
.apfo-espace-page #main-content .container{padding-top:24px}
.apfo-espace-page #main-content .container:before{display:none}
.apfo-espace-page .entry-title.main_title{display:none}
.apfo-espace-page #left-area{width:100%;padding:0}
.apfo-espace-page #sidebar{display:none}
.apfo-espace-page #main-content .container{width:92%;max-width:1280px}
.apfo-espace .apfo-month,.apfo-espace .apfo-dow{min-width:560px}

/* Émargement */
.apfo-espace .apfo-next-btns{position:absolute;right:18px;top:50%;transform:translateY(-50%);display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.apfo-espace .apfo-next-btns .apfo-btn{position:static;transform:none}
.apfo-espace .apfo-next-in{padding-right:260px}
@media (max-width:640px){.apfo-espace .apfo-next-in{padding-right:22px}.apfo-espace .apfo-next-btns{position:static;transform:none;margin-top:12px;justify-content:flex-start}}
.apfo-espace .apfo-btn-sign{background:var(--apfo-accent)!important;color:#fff!important}
.apfo-espace .apfo-signed-chip{color:#BDF5CF;font-weight:700;font-size:13px}
.apfo-espace .apfo-signbtn{border:0!important;background:var(--apfo-accent)!important;color:#fff!important;border-radius:999px;padding:8px 16px;font-weight:700;font-size:13px}
.apfo-espace .apfo-signbtn:disabled{opacity:.6}
.apfo-espace .apfo-st-signed{color:#1B7F3B}.apfo-espace .apfo-st-open{color:var(--apfo-accent)}.apfo-espace .apfo-st-missed{color:var(--alert)}.apfo-espace .apfo-st-future{color:var(--muted)}
.apfo-espace .apfo-emarg-count{font-size:14px;margin-bottom:8px!important}
.apfo-espace .apfo-emarg-count strong{font-size:22px;color:var(--ink)}
.apfo-espace .apfo-emarg-ul{list-style:none;margin:0;padding:0}
.apfo-espace .apfo-emarg-ul li{margin:0;padding:0;border-top:1px solid var(--line)}
.apfo-espace .apfo-emarg-ul button{width:100%;display:flex;justify-content:space-between;align-items:center;gap:8px;border:0;background:transparent;padding:9px 0;text-align:left;font-size:13.5px;font-weight:600;color:var(--ink)}
.apfo-espace .apfo-emarg-ul small{display:block;font-weight:500;color:var(--muted);font-size:12px}
.apfo-espace .apfo-st{font-style:normal;font-size:11.5px;font-weight:700;border-radius:999px;padding:3px 9px;background:var(--we);white-space:nowrap}
.apfo-espace em.apfo-st-open{background:var(--apfo-accent);color:#fff}
.apfo-espace em.apfo-st-signed{background:#E3F6EA}
.apfo-espace em.apfo-st-missed{background:var(--alert-soft)}
.apfo-espace .apfo-signdlg{max-width:520px}
.apfo-espace .apfo-signdlg .apfo-dlg-body > p{margin:12px 0 8px!important}
.apfo-espace .apfo-otp-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.apfo-espace .apfo-otp-row input{flex:1;min-width:140px;border:1px solid var(--line);border-radius:10px;padding:9px 12px;font-size:16px;letter-spacing:.2em}
.apfo-espace .apfo-ghostbtn{border:1px solid var(--apfo-accent)!important;background:#fff;color:var(--apfo-accent);border-radius:999px;padding:8px 14px;font-weight:700;font-size:13px}
.apfo-espace .apfo-ghostbtn:disabled{opacity:.5}
.apfo-espace .apfo-pad{position:relative;border:2px dashed var(--line);border-radius:14px;background:#fff}
.apfo-espace .apfo-pad canvas{display:block;width:100%;height:190px;touch-action:none;cursor:crosshair}
.apfo-espace .apfo-padclear{position:absolute;top:8px;right:8px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:700}
.apfo-espace .apfo-okmsg{background:#E3F6EA;color:#1B7F3B;border-radius:12px;padding:10px 14px;font-size:14px;font-weight:600;margin-top:10px!important}
.apfo-espace .apfo-signdlg .apfo-alert{margin-top:10px!important}


/* v1.2.1 – émargement sous le calendrier */
.apfo-espace .apfo-emarg-wide{margin-top:24px}
.apfo-espace .apfo-emarg-wide .apfo-emarg-count{margin:6px 0 14px}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px;max-height:none;overflow:visible;padding:0;margin:0}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul,.apfo-espace .apfo-emarg-wide .apfo-emarg-ul li{list-style:none!important}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul li{margin:0!important;padding:0;border:0}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul li::before,.apfo-espace .apfo-emarg-wide .apfo-emarg-ul li::marker{content:none;display:none}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul button{width:100%;height:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px;border-radius:14px;border:1px solid #ECE7F8;background:#fff;text-align:left}
.apfo-espace .apfo-emarg-wide .apfo-emarg-ul button:has(.apfo-st-open){border-color:var(--apfo-accent);box-shadow:0 0 0 3px rgba(113,85,255,.18)}
@media (max-width:640px){.apfo-espace .apfo-emarg-wide .apfo-emarg-ul{grid-template-columns:1fr 1fr}}
