/* Thème « Luna » de Windows XP, fait main (aucune dépendance). */
:root {
  --blue: #0a5fd8; --blue-dark: #0831d9; --face: #ece9d8; --ink: #000; --green: #3da230;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif; font-size: 13px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #3a6ea5; }
[hidden] { display: none !important; }

/* Bureau : colline « Bliss » */
#desktop {
  position: fixed; inset: 0 0 30px 0; overflow: hidden;
  background:
    radial-gradient(ellipse 90% 28% at 25% 100%, #62b52a 0 62%, transparent 63%),
    radial-gradient(ellipse 80% 24% at 85% 104%, #3e9a1a 0 62%, transparent 63%),
    radial-gradient(ellipse 22% 7% at 70% 24%, #fffffff0 0 40%, transparent 72%),
    radial-gradient(ellipse 28% 8% at 20% 14%, #ffffffe0 0 40%, transparent 72%),
    radial-gradient(ellipse 18% 6% at 45% 38%, #ffffffc0 0 40%, transparent 72%),
    linear-gradient(#1f62d0, #5b9fee 55%, #b6d8ff 85%);
}
#icons { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 14px; }
.dicon { width: 76px; text-align: center; color: #fff; text-shadow: 1px 1px 2px #000; font-size: 12px; cursor: default; background: none; border: 0; font: inherit; }
.dicon svg { width: 36px; height: 36px; display: block; margin: 0 auto 3px; filter: drop-shadow(1px 2px 1px #0008); }
.dicon:focus-visible, .dicon:hover { outline: 1px dotted #fff; background: #316ac580; }

/* Fenêtres */
#windows { position: absolute; inset: 0; }
.win {
  position: absolute; background: var(--face); border: 3px solid var(--blue-dark); border-top: 0;
  border-radius: 8px 8px 0 0; box-shadow: 3px 4px 12px #0009; max-width: calc(100vw - 8px);
  display: flex; flex-direction: column; max-height: calc(100vh - 40px);
}
.win.inactive { border-color: #6b83c9; }
.win.inactive .tbar { background: linear-gradient(#7a96df, #8aa4e6 20%, #7089d3 80%, #6b83c9); }
.tbar {
  height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 6px; color: #fff; font-weight: bold;
  font-size: 13px; text-shadow: 1px 1px #0a246a; border-radius: 8px 8px 0 0; user-select: none; touch-action: none; cursor: default;
  background: linear-gradient(#0997ff 0, #0053ee 8%, #0050ee 40%, #06f 88%, #06f 93%, #005bff 95%, #003dd7 96%, #003dd7 100%);
}
.tbar svg.ico { width: 16px; height: 16px; flex: none; }
.tbar .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtn {
  width: 22px; height: 22px; border: 1px solid #fff; border-radius: 3px; color: #fff; font: bold 12px/1 Tahoma; padding: 0;
  background: radial-gradient(circle at 30% 25%, #6fa2ff, #2864e8 70%); cursor: pointer; display: grid; place-items: center;
}
.tbtn.x { background: radial-gradient(circle at 30% 25%, #f0a58c, #d9441d 70%); }
.tbtn:hover { filter: brightness(1.15); }
.wbody { padding: 10px; overflow: auto; flex: 1; min-height: 0; }
.wbody.flush { padding: 0; }

/* Boutons, champs */
button.btn, a.btn {
  min-width: 80px; padding: 4px 12px; font: inherit; color: #000; text-decoration: none; display: inline-block; text-align: center;
  border: 1px solid #003c74; border-radius: 3px; cursor: pointer;
  background: linear-gradient(#fff, #ece9d8 85%, #d6d0c0);
}
button.btn:hover, a.btn:hover { box-shadow: inset 0 0 0 2px #f9c552; }
button.btn:active, a.btn:active { background: linear-gradient(#cdcab8, #ece9d8); }
button.btn.default { box-shadow: inset 0 0 0 2px #7ab2f5; }
button.btn:disabled { color: #8a8a80; border-color: #aca899; box-shadow: none; cursor: default; }
input[type=text], select {
  font: inherit; padding: 3px 4px; border: 1px solid #7f9db9; background: #fff; border-radius: 0; min-width: 0;
}
input[type=checkbox] { accent-color: #2a6fd6; }
fieldset { border: 1px solid #d0d0bf; border-radius: 4px; margin: 0 0 10px; padding: 8px 10px; }
legend { color: #0046d5; padding: 0 4px; }
label { display: inline-flex; gap: 6px; align-items: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: #555; }
.right { text-align: right; }

/* Fenêtre principale type Explorateur */
.explorer { display: flex; min-height: 0; }
.pane {
  width: 190px; flex: none; padding: 12px 10px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #7ba2e7, #6375d6);
}
.pane .box { background: #d6dff7; border-radius: 6px; overflow: hidden; }
.pane .box h4 { margin: 0; padding: 5px 10px; font-size: 12px; color: #fff; background: linear-gradient(90deg, #0c3da4, #3a7cf0); border-radius: 6px 6px 0 0; }
.pane .box div { padding: 8px 10px; font-size: 12px; color: #1b2d6b; display: grid; gap: 4px; }
.pane .box a { color: #215dc6; cursor: pointer; text-decoration: none; }
.pane .box a:hover { text-decoration: underline; }
.pane .user { display: flex; gap: 8px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 4px; border: 2px solid #fff; background: #5b9fee; object-fit: cover; flex: none; }
.main { flex: 1; min-width: 0; padding: 12px; background: #fff; overflow: auto; }
.addr { display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: var(--face); border-bottom: 1px solid #aca899; font-size: 12px; }
.addr .field { flex: 1; background: #fff; border: 1px solid #7f9db9; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drop {
  border: 2px dashed #7f9db9; border-radius: 6px; padding: 22px 12px; text-align: center; background: #f4f8ff; cursor: pointer; margin-bottom: 10px;
}
.drop.over { background: #dbe9ff; border-color: #0a5fd8; }
.drop svg { width: 44px; height: 44px; }
.drop b { display: block; margin: 4px 0 2px; color: #0a3d9c; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
.listwrap { border: 1px solid #7f9db9; max-height: 240px; overflow: auto; background: #fff; }
table.list th { position: sticky; top: 0; text-align: left; font-weight: normal; padding: 3px 6px; background: linear-gradient(#fff, #ece9d8); border: 1px solid #d6d2c2; border-top: 0; border-left: 0; }
table.list td { padding: 3px 6px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.list tr:hover td { background: #e6efff; }
table.list td.act { text-align: right; width: 1%; }
table.list button { font: inherit; padding: 0 6px; border: 1px solid #7f9db9; background: #f4f8ff; border-radius: 3px; cursor: pointer; margin-left: 2px; }
table.list button:hover { background: #dbe9ff; }
.empty { padding: 16px; text-align: center; color: #666; }

/* Barre de progression XP (blocs verts) */
.pbar { height: 18px; border: 1px solid #686868; border-radius: 3px; padding: 2px; background: #fff; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #2fcb29 0 8px, transparent 8px 10px); transition: width .15s linear; }
.pbar.small { height: 14px; }
.pbar.warn i { background: repeating-linear-gradient(90deg, #e8b02a 0 8px, transparent 8px 10px); }
.pbar.bad i { background: repeating-linear-gradient(90deg, #d93a25 0 8px, transparent 8px 10px); }

/* Animation « copie de fichiers » : des feuilles volent d'un dossier à l'autre */
.fly { position: relative; height: 56px; margin-bottom: 8px; }
.fly svg { position: absolute; width: 44px; height: 44px; top: 6px; }
.fly .a { left: 4px; } .fly .b { right: 4px; }
.fly .paper { width: 20px; height: 24px; top: 16px; left: 52px; animation: fly 1.1s linear infinite; }
.fly .paper:nth-child(4) { animation-delay: .37s; } .fly .paper:nth-child(5) { animation-delay: .74s; }
@keyframes fly { from { left: 52px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { left: calc(100% - 76px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fly .paper { animation: none; opacity: 1; } }

/* Boîte de message */
.msg { display: flex; gap: 14px; align-items: flex-start; padding: 6px 4px 12px; }
.msg svg { width: 36px; height: 36px; flex: none; }
.msg p { margin: 0 0 6px; }
.btns { display: flex; justify-content: center; gap: 8px; padding-top: 4px; }
.linkbox { display: flex; gap: 6px; margin: 8px 0; }
.linkbox input { flex: 1; }
.big { font-size: 22px; font-variant-numeric: tabular-nums; color: #0a3d9c; font-weight: bold; }
dl.props { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 10px; }
dl.props dt { color: #555; } dl.props dd { margin: 0; word-break: break-all; }

/* Écran d'ouverture de session */
#welcome {
  position: absolute; inset: 0; display: grid; grid-template-rows: 70px 1fr 70px; color: #fff; z-index: 5;
  background: linear-gradient(#00309c, #5a7edc 3px, #5a7edc);
}
#welcome .top { background: linear-gradient(#00309c, #0a3dbd); border-bottom: 2px solid; border-image: linear-gradient(90deg, #00309c, #fff 50%, #00309c) 1; }
#welcome .bot { background: linear-gradient(#0a3dbd, #00309c); border-top: 2px solid; border-image: linear-gradient(90deg, #5a7edc, #f99736 50%, #5a7edc) 1; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; font-size: 12px; }
#welcome .mid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; background: radial-gradient(circle at 20% 50%, #7e9ee8, #5a7edc 60%); }
#welcome .brand { text-align: right; padding-right: 40px; border-right: 2px solid #ffffff80; }
#welcome .brand h1 { margin: 0; font: italic bold 44px "Trebuchet MS", Tahoma, sans-serif; text-shadow: 2px 2px #0a2a82; }
#welcome .brand h1 span { color: #f99736; }
#welcome .brand p { margin: 6px 0 0; font-size: 15px; }
#welcome .who { padding-left: 40px; }
.tile { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 8px; text-decoration: none; color: #fff; background: none; border: 0; font: inherit; cursor: pointer; width: 100%; max-width: 340px; text-align: left; }
.tile:hover { background: #ffffff30; }
.tile .face { width: 56px; height: 56px; border: 2px solid #fff; border-radius: 6px; background: linear-gradient(#7289da, #4752c4); display: grid; place-items: center; box-shadow: 0 0 6px #0006; }
.tile .face svg { width: 34px; height: 34px; }
.tile b { font-size: 20px; display: block; }
.tile small { font-size: 12px; }
#welcome .err { margin-top: 14px; max-width: 340px; background: #fff3c4; color: #000; border: 1px solid #aca36b; border-radius: 4px; padding: 8px 10px; font-size: 12px; }

/* Barre des tâches */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; display: flex; align-items: stretch; z-index: 20;
  background: linear-gradient(#3168d5 0, #4993e6 4%, #245edb 10%, #245edb 88%, #1941a5 95%, #1941a5 100%);
}
#start {
  display: flex; align-items: center; gap: 6px; padding: 0 22px 0 10px; border: 0; color: #fff; cursor: pointer; font: inherit;
  border-radius: 0 12px 12px 0; box-shadow: inset -2px 0 3px #0006, 2px 0 4px #0008;
  background: linear-gradient(#5aae4f 0, #3c9b3c 12%, #388e3c 80%, #2a7a2f 100%);
}
#start:hover { filter: brightness(1.1); }
#start i { font: italic bold 19px "Trebuchet MS", Tahoma, sans-serif; text-shadow: 1px 1px 2px #000a; }
.flag { width: 18px; height: 18px; background: conic-gradient(from 0deg at 50% 50%, #f35325 0 25%, #81bc06 0 50%, #05a6f0 0 75%, #ffba08 0); transform: skew(-4deg, -4deg) rotate(-8deg); border-radius: 3px; }
#tasks { flex: 1; display: flex; gap: 3px; padding: 2px 6px; overflow: hidden; }
.task {
  max-width: 170px; flex: 1; border: 1px solid #1a3d9c; border-radius: 3px; color: #fff; font: inherit; text-align: left; padding: 0 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(#4a8af0, #3a78e0);
}
.task.on { background: linear-gradient(#1e47b3, #2d5dd0); box-shadow: inset 1px 1px 3px #0008; }
#tray { display: flex; align-items: center; gap: 10px; padding: 0 12px; color: #fff; font-size: 12px; background: linear-gradient(#0f8ff0, #1290e8 10%, #0b77d6 90%, #0a5bb4); border-left: 1px solid #0b3f9a; box-shadow: inset 1px 0 #3ba7f5; }
#quotatray { font-variant-numeric: tabular-nums; }

/* Menu démarrer */
#startmenu { position: fixed; left: 0; bottom: 30px; width: 280px; z-index: 30; border: 2px solid #0831d9; border-radius: 8px 8px 0 0; background: #fff; box-shadow: 3px -2px 10px #0008; overflow: hidden; }
#startmenu .head { padding: 8px 10px; color: #fff; font-weight: bold; font-size: 15px; display: flex; gap: 8px; align-items: center; background: linear-gradient(#1868ce, #0f5bd0 40%, #1a6de0); }
#startmenu .head .avatar { width: 38px; height: 38px; }
#startmenu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 12px; border: 0; background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
#startmenu button:hover { background: #316ac5; color: #fff; }
#startmenu .foot { background: linear-gradient(#4282d6, #3a74c8); padding: 4px; display: flex; justify-content: flex-end; }
#startmenu .foot button { width: auto; background: none; color: #fff; padding: 4px 10px; }
#startmenu .foot button:hover { background: #ffffff30; }
#startmenu svg { width: 24px; height: 24px; flex: none; }

@media (max-width: 640px) {
  .win { left: 4px !important; right: 4px; width: auto !important; top: 8px !important; }
  .explorer { flex-direction: column; }
  .pane { width: auto; flex-direction: row; flex-wrap: wrap; padding: 8px; } .pane .box { flex: 1 1 140px; }
  #welcome .mid { grid-template-columns: 1fr; align-content: center; gap: 24px; }
  #welcome .brand { text-align: center; border: 0; padding: 0 16px; } #welcome .brand h1 { font-size: 34px; }
  #welcome .who { padding: 0 16px; display: grid; justify-items: center; }
  #icons { display: none; } #tray #quotatray { display: none; }
}
