/* ===== SAMS · clair, clinique, rouge médical ===== */
:root {
    --paper: #F3F7F7;
    --white: #FFFFFF;
    --ink: #0E2A30;
    --ink-2: #163B42;
    --slate: #4A6168;
    --line: #DCE7E8;
    --red: #D93848;
    --red-dark: #B92736;
    --red-soft: #FDECEE;
    --teal: #0F6B6E;
    --teal-soft: #E1F2F1;
    --lakeview: #2EE6B6;
    --head: 'Sora', 'Segoe UI', sans-serif;
    --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --r-lg: 28px;
    --r-md: 18px;
    --r-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.02em; color: var(--ink); }
p { margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--white); padding: 8px 14px; z-index: 10; }

/* ----- Bandeau ----- */
.topbar { background: var(--ink); color: #CFE1E2; font-size: 14px; }
.topbar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 20px; padding-top: 8px; padding-bottom: 8px; }
.topbar strong { color: var(--white); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--lakeview); font-weight: 700; text-decoration: none; min-height: 32px; }
.back:hover { color: #7DF3D4; }

/* ----- Navigation ----- */
.nav { background: var(--paper); }
.nav .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-family: var(--head); font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.brand small { font-size: 12px; color: var(--slate); font-weight: 600; }
.nav nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-weight: 600; }
.nav nav a:not(.btn) { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav nav a:not(.btn):hover { color: var(--red); }

/* ----- Boutons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-family: var(--body); font-weight: 700; font-size: 16px; text-decoration: none; border: 2px solid transparent; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); color: var(--white); }
.btn-light { background: transparent; border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-light:hover { border-color: var(--white); color: var(--white); }
.btn-sm { min-height: 44px; padding: 0 20px; }

/* ----- Accueil ----- */
.hero-shell { padding-top: 8px; }
.hero { position: relative; overflow: hidden; background: var(--ink); border-radius: var(--r-lg); padding: 64px 56px 72px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 24px; }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #DCEBEC; font-size: 14px; font-weight: 600; }
.live { width: 9px; height: 9px; border-radius: 50%; background: #3FD69B; box-shadow: 0 0 0 0 rgba(63,214,155,0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(63,214,155,0); } 100% { box-shadow: 0 0 0 0 rgba(63,214,155,0); } }
.hero h1 { color: var(--white); font-size: clamp(38px, 5vw, 60px); line-height: 1.08; font-weight: 700; }
.lead { color: #C4D8DA; font-size: 18px; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { position: relative; z-index: 1; }
.photo { margin: 0; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 5 / 5.6; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.float { position: absolute; display: flex; align-items: center; gap: 12px; background: var(--white); border-radius: var(--r-sm); padding: 12px 16px; box-shadow: 0 18px 40px rgba(6, 26, 30, 0.28); }
.float span { display: flex; flex-direction: column; line-height: 1.3; }
.float strong { font-family: var(--head); font-size: 15px; }
.float small { font-size: 13px; color: var(--slate); }
.float-top { top: 28px; left: -28px; }
.float-bottom { bottom: 28px; right: -18px; }
.float-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid !important; place-items: center; flex: none; }
.float-icon-teal { background: var(--teal-soft); color: var(--teal); }
.ecg { position: absolute; left: 0; bottom: 10px; width: 100%; height: 80px; }
.ecg path { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }

/* ----- Sections ----- */
.section { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 48px; }
.band { background: var(--white); }
.head { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.head h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12; font-weight: 700; }
.head p { color: var(--slate); font-size: 17px; }

.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.card h3 { font-size: 20px; font-weight: 700; }
.card p { color: var(--slate); }
.card-feature { background: var(--red); border-color: var(--red); }
.card-feature h3, .card-feature p { color: var(--white); }
.card-feature .icon { background: rgba(255,255,255,0.18); color: var(--white); }
.icon { width: 52px; height: 52px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.icon-red { background: var(--red-soft); color: var(--red); }

/* Parcours (séquence réelle : numéros justifiés) */
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); counter-reset: grade; }
.path li { counter-increment: grade; position: relative; background: var(--paper); border-radius: var(--r-md); padding: 24px 22px; display: flex; flex-direction: column; gap: 8px; }
.path li::before { content: counter(grade); width: 34px; height: 34px; border-radius: 50%; background: var(--white); border: 2px solid var(--red); color: var(--red); font-family: var(--head); font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.path li:last-child { background: var(--ink); }
.path li:last-child h3 { color: var(--white); }
.path li:last-child p { color: #C4D8DA; }
.path li:last-child::before { background: var(--red); color: var(--white); }
.path h3 { font-size: 18px; }
.path p { color: var(--slate); font-size: 15px; }

/* Recrutement */
.recruit { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; }
.recruit-text { display: flex; flex-direction: column; gap: 22px; }
.recruit-text h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12; }
.recruit-text > p { color: var(--slate); font-size: 17px; }
.recruit-text .btn { align-self: flex-start; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.checks li::before { content: ''; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F6B6E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.steps { list-style: none; margin: 0; padding: 32px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; padding-bottom: 24px; position: relative; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step); grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-family: var(--head); font-weight: 800; display: grid; place-items: center; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 44px; bottom: 4px; width: 2px; background: var(--line); }
.steps h3 { font-size: 18px; align-self: center; }
.steps p { color: var(--slate); font-size: 15px; }

/* FAQ */
.faq-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--paper); border-radius: var(--r-sm); padding: 0 22px; }
.faq details[open] { background: var(--white); border: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--head); font-weight: 600; font-size: 17px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--white); color: var(--red); display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.faq details[open] summary::after { content: '−'; background: var(--red); color: var(--white); }
.faq details p { color: var(--slate); padding-bottom: 20px; }

/* Contact */
.contact { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.contact-item { display: flex; gap: 18px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; }
.contact-item h3 { font-size: 20px; margin-bottom: 6px; }
.contact-item p { color: var(--slate); }

/* Pied de page */
.footer { background: var(--ink); color: #C4D8DA; }
.footer .wrap { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-family: var(--head); font-weight: 700; color: var(--white); }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer nav a { color: var(--white); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.footer nav a:hover { color: var(--lakeview); }
.legal { flex-basis: 100%; font-size: 13px; color: #8FAAAD; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; padding: 44px 28px 80px; }
    .float-top { left: 12px; }
    .float-bottom { right: 12px; }
    .recruit, .faq-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .hero { border-radius: 20px; padding: 36px 20px 76px; }
    .nav nav { gap: 0 18px; font-size: 15px; }
    .section { padding-top: 64px; padding-bottom: 64px; }
    .float { padding: 10px 12px; }
    .steps { padding: 24px; }
}

/* =====================================================
   Application : espace patient et espace personnel
   ===================================================== */
.nav nav a[aria-current="page"] { color: var(--red); }
.nav-user { display: inline-flex; align-items: center; gap: 10px; }
.nav-user img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #C4D8DA; cursor: pointer; min-height: 44px; }
.link-button:hover { color: var(--white); }

.page-head { padding-top: 24px; }
.page-head .head-card { background: var(--ink); border-radius: var(--r-lg); padding: 40px 44px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; position: relative; overflow: hidden; }
.page-head h1 { color: var(--white); font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
.page-head p { color: #C4D8DA; margin-top: 8px; max-width: 640px; }
.page-head .crumb { color: #8FAAAD; font-size: 14px; margin: 0 0 8px; }
.page-head .crumb a { color: #CFE1E2; }
.page { padding-top: 32px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 28px; }

.btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-2); color: var(--white); }
.btn-outline-light { border-color: rgba(255,255,255,0.5); color: var(--white); background: transparent; }
.btn-outline-light:hover { border-color: var(--white); color: var(--white); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }
button.btn { cursor: pointer; }

.notice { border-radius: var(--r-sm); padding: 14px 18px; font-weight: 600; border: 1px solid var(--line); background: var(--white); }
.notice-ok { border-color: #A7DFC4; background: #EAF8F1; color: #155E3E; }
.notice-bad { border-color: #F3B7BE; background: var(--red-soft); color: #8E1C28; }
.notice-info { border-color: #BCD6F5; background: #EEF5FD; color: #1E4F86; }

.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.panel h2 { font-size: 22px; }
.panel h3 { font-size: 18px; }
.muted { color: var(--slate); }
.small { font-size: 14px; }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-family: var(--head); font-size: 32px; line-height: 1.1; }
.stat span { color: var(--slate); font-size: 14px; }
.stat-red { background: var(--red); border-color: var(--red); }
.stat-red strong, .stat-red span { color: var(--white); }

.duty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--white); }
.duty-on { background: #EAF8F1; border-color: #A7DFC4; }
.duty-state { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #9FB3B6; flex: none; }
.dot-on { background: #2E9E6B; box-shadow: 0 0 0 5px rgba(46,158,107,0.18); }

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 18px; background: var(--white); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--paper); color: var(--ink); }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main strong { font-weight: 700; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--slate); font-size: 14px; }
.empty { padding: 22px; border: 1px dashed #C9D8D9; border-radius: var(--r-sm); color: var(--slate); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.tag { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tag-pending { background: #FFF3DF; color: #8A5300; }
.tag-ok { background: #E3F5EC; color: #155E3E; }
.tag-info { background: #E8F1FC; color: #1E4F86; }
.tag-bad { background: var(--red-soft); color: #8E1C28; }
.tag-muted { background: #EDF2F2; color: var(--slate); }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field .help { color: var(--slate); font-size: 14px; }
.field .error { color: #B4232F; font-size: 14px; font-weight: 700; }
.fields-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], textarea, select {
    width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid #C9D8D9; background: var(--white);
    color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,56,72,0.18); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: inline; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 16px; font-weight: 700; color: var(--slate); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }

.facts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts dt { color: var(--slate); font-size: 13px; font-weight: 700; }
.facts dd { margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.blood { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; height: 56px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-family: var(--head); font-weight: 800; font-size: 22px; }

.character-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.character-switch button { border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); background: transparent; color: var(--white); padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; }
.character-switch button[aria-pressed="true"] { background: var(--white); color: var(--ink); }

details.card-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 24px; }
details.card-form[open] { padding-bottom: 24px; }
details.card-form summary { cursor: pointer; font-family: var(--head); font-weight: 700; font-size: 17px; min-height: 64px; display: flex; align-items: center; list-style: none; }
details.card-form summary::-webkit-details-marker { display: none; }
details.card-form summary::before { content: '+'; display: grid; place-items: center; width: 30px; height: 30px; margin-right: 12px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; }
details.card-form[open] summary::before { content: '−'; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 13px; color: var(--slate); background: var(--paper); }
tr:last-child td { border-bottom: 0; }

/* ----- Documents médicaux (imprimables) ----- */
.doc { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 48px; max-width: 820px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--red); }
.doc-brand { display: flex; align-items: center; gap: 12px; }
.doc-brand strong { font-family: var(--head); font-size: 20px; display: block; }
.doc-title { font-size: 26px; }
.doc-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate); margin-bottom: 6px; }
.doc-section p { white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-sign { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--slate); font-size: 14px; }
.doc-code { font-family: var(--head); font-weight: 800; letter-spacing: 0.06em; font-size: 20px; color: var(--ink); }
.stamp { display: inline-flex; padding: 8px 16px; border: 3px solid currentColor; border-radius: 8px; font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; transform: rotate(-4deg); }
.stamp-ok { color: #2E9E6B; }
.stamp-bad { color: var(--red); }
.staff-only { background: #FFF8E8; border: 1px dashed #E3B860; border-radius: var(--r-sm); padding: 14px 16px; }

.verify { max-width: 720px; }
.verify-result { display: flex; gap: 18px; align-items: flex-start; padding: 26px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--white); }
.verify-valid { border-color: #7FD1A9; }
.verify-bad { border-color: #F0A0A9; }

@media print {
    .topbar, .nav, .footer, .no-print { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; }
    .doc { border: 0; padding: 0; max-width: none; }
}
@media (max-width: 560px) {
    .page-head .head-card { padding: 28px 22px; border-radius: 20px; }
    .doc { padding: 24px; }
    .panel { padding: 20px; }
}
.narrow { max-width: 560px; }
a.card { text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; } a.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(14,42,48,0.08); color: inherit; }
.narrow-lg { max-width: 760px; }
