/* ITSMS Academy — même identité visuelle que itsms.eu (polices auto-hébergées, aucune requête tierce) */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/inter-var.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono Variable'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fonts/jetbrains-mono-var.woff2') format('woff2'); }

:root {
  --primary: #004357; --primary-700: #00303f; --primary-900: #001c25;
  --secondary: #3f7080; --accent: #e74c3c; --accent-700: #c0392b;
  --accent-grad: linear-gradient(135deg, #e74c3c, #ff6b5b);
  --sky: #4a90b8; --sky-light: #87ceeb; --primary-mid: #2c5f7c;
  --tint: #e7f4f9; --bg: #ffffff; --surface: #f6f9fa; --fg: #0f1a1f; --muted: #55666e; --border: #dbe4e8;
  --ok: #157347; --warn: #8a5a00;
  --radius: 14px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 28, 37, .06), 0 8px 24px rgba(0, 28, 37, .06);
  --shadow-lg: 0 2px 4px rgba(0, 28, 37, .08), 0 18px 48px rgba(0, 28, 37, .14);
  --font: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
  --container: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--fg); background: var(--bg); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--accent-700); }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; color: var(--primary-900); }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--primary-900); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* En-tête / pied — réutilisés du site principal */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary-900); font-weight: 800; font-size: 1.2rem; }
