/* ============ RESET & BASE ============ */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --accent:#0067c0;
  --win-bg:#fbfbfb;
  --titlebar:#f3f3f3;
  --border:rgba(0,0,0,.08);
  --text:#1b1b1b;
}
html,body { height:100%; overflow:hidden; }
body {
  font-family:"Segoe UI Variable Text","Segoe UI",system-ui,sans-serif;
  font-size:14px; color:var(--text); user-select:none;
}
input,textarea { user-select:text; font-family:inherit; }
button { font-family:inherit; cursor:pointer; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:rgba(0,0,0,.25); border-radius:5px; border:2px solid transparent; background-clip:content-box; }

/* ============ FOND "BLOOM" ============ */
.bloom {
  position:fixed; inset:0; z-index:-1;
  background:
    radial-gradient(55% 70% at 68% 38%, rgba(64,156,255,.85), transparent 62%),
    radial-gradient(45% 55% at 30% 62%, rgba(0,84,212,.8), transparent 65%),
    radial-gradient(38% 48% at 52% 78%, rgba(125,207,255,.55), transparent 60%),
    radial-gradient(30% 40% at 78% 70%, rgba(186,104,255,.35), transparent 65%),
    linear-gradient(155deg,#04123a 0%,#0a2a6e 55%,#0d3f92 100%);
  transition:filter .5s;
}
body[data-wall="1"] .bloom { filter:hue-rotate(120deg); }
body[data-wall="2"] .bloom { filter:hue-rotate(265deg) saturate(1.2); }

/* ============ ÉCRAN DE CONNEXION ============ */
body.lockscreen { display:flex; flex-direction:column; align-items:center; justify-content:center; }
.signin { text-align:center; color:#fff; animation:fadeUp .5s ease; }
.avatar {
  width:120px; height:120px; margin:0 auto 16px; border-radius:50%;
  background:rgba(255,255,255,.22); display:grid; place-items:center;
  font-size:56px; backdrop-filter:blur(8px);
}
.avatar.sm { width:30px; height:30px; font-size:15px; margin:0; }
.auth-form { display:flex; flex-direction:column; gap:9px; width:300px; margin:0 auto; }
.auth-form h2 { font-weight:600; margin-bottom:6px; }
.auth-form input {
  padding:9px 12px; border:1px solid rgba(255,255,255,.4); border-radius:4px;
  background:rgba(0,0,0,.28); color:#fff; outline:none; backdrop-filter:blur(6px);
}
.auth-form input::placeholder { color:rgba(255,255,255,.75); }
.auth-form input:focus { border-color:#76c7ff; }
.pwd-row { display:flex; gap:6px; }
.pwd-row input { flex:1; }
.go {
  width:38px; border:none; border-radius:4px; background:rgba(255,255,255,.85);
  font-size:17px; transition:.15s;
}
.go.wide { width:auto; padding:9px; font-size:13px; background:#fff; color:#111; }
.go:hover { background:#fff; }
.link { background:none; border:none; color:#cfe6ff; font-size:13px; align-self:center; text-decoration:underline; }
.form-msg { min-height:18px; font-size:13px; color:#ffd7d7; }
.ls-footer {
  position:fixed; bottom:0; left:0; right:0; padding:12px 22px;
  display:flex; justify-content:space-between; color:rgba(255,255,255,.8); font-size:12px;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } }

/* ============ BUREAU & ICÔNES ============ */
#desktop { position:fixed; inset:0 0 48px 0; }
#deskIcons { display:flex; flex-direction:column; flex-wrap:wrap; align-content:flex-start; gap:2px; padding:8px; height:100%; }
.dicon {
  width:86px; padding:8px 4px; border:1px solid transparent; border-radius:4px;
  display:flex; flex-direction:column; align-items:center; gap:4px; cursor:default;
}
.dicon:hover { background:rgba(255,255,255,.12); }
.dicon.selected { background:rgba(120,170,255,.28); border-color:rgba(160,200,255,.5); }
.dicon .di-ico { font-size:34px; filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.dicon .di-name {
  font-size:12px; color:#fff; text-align:center; line-height:1.25; max-width:80px;
  text-shadow:0 1px 3px rgba(0,0,0,.9); word-break:break-word;
}

/* ============ FENÊTRES ============ */
#winLayer { position:fixed; inset:0 0 48px 0; pointer-events:none; }
.window {
  position:absolute; display:flex; flex-direction:column; pointer-events:auto;
  background:var(--win-bg); border:1px solid var(--border); border-radius:8px;
  box-shadow:0 10px 44px rgba(0,0,0,.38); overflow:hidden;
  min-width:380px; min-height:240px; animation:winOpen .16s ease;
}
.window.focused { box-shadow:0 16px 60px rgba(0,0,0,.5); }
.window.max { inset:0 !important; border-radius:0; }
.window.minimized { display:none; }
@keyframes winOpen { from { opacity:0; transform:scale(.94); } }

.titlebar {
  height:36px; flex:none; display:flex; align-items:center; gap:8px;
  padding-left:12px; background:var(--titlebar); cursor:default;
}
.tb-icon { font-size:15px; }
.tb-title { flex:1; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tb-btns { display:flex; height:100%; }
.tb-btns button {
  width:46px; height:100%; border:none; background:transparent; font-size:11px; color:var(--text);
}
.tb-btns button:hover { background:rgba(0,0,0,.06); }
.tb-btns .tb-close:hover { background:#c42b1c; color:#fff; }
.win-body { flex:1; display:flex; flex-direction:column; overflow:hidden; }

/* ============ EXPLORATEUR ============ */
.exp-toolbar {
  flex:none; display:flex; align-items:center; gap:6px;
  padding:8px 10px; border-bottom:1px solid var(--border);
}
.exp-toolbar .btn { padding:5px 10px; font-size:12.5px; }
.exp-back { border:none; background:none; font-size:16px; padding:4px 8px; border-radius:4px; }
.exp-back:hover:not(:disabled) { background:rgba(0,0,0,.06); }
.exp-back:disabled { opacity:.35; cursor:default; }
.exp-path {
  flex:1; display:flex; align-items:center; gap:2px; padding:5px 10px;
  border:1px solid var(--border); border-radius:4px; background:#fff;
  font-size:12.5px; overflow:hidden; white-space:nowrap;
}
.exp-path span { color:#555; padding:2px 5px; border-radius:3px; cursor:pointer; }
.exp-path span:hover { background:rgba(0,0,0,.06); color:#000; }
.exp-path b { color:#888; font-weight:400; }

.exp-main { flex:1; display:flex; overflow:hidden; }
.exp-side {
  flex:none; width:170px; padding:8px 6px; overflow:auto;
  border-right:1px solid var(--border); background:#f6f6f6;
}
.exp-side button {
  display:flex; align-items:center; gap:8px; width:100%; padding:6px 10px;
  border:none; background:none; border-radius:4px; font-size:13px; text-align:left;
}
.exp-side button:hover { background:rgba(0,0,0,.06); }
.exp-side button.active { background:rgba(0,103,192,.12); }
.exp-items { flex:1; overflow:auto; padding:6px; background:#fff; }
.exp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:2px; align-content:start; }
.eitem {
  display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:10px 4px; border:1px solid transparent; border-radius:4px; cursor:default;
}
.eitem:hover { background:rgba(0,0,0,.045); }
.eitem.selected { background:rgba(0,103,192,.13); border-color:rgba(0,103,192,.35); }
.eitem .ei-ico { font-size:34px; }
.eitem .ei-name { font-size:12px; text-align:center; word-break:break-word; max-width:90px; }
.exp-status { flex:none; padding:4px 12px; font-size:12px; color:#555; border-top:1px solid var(--border); background:#f9f9f9; }
.exp-empty { padding:40px; text-align:center; color:#999; font-size:13px; }

/* ============ TERMINAL ============ */
.window.app-terminal { background:#0c0c0c; }
.window.app-terminal .titlebar { background:#1f1f1f; color:#eee; }
.window.app-terminal .tb-btns button { color:#eee; }
.term { flex:1; display:flex; flex-direction:column; overflow:auto; padding:8px 4px 8px 10px;
  font-family:"Cascadia Mono","Consolas","Courier New",monospace; font-size:13.5px;
  line-height:1.45; color:#cccccc; background:transparent; }
.term-out div { white-space:pre-wrap; word-break:break-all; }
.term-line { display:flex; gap:0; }
.term-prompt { white-space:pre; color:inherit; }
.term-in {
  flex:1; background:transparent; border:none; outline:none; color:inherit;
  font:inherit; caret-color:#fff;
}

/* ============ BLOC-NOTES ============ */
.np-wrap { flex:1; display:flex; flex-direction:column; }
.np-bar { flex:none; display:flex; gap:6px; padding:6px 8px; border-bottom:1px solid var(--border); background:#f6f6f6; }
.np-area {
  flex:1; border:none; outline:none; resize:none; padding:10px 12px;
  font-family:Consolas,monospace; font-size:14px; background:#fff;
}
.np-status { flex:none; padding:3px 12px; font-size:12px; color:#555; border-top:1px solid var(--border); background:#f6f6f6; }

/* ============ BARRE DES TÂCHES ============ */
#taskbar {
  position:fixed; left:0; right:0; bottom:0; height:48px; z-index:9999;
  display:flex; align-items:center; justify-content:space-between;
  background:rgba(243,243,243,.86); backdrop-filter:blur(24px) saturate(1.4);
  border-top:1px solid rgba(0,0,0,.08);
}
.tb-center { display:flex; align-items:center; gap:4px; position:absolute; left:50%; transform:translateX(-50%); }
#btnStart, .tb-app {
  width:40px; height:40px; border:none; background:transparent; border-radius:6px;
  display:grid; place-items:center; font-size:20px; position:relative; transition:background .12s;
}
#btnStart:hover, .tb-app:hover { background:rgba(0,0,0,.07); }
#btnStart:active, .tb-app:active { transform:scale(.92); }
.tb-app[data-open]::after {
  content:""; position:absolute; bottom:2px; left:50%; transform:translateX(-50%);
  width:6px; height:3px; border-radius:2px; background:#666;
}
.tb-app[data-open][data-active]::after { width:16px; background:var(--accent); }
#tbSearch {
  height:34px; padding:0 14px; display:flex; align-items:center; gap:8px;
  background:#fff; border:1px solid var(--border); border-radius:17px;
  font-size:13px; color:#555; cursor:text; min-width:150px;
}
.tb-right { display:flex; align-items:center; gap:4px; padding-right:2px; }
.tray-icons { font-size:12px; padding:0 8px; letter-spacing:2px; }
#trayClock {
  display:flex; flex-direction:column; align-items:flex-end; justify-content:center;
  border:none; background:transparent; font-size:12px; line-height:1.35; padding:4px 10px; border-radius:6px;
}
#trayClock:hover { background:rgba(0,0,0,.07); }
#showDesk { width:8px; height:100%; border:none; border-left:1px solid rgba(0,0,0,.15); background:transparent; }
#showDesk:hover { background:rgba(0,0,0,.08); }

/* ============ MENU DÉMARRER ============ */
#startMenu {
  position:fixed; left:50%; bottom:60px; transform:translateX(-50%) translateY(16px);
  width:560px; max-width:94vw; padding:24px 26px 14px; z-index:10000;
  background:rgba(249,249,249,.92); backdrop-filter:blur(30px) saturate(1.5);
  border:1px solid rgba(0,0,0,.1); border-radius:10px;
  box-shadow:0 18px 60px rgba(0,0,0,.35);
  opacity:0; pointer-events:none; transition:.18s ease;
}
#startMenu.open { opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto; }
.sm-search {
  display:flex; align-items:center; gap:8px; padding:8px 14px; margin-bottom:18px;
  background:#fff; border:1px solid var(--border); border-bottom:2px solid var(--accent); border-radius:6px;
}
.sm-search input { flex:1; border:none; outline:none; background:none; font-size:13.5px; }
#startMenu h3 { font-size:14px; font-weight:600; margin-bottom:10px; }
.sm-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:4px; min-height:170px; align-content:start; }
.sm-app {
  display:flex; flex-direction:column; align-items:center; gap:6px; padding:12px 4px;
  border:none; background:transparent; border-radius:6px; font-size:11.5px;
}
.sm-app:hover:not(:disabled) { background:rgba(0,0,0,.06); }
.sm-app:disabled { opacity:.45; cursor:default; }
.sm-ico { font-size:26px; }
.sm-footer {
  margin-top:18px; padding:10px 4px 0; border-top:1px solid rgba(0,0,0,.08);
  display:flex; justify-content:space-between; align-items:center;
}
.sm-user { display:flex; align-items:center; gap:9px; font-size:13px; font-weight:600; }
.power { border:none; background:transparent; font-size:18px; padding:8px 10px; border-radius:6px; }
.power:hover { background:rgba(0,0,0,.08); }

/* ============ MENUS CONTEXTUELS / MODALE / TOASTS / BOUTONS ============ */
#ctxMenu {
  position:fixed; z-index:10001; min-width:200px; padding:5px;
  background:rgba(250,250,250,.95); backdrop-filter:blur(20px);
  border:1px solid rgba(0,0,0,.1); border-radius:8px; box-shadow:0 8px 30px rgba(0,0,0,.3);
}
#ctxMenu button {
  display:flex; align-items:center; gap:10px; width:100%; padding:7px 12px;
  border:none; background:none; border-radius:5px; font-size:13px; text-align:left;
}
#ctxMenu button:hover { background:rgba(0,0,0,.07); }
#ctxMenu hr { border:none; border-top:1px solid rgba(0,0,0,.09); margin:4px 6px; }

.btn {
  padding:5px 14px; border:1px solid rgba(0,0,0,.1); border-radius:4px;
  background:#fdfdfd; font-size:13px; transition:.1s;
}
.btn:hover { background:#f3f3f3; }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn.primary:hover { background:#1975c5; }

#modal { position:fixed; inset:0; z-index:10002; display:grid; place-items:center; background:rgba(0,0,0,.32); }
.modal-box {
  width:360px; padding:20px; background:#fff; border-radius:8px;
  box-shadow:0 12px 50px rgba(0,0,0,.4); animation:winOpen .15s ease;
}
.modal-box h3 { font-size:15px; font-weight:600; margin-bottom:14px; }
.modal-box input {
  width:100%; padding:8px 11px; border:1px solid #999; border-bottom:2px solid var(--accent);
  border-radius:4px; outline:none; font-size:13.5px; margin-bottom:16px;
}
.modal-btns { display:flex; justify-content:flex-end; gap:8px; }

#toasts { position:fixed; right:14px; bottom:62px; z-index:10003; display:flex; flex-direction:column; gap:8px; }
.toast {
  padding:11px 18px; background:rgba(250,250,250,.95); backdrop-filter:blur(16px);
  border:1px solid rgba(0,0,0,.1); border-radius:6px; box-shadow:0 6px 22px rgba(0,0,0,.25);
  font-size:13px; animation:fadeUp .25s ease;
}