/* =====================================================================
   YES — Portail des boursiers · thème "campus en ligne"
   Couleurs Compassion International (bleu #0054A6), accent or conservé.
   Pour revenir à l'ancien bleu marine : supprimer le bloc :root ci-dessous.
   ===================================================================== */
:root{
  --navy:#0054A6; --navy-hover:#00448A;
  --blue-deep:#0054A6; --blue-deeper:#003A73;
  --blue-royal:#2E8BCB;
  --blue-pale:#E6F0FA; --blue-mist:#F3F8FD;
  --gold:#D4A92A; --gold-deep:#8A6A00;
  --ink:#14202E; --ink-soft:#4F5E6E; --ink-faint:#76869A;
  --line:#D3E0EE; --line-soft:#E5ECF4; --surface:#F3F6FA;
  --radius-s:8px; --radius-m:12px; --radius-l:16px;
}

/* ---------- LOGOS ---------- */
.brand-logo{background:#fff;border-radius:12px;padding:8px 12px;display:flex;justify-content:center;align-items:center;margin-bottom:12px}
.brand-logo img{display:block;max-width:100%;max-height:70px;width:auto;height:auto}
.brand{background:linear-gradient(160deg,var(--navy) 0%,var(--blue-deeper) 100%)}
.brand .brand-title{display:none}                 /* le logo contient déjà le nom */
.login-brand .brand-mark{display:none}
.login-logo-wrap{display:flex;align-items:center;gap:22px}
.login-logo-wrap .yes-logo{height:68px;width:auto;display:block}
.login-logo-wrap .sep{width:1px;height:46px;background:var(--line)}
.login-photo-wrap::after{background:linear-gradient(180deg,rgba(0,58,115,.10) 0%,rgba(0,58,115,.93) 100%)}
.candidature-logo{display:block;height:84px;width:auto;margin:0 0 16px}

/* ---------- BANDEAU D'ACCUEIL ---------- */
#dashboard .topbar{
  position:relative;overflow:hidden;align-items:center;border-radius:var(--radius-l);
  background:linear-gradient(120deg,var(--navy) 0%,#0A64BE 58%,#2E8BCB 140%);
}
#dashboard .topbar::after{
  content:"";position:absolute;right:-70px;top:-90px;width:280px;height:280px;border-radius:50%;
  border:42px solid rgba(255,255,255,.06);pointer-events:none;
}
#dashboard .topbar > div:first-child{position:relative;z-index:1}
.hero-logo{position:relative;z-index:1;flex-shrink:0;background:#fff;border-radius:14px;padding:10px 18px}
.hero-logo img{display:block;height:78px;width:auto}

/* ---------- ICÔNES DE TITRES ---------- */
.topbar > div.with-ico{display:grid;grid-template-columns:auto 1fr;column-gap:14px;align-items:center}
.with-ico > .h1-ico{grid-column:1;grid-row:1 / span 2;align-self:start}
.with-ico > h1{grid-column:2;grid-row:1}
.with-ico > p{grid-column:2;grid-row:2}
.h1-ico{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:12px;background:var(--blue-pale);color:var(--navy)}
.panel h3{display:flex;align-items:center;gap:10px}
.h3-ico{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;height:32px;border-radius:9px;background:var(--blue-pale);color:var(--navy)}

/* ---------- ACCÈS RAPIDE (tuiles à icônes) ---------- */
.qa-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:12px}
.qa-tile{
  display:flex;align-items:center;gap:14px;text-align:left;min-height:74px;padding:14px;
  background:var(--white);border:1px solid var(--line);border-radius:var(--radius-m);
  font:inherit;color:var(--ink);cursor:pointer;transition:border-color .15s ease,transform .15s ease;
}
.qa-tile:hover{border-color:var(--tc);transform:translateY(-2px)}
.qa-ico{flex:0 0 46px;height:46px;border-radius:12px;background:var(--tc);color:#fff;display:flex;align-items:center;justify-content:center}
.qa-label{display:block;font-weight:700;font-size:15px;line-height:1.25;color:var(--navy)}
.qa-desc{display:block;font-size:13.5px;color:var(--ink-soft);margin-top:2px}

/* ---------- STATISTIQUES AVEC ICÔNES ---------- */
.stat-card{display:flex;flex-direction:column;align-items:flex-start}
.stat-card::before{
  content:"";display:block;width:46px;height:46px;border-radius:12px;margin-bottom:14px;
  background-repeat:no-repeat;background-position:center;background-size:24px;background-color:var(--blue-pale);
}
.stat-card:nth-child(1)::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230054A6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h3l2-2h6l2 2h3v13H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E")}
.stat-card:nth-child(2)::before{background-color:#E3F1FA;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F78B8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h6M9 17h6'/%3E%3C/svg%3E")}
.stat-card:nth-child(3)::before{background-color:#FBF1D6;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A6A00' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h11l3 3v13H5z'/%3E%3Cpath d='M9 9h7M9 13h7M9 17h4'/%3E%3C/svg%3E")}
.stat-card:nth-child(4)::before{background-color:#E3F2E9;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316683B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3h6l1 3h3v15H5V6h3z'/%3E%3Cpath d='M9 11l2 2 4-4'/%3E%3C/svg%3E")}

/* ---------- BARRE DU BAS (smartphone) ---------- */
#bottomNav{
  display:none;flex-direction:row;flex:none;gap:0;position:fixed;left:0;right:0;bottom:0;z-index:80;justify-content:space-around;
  background:#fff;border-top:1px solid var(--line);padding:6px 6px calc(6px + var(--safe-b));
  box-shadow:0 -6px 20px rgba(0,58,115,.08);
}
#bottomNav button{
  flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:3px;
  background:none;border:none;padding:4px 2px;min-height:54px;font-size:11.5px;font-weight:600;color:var(--ink-soft);cursor:pointer;
}
#bottomNav .bn-ico{display:flex;align-items:center;justify-content:center;width:52px;height:30px;border-radius:15px;transition:background .15s ease}
#bottomNav button.active{color:var(--navy)}
#bottomNav button.active .bn-ico{background:var(--blue-pale)}

/* ---------- TABLETTE ---------- */
@media (min-width:801px) and (max-width:1100px){
  .app{grid-template-columns:236px 1fr}
  main{padding:32px 28px 64px}
  .brand{padding:18px 16px 16px}
  .profile-card{padding:16px 18px}
  .hero-logo img{height:64px}
}

/* ---------- SMARTPHONE / TABLETTE VERTICALE ---------- */
@media (max-width:800px){
  body.has-bottom-nav #bottomNav{display:flex}
  .brand{background:none}
  body.has-bottom-nav main{padding-bottom:calc(96px + var(--safe-b))}
  input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{font-size:16px !important}
  .brand-logo{margin:0;padding:5px 10px;border-radius:10px}
  .brand-logo img{max-height:38px}
  .hero-logo{order:-1;align-self:flex-start;padding:8px 14px}
  .hero-logo img{height:52px}
  .login-logo-wrap{gap:14px}
  .login-logo-wrap .yes-logo{height:48px}
  .login-logo-wrap .sep{height:32px}
  .h1-ico{width:38px;height:38px}
  .topbar > div.with-ico{column-gap:12px}
  .stat-card::before{width:40px;height:40px;margin-bottom:10px}
}

/* ---------- TABLEAUX → CARTES SUR SMARTPHONE ---------- */
@media (max-width:700px){
  table.stack-table{min-width:0 !important;border:none;background:transparent}
  .admin-table-wrap table.stack-table{min-width:0 !important}
  .admin-table-wrap:has(.stack-table){background:transparent;border:none;overflow:visible}
  table.stack-table thead{display:none}
  table.stack-table,table.stack-table tbody,table.stack-table tr,table.stack-table td{display:block;width:100%}
  table.stack-table tr{
    background:var(--white);border:1px solid var(--line);border-radius:var(--radius-m);
    padding:6px 16px;margin-bottom:12px;
  }
  table.stack-table tbody tr:hover{background:var(--white)}
  table.stack-table td{padding:10px 0 !important;border-bottom:1px solid var(--line-soft) !important;font-size:15px !important}
  table.stack-table tr td:last-child{border-bottom:none !important}
  table.stack-table td::before{
    content:attr(data-label);display:block;font-size:12.5px;font-weight:700;color:var(--ink-soft);margin-bottom:2px;
  }
  table.stack-table td[data-label=""]::before{display:none}
  table.stack-table td select{width:100%}
  div[id^="list-"] table{min-width:0}
}

/* ---------- ACCÈS RAPIDE SUR PETITS ÉCRANS : style "lanceur d'appli" ---------- */
@media (max-width:600px){
  .qa-grid{grid-template-columns:repeat(3,1fr);gap:10px}
  .qa-tile{flex-direction:column;text-align:center;gap:8px;min-height:0;padding:14px 6px 12px}
  .qa-desc{display:none}
  .qa-label{font-size:12.5px}
  .qa-ico{flex-basis:auto;width:46px}
  .candidature-logo{height:64px}
}
@media (max-width:340px){ .qa-grid{grid-template-columns:repeat(2,1fr)} }

/* ---------- CONFORT TACTILE ---------- */
@media (pointer:coarse){
  .nav-item,.more-sheet-item{min-height:46px}
  .btn,.course-toggle{min-height:46px}
  .link-btn,.del{padding:10px 6px}
  .course-tab{padding:14px 4px}
}
@media (prefers-reduced-motion:reduce){
  .qa-tile,#bottomNav .bn-ico{transition:none}
  .qa-tile:hover{transform:none}
}


/* =====================================================================
   v2 — Logo à droite sur chaque rubrique, tablette en 2 colonnes,
   paysage téléphone, finitions
   ===================================================================== */
.topbar > div:first-child{flex:1 1 auto;min-width:0}
.page-logo{
  flex-shrink:0;align-self:center;display:flex;align-items:center;
  padding:6px 14px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-m);
}
.page-logo img{display:block;height:56px;width:auto}
.page-logo.no-logo,.hero-logo.no-logo{display:none}
@media (min-width:801px) and (max-width:1100px){ .page-logo img{height:46px} }
@media (max-width:800px){ .section:not(#dashboard) .page-logo{display:none} }

/* Tablette en paysage / petit ordinateur : tableau de bord sur 2 colonnes */
@media (min-width:801px){ #dashboard.active{grid-template-columns:repeat(2,minmax(0,1fr))} }

/* Téléphone en paysage : barre du bas plus compacte */
@media (max-height:480px) and (orientation:landscape){
  #bottomNav button{min-height:44px;flex-direction:row;justify-content:center;gap:8px}
  #bottomNav .bn-ico{width:34px;height:26px}
  body.has-bottom-nav main{padding-bottom:calc(72px + var(--safe-b))}
}


/* =====================================================================
   v3 — logos plus discrets, YES après Compassion, notifications compactes
   ===================================================================== */
.page-logo{display:none !important}                       /* plus de logo sur chaque rubrique */
.login-logo-wrap .yes-logo{height:50px}
.login-logo-wrap .sep{height:34px}
.hero-logo{padding:6px 12px;border-radius:12px}
.hero-logo img{height:54px}
@media (min-width:801px) and (max-width:1100px){ .hero-logo img{height:46px} }
@media (max-width:800px){ .hero-logo img{height:40px} .login-logo-wrap .yes-logo{height:38px} .login-logo-wrap .sep{height:26px} }

/* Notification « À faire » : pastille d'une ligne, liste repliée */
.task-pill{background:var(--wait-bg);border:1px solid #EBD9A8;border-left:4px solid var(--gold);border-radius:var(--radius-m)}
.task-pill-head{
  display:flex;align-items:center;gap:12px;width:100%;min-height:46px;padding:8px 14px;
  background:none;border:none;font:inherit;font-weight:700;font-size:15px;color:var(--wait);cursor:pointer;text-align:left;
}
.task-pill-ico{position:relative;display:inline-flex;color:var(--wait)}
.task-pill-count{
  position:absolute;top:-7px;right:-9px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;
  background:#B23A3A;color:#fff;font-size:11px;font-weight:700;line-height:17px;text-align:center;
}
.task-pill-txt{flex:1}
.task-pill-chev{display:inline-flex;transition:transform .15s ease}
.task-pill.open .task-pill-chev{transform:rotate(180deg)}
.task-pill-list{padding:0 14px 10px 14px}
.task-pill-list li{font-size:14.5px;padding:10px 0;border-bottom:1px solid #EBD9A8}
.task-pill-list li:last-child{border-bottom:none}
@media (prefers-reduced-motion:reduce){ .task-pill-chev{transition:none} }

/* v4 — le logo YES n'apparaît qu'une fois par écran (connexion ou menu latéral) */
.hero-logo,.candidature-logo{display:none !important}


/* =====================================================================
   v5 — « Mon parcours » : progression + prochaine étape
   ===================================================================== */
.journey{
  display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:20px 36px;align-items:center;
  background:var(--white);border:1px solid var(--line);border-radius:var(--radius-l);padding:22px 28px;
}
.jr-ring{display:flex;align-items:center;gap:16px}
.jr-ringbox{position:relative;flex:0 0 84px;width:84px;height:84px}
.jr-ringbox svg{display:block;width:100%;height:100%;transform:rotate(-90deg)}
.jr-track{stroke:var(--blue-pale)}
.jr-bar{transition:stroke-dashoffset .7s ease}
.jr-pct{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-family:var(--font-serif);font-size:21px;font-weight:600;color:var(--navy)}
.jr-label{font-weight:700;font-size:16px;color:var(--navy);line-height:1.25}
.jr-sub{font-size:14px;color:var(--ink-soft);margin-top:2px}
.jr-next{
  display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;
  background:var(--blue-mist);border-left:4px solid var(--gold);border-radius:var(--radius-m);padding:16px 20px;
}
.jr-next-k{font-size:13.5px;font-weight:700;color:var(--gold-deep)}
.jr-next-t{font-family:var(--font-serif);font-size:19px;font-weight:600;color:var(--navy);line-height:1.3;margin-top:2px}
@media (max-width:1100px){ .journey{grid-template-columns:auto 1fr} .jr-next{grid-column:1 / -1} }
@media (max-width:600px){
  .journey{grid-template-columns:1fr 1fr;gap:16px;padding:18px 16px}
  .jr-ring{flex-direction:column;align-items:flex-start;gap:8px}
  .jr-ringbox{flex-basis:72px;width:72px;height:72px}
  .jr-pct{font-size:18px}
  .jr-next{flex-direction:column;align-items:stretch;padding:14px 16px}
}
@media (prefers-reduced-motion:reduce){ .jr-bar{transition:none} }


/* =====================================================================
   v6 — menu regroupé, page Cours avec résumé et états visuels
   ===================================================================== */
.nav-group{padding:16px 14px 6px;font-size:13px;font-weight:700;color:var(--ink-faint);line-height:1.2}
.nav-group:first-child{padding-top:4px}

.course-summary{
  display:flex;flex-direction:column;gap:10px;margin-bottom:18px;padding:18px 22px;
  background:var(--white);border:1px solid var(--line);border-radius:var(--radius-m);
}
.course-summary[hidden]{display:none}
.cs-text{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.cs-text strong{font-family:var(--font-serif);font-size:19px;font-weight:600;color:var(--navy)}
.cs-text span{font-size:14.5px;color:var(--ink-soft)}
.course-summary .progress{margin-top:0;height:8px}

.course-item.is-done{box-shadow:inset 4px 0 0 var(--ok)}
.course-item.is-wip{box-shadow:inset 4px 0 0 var(--gold)}
.course-item.is-done:not([style])::before{content:"\2713";color:var(--ok)}
.course-item.is-wip:not([style])::before{color:var(--gold-deep)}

.course-item .badge{white-space:nowrap}
@media (max-width:800px){ .course-item:not([style])::before{font-size:22px} }


/* =====================================================================
   v7 — photo du boursier (bandeau d'accueil + pastille du menu)
   ===================================================================== */
.hero-photo{
  position:relative;z-index:1;flex:0 0 auto;width:88px;height:88px;padding:0;border-radius:50%;
  border:3px solid var(--gold);background:rgba(255,255,255,.14) center/cover no-repeat;
  color:#fff;font-family:var(--font-serif);font-size:30px;font-weight:600;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.hero-photo[hidden]{display:none}
.hero-photo.has-photo{color:transparent;font-size:0}
.hero-photo:focus-visible{outline:3px solid #fff;outline-offset:3px}
.avatar.has-photo{background-size:cover;background-position:center;background-repeat:no-repeat;color:transparent;font-size:0}
@media (max-width:800px){ .hero-photo{align-self:flex-start;width:68px;height:68px;font-size:24px} }

#dashboard .topbar{justify-content:flex-start;gap:22px}
#dashboard .topbar > div:not(.hero-photo){flex:1 1 auto;min-width:0}

/* v8 — téléphone : photo à gauche, texte à droite (même disposition que sur ordinateur) */
@media (max-width:800px){
  #dashboard .topbar{flex-direction:row;align-items:center;gap:14px;padding:22px 18px}
  #dashboard .topbar .hero-photo{align-self:center;width:64px;height:64px;font-size:22px;border-width:2px}
  #dashboard .topbar h1{font-size:25px;line-height:1.15}
  #dashboard .topbar p{font-size:15px;margin-top:4px}
}

/* v8b — empêche un élément trop large d'élargir tout le tableau de bord sur petit écran */
@media (max-width:1100px){ #dashboard.active{grid-template-columns:minmax(0,1fr)} }
#dashboard > *{min-width:0}
@media (max-width:600px){
  .journey{align-items:start}
  .jr-label{font-size:15px}
  .jr-next{align-self:stretch}
}


/* =====================================================================
   v9 — photos de cohorte dans le bandeau (transition « morph » : la forme
   se déforme en continu, les photos se fondent avec flou + zoom)
   ===================================================================== */
.hero-cohort{position:relative;z-index:1;flex:0 0 auto;width:270px;height:134px;align-self:center}
.hc-frame{
  position:absolute;inset:0;overflow:hidden;background:var(--navy);
  border:3px solid var(--gold);box-shadow:0 10px 26px rgba(10,0,40,.35);
  border-radius:58% 42% 52% 48% / 52% 58% 42% 48%;
  animation:hcMorph 10s ease-in-out infinite alternate;
}
@keyframes hcMorph{
  0%  {border-radius:58% 42% 52% 48% / 52% 58% 42% 48%}
  50% {border-radius:42% 58% 38% 62% / 60% 40% 60% 40%}
  100%{border-radius:54% 46% 62% 38% / 44% 56% 44% 56%}
}
.hc-slide{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 30%;
  opacity:0;transform:scale(1.14);filter:blur(7px);
  transition:opacity 1.5s ease,transform 7s ease-out,filter 1.5s ease;
}
.hc-slide.is-on{opacity:1;transform:scale(1);filter:blur(0)}
@media (min-width:801px) and (max-width:1100px){ .hero-cohort{width:200px;height:112px} }
@media (max-width:800px){
  #dashboard .topbar{flex-wrap:wrap}
  .hero-cohort{flex:1 1 100%;width:100%;height:120px;order:3}
}
@media (prefers-reduced-motion:reduce){
  .hc-frame{animation:none}
  .hc-slide{transition:none;filter:none;transform:none}
}
@media (max-width:800px){
  #dashboard .topbar > div:not(.hero-photo):not(.hero-cohort){flex:1 1 0;min-width:0}
}


/* v10 — téléphone : la photo de cohorte remplit tout le rectangle (plus d'ovale) */
@media (max-width:800px){
  .hero-cohort{flex:1 1 100%;width:100%;height:auto;aspect-ratio:3/2;max-height:260px;order:3}
  .hc-frame{
    border-radius:var(--radius-m);animation:none;border-width:2px;
    box-shadow:0 6px 18px rgba(0,30,70,.28);
  }
  .hc-slide{object-position:center 35%}
}

/* v11 — ordinateur aussi : rectangle à coins arrondis, plus d'ovale */
.hc-frame{
  border-radius:var(--radius-m);animation:none;border-width:2px;
  box-shadow:0 6px 18px rgba(0,30,70,.28);
}
@media (min-width:801px){
  .hero-cohort{width:300px;height:170px}
}
@media (min-width:801px) and (max-width:1100px){
  .hero-cohort{width:220px;height:130px}
}