.logo__img { display: block; height: 44px; width: auto; }
.logo small { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .1em; color: var(--secondary); text-transform: uppercase; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 9px 14px; border-radius: 999px; color: var(--fg); text-decoration: none; font-weight: 500; font-size: .94rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--tint); color: var(--primary); }
.nav .btn { margin-left: 6px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; }
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; inset: 68px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 20px 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 13px 12px; }
}
.site-footer { background: var(--primary); color: #a9c2cb; padding: 44px 0 22px; font-size: .92rem; margin-top: 64px; }
.site-footer a { color: #a9c2cb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.footer-row .logo__img { height: 34px; filter: brightness(0) invert(1); opacity: .9; }

/* Structure */
.section { padding: clamp(36px, 5vw, 64px) 0; }
.hero-academy { background: linear-gradient(135deg, #1f4a63 0%, var(--primary-mid) 55%, var(--sky) 100%); color: #fff; }
.hero-academy .container { padding-block: clamp(40px, 6vw, 76px); }
.hero-academy h1 { color: #fff; max-width: 22ch; }
.hero-academy p.lead { color: #eaf5fb; font-size: 1.1rem; max-width: 60ch; }
.eyebrow { font-family: var(--mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: #cfe6f0; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--accent); display: inline-block; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .15s, color .15s, border-color .15s; font-family: inherit; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(231, 76, 60, .28); }
.btn--dark { background: var(--primary); color: #fff; }
.btn--dark:hover { background: var(--primary-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--primary); }
.btn--light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.btn--light:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Filtres catalogue (façon cyberacademy.net) */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
@media (max-width: 860px) { .catalog-layout { grid-template-columns: 1fr; } }
.filters-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: sticky; top: 88px; }
.filters-panel h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.filter-group { margin-bottom: 22px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.filter-list a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: .93rem; }
.filter-list a:hover { background: #fff; }
.filter-list a[aria-current="true"] { background: var(--primary); color: #fff; font-weight: 600; }
.filter-list a span.n { color: var(--muted); font-size: .82rem; }
.filter-list a[aria-current="true"] span.n { color: #cfe6f0; }
.search-box { display: flex; gap: 8px; margin-bottom: 22px; }
.search-box input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; }
.search-box .btn { flex: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip-remove { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--tint); color: var(--primary); font-size: .85rem; text-decoration: none; font-weight: 600; }

/* Cartes formation */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s, border-color .2s; }
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #c5d3d9; color: inherit; }
.course-card__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.course-card h3 { margin-bottom: 8px; }
.course-card p { color: var(--muted); font-size: .93rem; margin-bottom: 0; flex: 1; }
.course-card__meta { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--muted); }
.course-card__price { font-weight: 700; color: var(--primary-900); }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge--free { background: #dff3e8; color: var(--ok); }
.badge--paid { background: #fff2d6; color: var(--warn); }
.badge--format { background: var(--tint); color: var(--primary); }
.badge--soon { background: #ffe8cf; color: #8a4b00; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }

/* Fiche formation */
.course-hero { display: grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .course-hero { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow); }
.crumbs { font-size: .85rem; margin-bottom: 18px; color: var(--muted); }
.crumbs a { color: var(--secondary); }
.crumbs span { margin: 0 6px; opacity: .6; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; }
.prose p { color: #33444c; }
.checklist { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.checklist li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23004357' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.format-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.format-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.format-list b { display: block; font-size: .95rem; }
.format-list span { color: var(--muted); font-size: .85rem; }
.price-tag { font-weight: 700; color: var(--primary-900); white-space: nowrap; }

/* Formulaires (comptes) */
.auth-shell { min-height: 100dvh; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-mid), var(--sky)); padding: 32px 16px; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: clamp(28px, 4vw, 40px); }
.auth-card .logo { justify-content: center; margin-bottom: 22px; display: flex; }
.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--primary-900); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; font: inherit; color: var(--fg); background: #fff; border: 1.5px solid #c5d3d9; border-radius: 10px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 67, 87, .14); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--primary); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-links { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.small { font-size: .88rem; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.05rem; }
.account-panel { max-width: 520px; }
.account-panel + .account-panel { margin-top: 20px; }
.qr-box { display: flex; justify-content: center; margin: 1rem 0; }
.qr { width: 200px; height: 200px; }
.qr svg { width: 100%; height: 100%; }
.secret { display: inline-block; letter-spacing: .08em; font-size: 1rem; margin-top: .3rem; user-select: all; font-family: var(--mono, monospace); }
.codes { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0; margin: 1rem 0; }
.codes code { display: block; text-align: center; padding: .5rem; font-size: 1.05rem; background: var(--surface); border-radius: 8px; }
.flash { padding: 12px 14px; border-radius: 10px; font-weight: 500; font-size: .92rem; margin-bottom: 16px; }
.flash-success { background: #dff3e8; color: #0d4a2b; }
.flash-error { background: #fde4e7; color: #7a0c1a; }
.flash-info, .flash-warning { background: #fff2d6; color: #6b4e00; }

/* Espace connecté (app) */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
@media (max-width: 860px) { .app-shell { grid-template-columns: 1fr; } }
.app-sidebar { background: #fff; color: var(--fg); padding: 22px 16px; border-right: 1px solid var(--border); }
.app-sidebar .logo { color: var(--primary-900); margin-bottom: 22px; padding-left: 6px; }
.app-sidebar__logout { margin-top: 24px; }
.app-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.app-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .94rem; font-weight: 600; }
.app-nav a svg { width: 19px; height: 19px; flex: none; opacity: .8; }
.app-nav a:hover { background: var(--surface); color: var(--primary-900); }
.app-nav a[aria-current="page"] { background: var(--tint); color: var(--primary); }
.app-nav a[aria-current="page"] svg { opacity: 1; }
.app-main { padding: clamp(20px, 4vw, 40px); background: var(--surface); }
.app-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.app-topbar h1 { margin: 0; }

/* Bannière d'accueil (façon PeopleCert / cyberacademy) */
.app-hero { background: linear-gradient(135deg, #1f4a63 0%, var(--primary-mid) 55%, var(--sky) 100%); color: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 36px); margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.app-hero h1 { color: #fff; margin-bottom: 6px; }
.app-hero p { color: #dcecf3; margin: 0; }
.app-hero__stats { display: flex; gap: 28px; flex-wrap: wrap; }
.app-hero__stat b { display: block; font-size: 1.8rem; line-height: 1; }
.app-hero__stat span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #b9d8e3; }

.section-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 36px; }
.section-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: inherit; position: relative; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.section-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c5d3d9; color: inherit; }
.section-tile__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--primary)) 14%, #fff); color: var(--accent, var(--primary)); }
.section-tile__icon svg { width: 22px; height: 22px; }
.section-tile b { display: block; font-size: 1.02rem; color: var(--primary-900); }
.section-tile span { color: var(--muted); font-size: .85rem; }
.section-tile[data-soon="true"] { opacity: .68; cursor: default; }
.section-tile[data-soon="true"]:hover { box-shadow: none; transform: none; border-color: var(--border); }
.section-tile .soon-tag { position: absolute; top: 16px; right: 16px; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface); padding: 2px 8px; border-radius: 999px; }
/* Couleurs d'accent par rubrique (façon PeopleCert) — via attribut de données : le CSP du site interdit le style inline */
.section-tile[data-key="exam-prep"] { --accent: #2c5f7c; }
.section-tile[data-key="courses"] { --accent: #e74c3c; }
.section-tile[data-key="books"] { --accent: #b8863b; }
.section-tile[data-key="tools"] { --accent: #3f7080; }
.section-tile[data-key="articles"] { --accent: #4a90b8; }
.section-tile[data-key="webinars"] { --accent: #7a5c8e; }

.my-course { display: flex; gap: 20px; align-items: center; padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; text-decoration: none; color: inherit; border-left: 5px solid var(--accent, var(--primary)); transition: box-shadow .2s, transform .2s; }
.my-course:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.my-course__ring { flex: none; position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.my-course__ring svg circle { transition: stroke-dashoffset .4s ease; }
.my-course__ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--primary-900); }
.my-course__info { flex: 1; min-width: 0; }
.my-course__info h3 { margin-bottom: 4px; }
.my-course__info .cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent, var(--secondary)); font-weight: 700; margin-bottom: 4px; display: block; }
.progress-label { font-size: .82rem; color: var(--muted); margin-top: 2px; }
/* Couleurs d'accent par catégorie de formation — via attribut de données (voir remarque CSP ci-dessus) */
.my-course[data-category="risk-management"] { --accent: #2c5f7c; }
.my-course[data-category="itsm"] { --accent: #e74c3c; }
.my-course[data-category="cybersecurity"] { --accent: #7a5c8e; }
.my-course[data-category="governance"] { --accent: #3f7080; }
.my-course[data-category="other"] { --accent: #b8863b; }

.lesson-complete { margin-top: 24px; }

/* Lecteur de formation */
.player-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .player-layout { grid-template-columns: 1fr; } }
.lesson-nav { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; position: sticky; top: 20px; }
.lesson-module { margin-bottom: 6px; }
.lesson-module__title { padding: 10px 12px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lesson-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--fg); font-size: .92rem; }
.lesson-item:hover { background: var(--surface); color: var(--fg); }
.lesson-item[aria-current="true"] { background: var(--tint); color: var(--primary); font-weight: 600; }
.lesson-item__dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: grid; place-items: center; }
.lesson-item[data-done="true"] .lesson-item__dot { background: var(--ok); border-color: var(--ok); }
.lesson-item[data-done="true"] .lesson-item__dot::after { content: '✓'; color: #fff; font-size: .65rem; }
.lesson-body { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); }

.err-page { padding: 10vh 0; text-align: center; }
.err-page h1 { font-size: clamp(3rem, 10vw, 6rem); color: var(--accent); margin-bottom: 8px; }
