@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --canvas: #faf8fa;
  --surface: #fff;
  --ink: #261b24;
  --muted: #655963;
  --line: #eadfe6;
  --wine: #82354f;
  --wine-dark: #5f2339;
  --rose: #f8eaf0;
  --urgent: #a22943;
  --urgent-bg: #fff0f0;
  --sidebar: 228px;
  --radius: 16px;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #9364b7; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
[data-icon] { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; }
.skip-link { position: fixed; z-index: 10; top: 10px; left: 10px; transform: translateY(-150%); padding: 12px; background: white; }
.skip-link:focus { transform: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; width: var(--sidebar); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 27px 17px 20px; }
.brand, .mobile-brand { display: flex; align-items: center; gap: 12px; }
.brand { padding: 0 9px; margin-bottom: 50px; }
.brand strong, .mobile-brand strong { display: block; font-size: 1.23rem; font-weight: 800; letter-spacing: -.055em; }
.brand small, .edition small { display: block; color: var(--muted); font-size: .76rem; margin-top: 3px; }
.brand-icon { width: 42px; height: 42px; border-radius: 13px; color: white; background: var(--wine); }
.brand-icon svg { width: 23px; height: 23px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .sidebar-bottom > a { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 46px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.sidebar a:hover, .sidebar a[aria-current] { background: var(--rose); color: var(--wine-dark); }
.sidebar .brand:hover { background: transparent; }
.sidebar-bottom { margin-top: auto; }
#favorite-count:not(:empty) { margin-left: auto; border-radius: 20px; padding: 2px 7px; background: var(--rose); color: var(--wine); font-size: .75rem; }
.edition { display: flex; align-items: center; gap: 10px; padding: 16px 10px 2px; margin-top: 14px; border-top: 1px solid var(--line); font-size: .83rem; }
.edition > span { color: var(--wine); }
.workspace { margin-left: var(--sidebar); }
.topbar { border-bottom: 1px solid var(--line); background: #ffffffef; }
.header-inner, main, .footer { max-width: 1240px; margin-inline: auto; padding-inline: 36px; }
.header-inner { height: 73px; display: flex; align-items: center; gap: 18px; justify-content: space-between; }
.mobile-brand { display: none; }
#search-form { display: flex; align-items: center; width: min(100%, 448px); height: 43px; padding: 0 12px; gap: 10px; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
#search-form:focus-within { border-color: var(--wine); box-shadow: 0 0 0 2px #82354f25; }
#search { width: 100%; min-width: 0; outline: none; border: 0; background: transparent; color: var(--ink); font-size: .9rem; }
#search::placeholder { color: var(--muted); }
kbd { border: 1px solid #e4d9e1; background: white; border-radius: 5px; min-width: 22px; padding: 1px 5px; text-align: center; font-size: .83rem; }
.top-action { display: inline-flex; align-items: center; gap: 8px; background: var(--urgent-bg); color: var(--urgent); font-weight: 800; font-size: .88rem; padding: 10px 13px; border-radius: 9px; }
.top-action:hover { background: #f9dce2; }
main { padding-block: 32px 46px; min-height: calc(100vh - 142px); }
main:focus { outline: none; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 280px; border-radius: 20px; background: #48162c url('./erythrocytes.webp') center 52% / cover no-repeat; color: white; display: grid; align-items: center; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #361222 3%, #401628 37%, #40162866 68%, transparent 100%); }
.hero-content { max-width: 650px; padding: 34px 40px; }
.hero h1 { font: 400 clamp(3.2rem, 6vw, 5.3rem)/.98 "Instrument Serif", Georgia, serif; letter-spacing: -.035em; }
.hero p { color: #f3e2e9; margin-top: 13px; font-size: 1rem; line-height: 1.65; max-width: 350px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 9px; padding: 10px 15px; font-size: .9rem; font-weight: 800; border: 1px solid transparent; }
.primary { background: #fff3f7; color: var(--wine-dark); margin-top: 21px; }
.primary:hover { background: #f8d9e5; }
.secondary { background: white; color: var(--wine); border-color: var(--line); }
.secondary:hover { background: var(--rose); }
.home-section { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-head h2 { font-size: 1.31rem; font-weight: 800; letter-spacing: -.035em; }
.section-title [data-icon] { color: var(--urgent); background: var(--urgent-bg); width: 34px; height: 34px; border-radius: 9px; }
.section-link { color: var(--wine); font-size: .88rem; font-weight: 800; }
.section-link:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.urgent-grid, .category-grid { display: grid; gap: 13px; }
.urgent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.urgent-card, .category-card, .sheet { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.urgent-card, .category-card { display: block; padding: 15px 16px; transition: border-color .16s, background .16s; }
.urgent-card { border-color: #efd9df; }
.urgent-card:hover { border-color: #ba647b; background: #fff9fa; }
.urgent-card .urgency { padding: 0; background: none; }
.urgent-card h3, .category-card h3 { font-size: 1rem; line-height: 1.35; font-weight: 800; letter-spacing: -.017em; margin-top: 9px; }
.urgent-card p, .category-card p { color: var(--muted); font-size: .875rem; margin-top: 5px; line-height: 1.45; }
.category-card:hover, .sheet:hover { border-color: #c89fb2; }
.topic-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--topic-bg, var(--rose)); color: var(--topic-fg, var(--wine)); }
.topic-hemato { --topic-bg: #f8e8ed; --topic-fg: #913b57; }
.topic-transfusion { --topic-bg: #eee8f7; --topic-fg: #70509b; }
.topic-hemostase { --topic-bg: #e4f3ed; --topic-fg: #2d6c57; }
.topic-complications { --topic-bg: #fbeedc; --topic-fg: #895820; }
.page-head { margin: 0 0 23px; }
.page-head h1 { font: 400 clamp(2.8rem, 5vw, 4rem)/1.05 "Instrument Serif", Georgia, serif; letter-spacing: -.035em; }
.page-head p { color: var(--muted); line-height: 1.6; margin-top: 9px; max-width: 66ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filter { background: white; border: 1px solid var(--line); padding: 8px 13px; border-radius: 100px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.filter:hover, .filter[aria-current] { background: var(--rose); border-color: #e8cbd8; color: var(--wine-dark); }
.sheet-list { display: grid; gap: 9px; }
.sheet { display: flex; align-items: center; gap: 12px; padding-right: 12px; }
.sheet-link { display: flex; flex: 1; min-width: 0; align-items: center; gap: 13px; padding: 12px 0 12px 14px; }
.sheet-copy { flex: 1; min-width: 0; }
.sheet h3 { font-size: .98rem; letter-spacing: -.015em; }
.sheet p { font-size: .875rem; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.urgency { display: inline-flex; gap: 5px; align-items: center; background: var(--urgent-bg); color: var(--urgent); border-radius: 7px; font-size: .75rem; padding: 4px 7px; font-weight: 800; }
.urgency svg { width: 14px; height: 14px; }
.bookmark { width: 40px; height: 40px; display: inline-grid; place-items: center; background: transparent; border: 0; border-radius: 9px; color: var(--muted); flex: none; }
.bookmark:hover, .bookmark[aria-pressed="true"] { color: var(--wine); background: var(--rose); }
.bookmark[aria-pressed="true"] svg { fill: #cb839f; }
.result-count { color: var(--muted); margin-bottom: 12px; font-size: .875rem; }
.back { display: inline-flex; margin-bottom: 20px; }
.detail-top { display: flex; align-items: start; gap: 14px; justify-content: space-between; }
.detail .page-head h1 { margin-top: 9px; }
.detail .category-label { font-size: .875rem; font-weight: 800; color: var(--wine); margin-right: 9px; }
.detail { max-width: 850px; margin-inline: auto; }
.detail .bookmark { background: white; border: 1px solid var(--line); }
.detail .bookmark[aria-pressed="true"] { background: var(--rose); }
.disclosure { padding: 13px 15px; background: #f5eef7; color: #594264; border-radius: 11px; font-size: .875rem; line-height: 1.55; margin-bottom: 17px; }
.detail-section { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px; scroll-margin-top: 16px; }
.detail-section h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 9px; }
.detail-section h2 svg { color: var(--wine); }
.detail-section ul, .detail-section ol { padding-left: 21px; margin: 12px 0 0; line-height: 1.65; }
.detail-section li + li { margin-top: 5px; }
.detail-section p { line-height: 1.65; margin-top: 9px; }
.detail-section.alert { background: #fff5f5; border-color: #f0dbdf; }
.detail-section a { color: var(--wine); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.empty { text-align: center; padding: 34px 18px; border: 1px dashed #d9c6d2; border-radius: var(--radius); }
.empty > span { margin-bottom: 12px; }
.empty p { color: var(--muted); margin: 7px 0 15px; }
.footer { border-top: 1px solid var(--line); padding-block: 17px; display: flex; justify-content: space-between; gap: 10px; font-size: .81rem; color: var(--muted); }
.footer a { color: var(--wine); }
@media (min-width: 1600px) { :root { --sidebar: 245px; } }
@media (max-width: 1050px) {
  :root { --sidebar: 197px; }
  .header-inner, main, .footer { padding-inline: 24px; }
  .hero-content { padding-inline: 29px; }
}
@media (max-width: 800px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .urgent-grid { gap: 9px; }
  .urgent-card { padding: 12px; }
}
@media (max-width: 680px) {
  .workspace { margin: 0; }
  .sidebar { inset: auto 0 0; width: auto; padding: 5px 7px calc(5px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }
  .sidebar .brand, .sidebar-bottom, #favorite-count { display: none; }
  .sidebar nav { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .sidebar nav a { flex-direction: column; gap: 4px; justify-content: center; text-align: center; padding: 5px 2px; font-size: .75rem; white-space: nowrap; }
  .header-inner { padding-block: 13px; height: auto; flex-wrap: wrap; gap: 11px; }
  .header-inner, main, .footer { padding-inline: 16px; }
  .mobile-brand { display: flex; gap: 9px; }
  .mobile-brand .brand-icon { width: 34px; height: 34px; border-radius: 9px; }
  .mobile-brand .brand-icon svg { width: 19px; height: 19px; }
  #search-form { order: 3; width: 100%; }
  #search { font-size: 1rem; }
  kbd { display: none; }
  main { padding-block: 17px 29px; min-height: calc(100vh - 235px); }
  .hero { min-height: 235px; border-radius: 15px; background-position: 62% center; }
  .hero::before { background: linear-gradient(90deg, #35111f 3%, #3f1225e6 41%, #3f12254d 100%); }
  .hero-content { padding: 25px 21px; }
  .hero h1 { font-size: clamp(3rem, 11vw, 3.6rem); }
  .hero p { max-width: 260px; }
  .home-section { margin-top: 26px; }
  .urgent-grid { grid-template-columns: 1fr; }
  .urgent-card h3 { margin-top: 5px; }
  .sheet-link { gap: 9px; padding-left: 9px; flex-wrap: wrap; }
  .sheet-copy { flex-basis: calc(100% - 50px); }
  .sheet-link > .urgency { margin-left: 47px; }
  .sheet { padding-right: 5px; gap: 3px; }
  .footer { flex-wrap: wrap; margin-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .detail-section { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--wine);
  border-radius: 9px;
  padding: 10px 15px;
  background: var(--wine);
  color: white;
  font-size: .9rem;
  font-weight: 800;
}
.solid:hover { background: var(--wine-dark); }
button:disabled { opacity: .55; cursor: wait; }
.portal-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.portal-head > a { flex-shrink: 0; margin-top: 6px; }
.portal-column { max-width: 850px; margin-inline: auto; }
.material-head { margin-top: 17px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; }
.material-label, .reply-count { color: var(--wine); font-size: .82rem; font-weight: 800; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.correction { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 15px; }
.correction summary { cursor: pointer; color: var(--wine-dark); font-weight: 800; }
.portal-form, .member-row { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.portal-form { display: grid; gap: 15px; }
.field { display: grid; gap: 6px; font-weight: 800; font-size: .9rem; min-width: 0; }
.field input, .field select, .field textarea {
  width: 100%;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  font-size: 1rem;
  font-weight: 500;
}
.field select {
  appearance: none;
  padding-right: 30px;
}
.field:has(select) { position: relative; }
.field:has(select)::after {
  content: "";
  position: absolute;
  bottom: 16px;
  right: 15px;
  width: 7px;
  height: 7px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.field textarea { resize: vertical; min-height: 70px; }
.field small, .field-help { color: var(--muted); font-weight: 600; font-size: .84rem; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.check input { accent-color: var(--wine); width: 18px; height: 18px; }
.form-actions, .shortcut-list, .pagination { display: flex; flex-wrap: wrap; gap: 8px; }
.form-feedback, .form-error { color: #95233c; font-size: .9rem; }
.form-feedback:empty { display: none; }
.form-error { background: var(--urgent-bg); padding: 12px 14px; border-radius: 10px; margin-block: 10px; }
.loading { padding: 18px 0; color: var(--muted); }
.pagination { margin-top: 14px; }
.space-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.space-grid .secondary, .shortcut-list { margin-top: 12px; }
.forum-row, .member-row { display: flex; gap: 12px; align-items: center; }
.forum-row { border: 1px solid var(--line); background: white; border-radius: var(--radius); padding: 14px; }
.forum-row:hover { border-color: #c89fb2; }
.forum-row h3, .member-row h3 { font-size: 1rem; overflow-wrap: anywhere; }
.reply-count { margin-left: auto; white-space: nowrap; }
.post-meta { color: var(--muted); font-size: .84rem; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.thread-title { font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.member-row { justify-content: space-between; margin-bottom: 8px; }
.member-row .portal-form { border: 0; padding: 0; }
.access-decline { color: var(--urgent); }
.toast {
  position: fixed;
  right: 16px;
  top: 78px;
  z-index: 6;
  max-width: min(340px, calc(100vw - 32px));
  color: white;
  background: var(--wine-dark);
  padding: 12px 17px;
  border-radius: 10px;
  box-shadow: 0 5px 20px #36122226;
}
body:not([data-screen="member"]) .sidebar, body:not([data-screen="member"]) .topbar,
body:not([data-screen="member"]) .footer { display: none; }
body:not([data-screen="member"]) .workspace { margin-left: 0; }
body[data-screen="gate"] main { display: grid; place-items: center; min-height: 100vh; }
.access-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(950px, 100%);
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 80px #47152810;
}
.access-visual {
  color: white;
  background: linear-gradient(90deg, #35111f, #47152866),
    #48162c url('./erythrocytes.webp') 65% center / cover no-repeat;
  min-height: 450px;
  display: grid;
  align-items: center;
  padding: 38px;
}
.access-visual .brand-icon { background: #a45674; }
.access-visual h1 { font: 400 clamp(3.8rem, 7vw, 5.4rem)/1 "Instrument Serif", Georgia, serif; margin: 13px 0; letter-spacing: -.035em; }
.access-visual p { max-width: 28ch; line-height: 1.6; color: #fae4ee; }
.access-card { align-self: center; padding: 35px; }
.access-card h2 { font-size: 1.6rem; letter-spacing: -.04em; }
.access-card > p { color: var(--muted); line-height: 1.55; margin: 10px 0 19px; }
.access-card .access-meta { font-size: .85rem; margin: 14px 0 0; }
.access-card .portal-form { border: 0; padding: 0; }
.access-card .text-link { display: block; margin-top: 17px; color: var(--wine); text-decoration: underline; font-size: .9rem; font-weight: 750; }
@media (max-width: 800px) {
  .portal-head { flex-wrap: wrap; gap: 0 12px; margin-bottom: 17px; }
  .portal-head .page-head { margin-bottom: 8px; }
  .item-actions { flex-direction: column; align-items: end; }
  .item-actions .secondary { padding: 8px; }
  .item-actions .secondary svg { display: none; }
}
@media (max-width: 680px) {
  .sidebar nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sidebar nav a[data-nav="urgences"], .sidebar nav a[data-nav="cours"] { display: none; }
  .sidebar nav a { white-space: normal; line-height: 1.1; }
  .space-grid { grid-template-columns: 1fr; gap: 0; }
  .access-layout { grid-template-columns: 1fr; border-radius: 16px; }
  .access-visual { min-height: 210px; padding: 24px; }
  .access-card { padding: 24px; }
  .member-row { flex-wrap: wrap; }
  .toast { top: auto; bottom: 65px; }
}
.logout-form { background: transparent; border: 0; padding: 0; }
.access-card .logout-form { margin-top: 10px; }
.access-card .legacy-link { color: var(--muted); font-size: .82rem; }

.clinical-steps h3 {
  margin-top: 16px;
  color: var(--wine-dark);
  font-size: .98rem;
}
.clinical-steps h3 + ol,
.clinical-steps h3 + ul { margin-top: 7px; }
.clinical-steps + .clinical-steps {
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.lesson-body h3 {
  color: var(--wine-dark);
  font-size: 1.02rem;
  margin-top: 20px;
}
.lesson-body p { max-width: 74ch; }
.teacher-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 7px;
  padding: 2px 7px;
  color: #5e2c76;
  background: #f0e6f7;
  border-radius: 6px;
  font-weight: 800;
  font-size: .78rem;
  white-space: nowrap;
}
.teacher-badge svg { width: 13px; height: 13px; }
.member-row .portal-form { min-width: min(100%, 260px); }
.sidebar { overflow-y: auto; }
.topic-myeloide { --topic-bg: #f8e8ed; --topic-fg: #913b57; }
.topic-lymphoide { --topic-bg: #eee8f7; --topic-fg: #70509b; }
@media (max-width: 680px) {
  .sidebar nav a[data-nav="fiches"], .sidebar nav a[data-nav="pratique"] { display: none; }
  .sidebar nav a[data-nav="cours"] { display: flex; }
}

.material-group + .material-group { margin-top: 25px; }

.application-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}
.application-fields > :nth-child(4) { grid-column: 1 / -1; }
.field input[type="file"] { font-size: .9rem; }
.field input::file-selector-button {
  border: 0;
  border-radius: 6px;
  background: var(--rose);
  color: var(--wine-dark);
  padding: 5px 8px;
  margin-right: 7px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}
.member-proof { margin-top: 10px; }
