/* Dreamode — espace client. Identité « verre et néon » : nuit, magenta, violet, cyan, touches d'or. */
@font-face { font-family: 'Outfit'; src: url('../assets/brand/outfit-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../assets/brand/outfit-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../assets/brand/outfit-latin-500-normal.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../assets/brand/playfair-display-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('../assets/brand/playfair-display-latin-500-normal.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
	--night: #06071a; --night2: #0c0e2a; --glass: rgba(255, 255, 255, .045); --glass2: rgba(255, 255, 255, .08);
	--line: rgba(255, 255, 255, .1); --line2: rgba(255, 255, 255, .18);
	--text: #eceefb; --muted: #a6a9cc; --dim: #7c7fa6;
	--magenta: #d946ef; --violet: #8b5cf6; --cyan: #22d3ee; --gold: #c9a24a;
	--ok: #34d399; --warn: #fbbf24; --danger: #fb7185; --info: #67e8f9;
	--grad: linear-gradient(90deg, #d946ef, #8b5cf6 50%, #22d3ee);
	--r: 16px; --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --serif: 'Playfair Display', Georgia, serif;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; background: var(--night); color: var(--text); font: 400 16px/1.6 var(--font);
	background-image: radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .22), transparent 60%), radial-gradient(900px 500px at -10% 10%, rgba(217, 70, 239, .14), transparent 60%), radial-gradient(800px 600px at 50% 120%, rgba(34, 211, 238, .1), transparent 60%);
	background-attachment: fixed;
}
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #7ee8f8; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.25; margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h2.sec { margin: 28px 0 12px; }
p { margin: 0 0 1em; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--glass2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small, small { font-size: .86rem; } .center { text-align: center; }
.req { color: var(--magenta); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
.spin { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--line2); border-top-color: var(--magenta); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px 0; text-align: center; }
.noscript { padding: 40px; text-align: center; }

/* ---------- Boutons, champs ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line2);
	background: var(--glass2); color: var(--text); font: 500 15px/1.2 var(--font); cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .2s;
}
.btn:hover { background: rgba(255, 255, 255, .12); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { border: 0; background: var(--grad); color: #fff; box-shadow: 0 6px 24px -8px rgba(217, 70, 239, .7); }
.btn.primary:hover { box-shadow: 0 8px 30px -6px rgba(139, 92, 246, .8); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(251, 113, 133, .4); }
.btn.sm { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn.big { width: 100%; min-height: 50px; font-size: 16px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.link { background: none; border: 0; color: var(--cyan); padding: 4px 0; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

.form { display: grid; gap: 16px; }
.form label, .form fieldset { display: grid; gap: 6px; font-weight: 500; }
.form small { font-weight: 400; color: var(--muted); }
input, textarea, select {
	width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(6, 7, 26, .55); color: var(--text);
	font: 400 16px/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .3); }
input[readonly] { color: var(--muted); background: transparent; }
input::placeholder, textarea::placeholder { color: var(--dim); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 500; }
.choice { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
.choice legend { width: 100%; }
.choice small { width: 100%; }
.pill { display: inline-flex !important; cursor: pointer; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-block; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line2); background: var(--glass); font-weight: 400; transition: all .15s; }
.pill input:checked + span { border-color: transparent; background: var(--grad); color: #fff; }
.pill input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.check { display: flex !important; align-items: flex-start; gap: 10px !important; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 2px; accent-color: var(--violet); }
.row2 { grid-template-columns: 1fr auto; align-items: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.actions .saved { margin-right: auto; }

/* ---------- Cartes, alertes, pastilles ---------- */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin: 0 0 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.alert { padding: 13px 16px; border-radius: 12px; margin: 0 0 16px; background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .35); }
.alert.ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); }
.alert.warn { background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .4); }
.alert.info { background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .35); }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; border: 1px solid; }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .08); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .08); }
.badge.danger { color: var(--danger); border-color: rgba(251, 113, 133, .5); background: rgba(251, 113, 133, .08); }
.badge.info { color: var(--info); border-color: rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .07); }
.badge.neutral { color: var(--muted); border-color: var(--line2); }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 24px 16px; gap: 14px; }
.auth-card { width: 100%; max-width: 440px; background: rgba(12, 14, 42, .72); border: 1px solid var(--line); border-radius: 22px; padding: 30px 26px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -30px rgba(139, 92, 246, .45); position: relative; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 22px 22px 0 0; background: var(--grad); }
.auth-card h1 { font-size: 1.8rem; }
.auth-foot { color: var(--dim); font-size: 13px; text-align: center; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-bottom: 22px; }
.brand b { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; letter-spacing: .04em; }
.brand span { display: block; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Cadre ---------- */
#shell { max-width: 880px; margin: 0 auto; padding: 0 16px 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.top .brand { margin: 0; min-width: 0; }
.top .brand span { text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px 0 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; gap: 7px; align-items: center; padding: 9px 15px; border-radius: 999px; color: var(--muted); text-decoration: none; border: 1px solid transparent; font-size: 15px; }
.tabs a:hover { color: var(--text); background: var(--glass); }
.tabs a.on { color: var(--text); border-color: var(--line2); background: var(--glass2); }
#view { padding-top: 14px; }
.back { margin: 0 0 12px; }
.back a { color: var(--muted); text-decoration: none; }

/* ---------- Accueil ---------- */
.hello { margin: 10px 0 22px; }
.progress { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.progress .bar { flex: 1; height: 10px; border-radius: 99px; background: var(--glass2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.progress span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.steps { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; counter-reset: s; }
.steps li { position: relative; text-align: center; font-size: 13px; color: var(--dim); padding-top: 34px; }
.steps li i { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); background: var(--night2); }
.steps li::before { content: ''; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line2); z-index: -1; }
.steps li:first-child::before { display: none; }
.steps li.done { color: var(--text); }
.steps li.done i { border-color: transparent; background: var(--grad); }
.steps li.done i::after { content: '✓'; color: #fff; font-size: 13px; font-style: normal; line-height: 22px; }
.steps li.done::before { background: var(--violet); }
.missions { display: grid; gap: 10px; }
.mission { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.mission:hover { color: var(--text); border-color: rgba(139, 92, 246, .55); background: var(--glass2); transform: translateY(-1px); }
.mission.a_corriger { border-color: rgba(251, 113, 133, .45); }
.mission.valide { opacity: .72; }
.mi { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--glass2); font-size: 22px; }
.mi.big { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; flex: none; }
.mt b { display: block; font-weight: 500; }
.mt em { display: block; font-style: normal; color: var(--danger); font-size: 14px; }
.go { color: var(--dim); font-size: 22px; }
.contact p { margin: 0; }

/* ---------- Mission ---------- */
.mhead { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.mhead h1 { margin-bottom: 6px; }
.intro { font-size: 1.05rem; margin-bottom: 14px; }
.intro p:last-child { margin-bottom: 0; }
.guide { border: 1px solid rgba(201, 162, 74, .35); border-radius: var(--r); background: rgba(201, 162, 74, .05); margin-bottom: 18px; }
.guide summary { cursor: pointer; padding: 14px 18px; font-weight: 500; color: var(--gold); list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: '▸ '; display: inline-block; transition: transform .2s; }
.guide[open] summary::before { transform: rotate(90deg); }
.md { padding: 0 18px 16px; }
.md h3 { font-size: 1.05rem; margin: 16px 0 8px; }
.md h4 { margin: 14px 0 6px; font-size: 1rem; }
.md ol, .md ul { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 6px 0; }
.md strong { color: #fff; }
.tip { margin: 12px 0; padding: 11px 14px; border-left: 3px solid var(--cyan); background: rgba(34, 211, 238, .06); border-radius: 0 10px 10px 0; color: var(--text); }
.ro { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ro span { color: var(--muted); font-size: 14px; }
.ro p { margin: 2px 0 0; }
.filezone h3 { font-family: var(--font); font-weight: 500; font-size: 1rem; margin: 6px 0 10px; }
.drop { position: relative; display: grid !important; place-items: center; text-align: center; gap: 2px !important; padding: 26px 18px; border: 2px dashed var(--line2); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; font-weight: 400 !important; }
.drop:hover, .drop.over { border-color: var(--magenta); background: rgba(217, 70, 239, .06); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.dz-i { font-size: 26px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 6px; }
.drop small { margin-top: 4px; }

/* ---------- Listes de fichiers et documents ---------- */
.files { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.files li, .up { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(6, 7, 26, .4); border: 1px solid var(--line); }
.fi { font-size: 22px; width: 40px; text-align: center; flex: none; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; background: var(--glass2); }
.fn { flex: 1; min-width: 0; display: grid; }
.fn a, .fn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fn small { color: var(--muted); }
.up { margin-top: 8px; }
.up .bar { display: block; height: 6px; border-radius: 99px; background: var(--glass2); overflow: hidden; margin: 6px 0 2px; }
.up .bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .25s; }
.up.ok .bar i { background: var(--ok); width: 100%; }
.up.ko { border-color: rgba(251, 113, 133, .45); }
.up.ko small { color: var(--danger); }
.docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.docs a { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6, 7, 26, .4); color: var(--text); text-decoration: none; }
.docs a:hover { border-color: rgba(139, 92, 246, .55); color: var(--text); }
.docs small { display: block; color: var(--muted); }
.amt { text-align: right; font-weight: 500; white-space: nowrap; }
.due { color: var(--warn) !important; }
.howto { padding-left: 20px; line-height: 1.7; }
.key { display: inline-block; margin-top: 4px; letter-spacing: .08em; word-break: break-all; }

/* ---------- Notifications ---------- */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 460px); }
.toast { padding: 13px 18px; border-radius: 14px; background: #1a1c40; border: 1px solid var(--line2); box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .6); animation: up .25s ease; transition: opacity .4s, transform .4s; }
.toast.ok { border-color: rgba(52, 211, 153, .5); }
.toast.err { border-color: rgba(251, 113, 133, .6); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 640px) {
	body { font-size: 15.5px; }
	.card { padding: 18px 16px; }
	.mission { grid-template-columns: auto 1fr auto; padding: 14px; gap: 12px; }
	.mission .badge { grid-column: 2; justify-self: start; }
	.mission .go { grid-row: 1; grid-column: 3; }
	.steps { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
	.steps li:nth-child(4)::before { display: none; }
	.docs a { grid-template-columns: 1fr auto; }
	.docs .badge, .docs .go { display: none; }
	.actions .btn { flex: 1; }
	.actions .saved { width: 100%; }
	.top .btn { padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
