:root{
  --accent:#0078D7; --accent-2:#005A9E;
  --text:#F3F6FB; --muted:#C8D1E6; --hint:#A9CBFF; --danger:#FF6B6B;
  --panel:#101826a6; --panel-solid:#101826d0; --border:#22304e;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--text);
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  /* Hintergrundbild kommt aus dem HTML (inline) */
  overflow:hidden;
}

/* Uhr/Datum oben links */
.clock{position:fixed; top:8vh; left:7vw; user-select:none; text-shadow:0 6px 30px rgba(0,0,0,.6)}
.clock .time{font-size:64px; line-height:1; font-weight:300}
.clock .date{margin-top:6px; font-size:20px; color:var(--muted)}

.center{position:fixed; inset:0; display:grid; place-items:center; padding:20px}
.username{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:22px;font-weight:600;text-shadow:0 2px 14px rgba(0,0,0,.45)}
.field{position:relative;width:100%;margin-top:6px}
.err{color:var(--danger);font-weight:600;margin-top:6px;width:100%;text-align:left}

/* =======================
   COOL (Win-Login-Style)
   ======================= */
.login{display:flex; flex-direction:column; align-items:center; gap:12px; background:transparent; border:none; box-shadow:none; min-width:min(420px,92vw)}
.avatar{width:96px;height:96px;border-radius:50%;background:rgba(255,255,255,.12);display:grid;place-items:center;overflow:hidden;border:2px solid rgba(255,255,255,.35)}
.avatar svg{width:68%;height:68%;opacity:.95}

input[type=password]{width:100%;background:transparent;color:#fff;font-size:18px;padding:10px 56px 10px 0;border:none;border-bottom:1px solid rgba(255,255,255,.65);outline:none}
input[type=password]::placeholder{color:rgba(255,255,255,.75)}
input[type=password]:focus{border-bottom-color:var(--accent); box-shadow:0 6px 0 -5px var(--accent)}
.toggle{display:none}
.submit{position:absolute;right:0;top:50%;transform:translateY(-50%);width:42px;height:42px;border-radius:50%;background:var(--accent);border:0;color:#fff;font-weight:700;cursor:pointer;display:grid;place-items:center}
.submit:hover{background:var(--accent-2)}

/* =======================
   CLASSIC (Glass-Card)
   ======================= */
body.style-classic .login{
  display:flex;flex-direction:column;align-items:center;gap:12px;
  padding:26px 26px 20px;background:var(--panel);
  border:1px solid var(--border);border-radius:16px;backdrop-filter:blur(12px);
  min-width:min(460px,92vw);box-shadow:0 30px 100px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05)
}
body.style-classic .avatar{
  width:104px;height:104px;border-radius:50%;background:rgba(255,255,255,.08);
  display:grid;place-items:center;overflow:hidden;border:3px solid rgba(255,255,255,.25)
}
body.style-classic .avatar svg{width:70%;height:70%;opacity:.95;filter:drop-shadow(0 2px 10px rgba(0,0,0,.65))}
body.style-classic input[type=password]{
  width:100%;padding:12px 84px 12px 12px;border-radius:10px;background:#0B1326;border:1px solid #24385F;color:#fff;outline:none;font-size:16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.05)
}
body.style-classic input[type=password]:focus{border-color:var(--accent); box-shadow:0 0 0 3px rgba(0,120,215,.35)}
body.style-classic .toggle{position:absolute; right:44px; top:50%; transform:translateY(-50%); background:transparent; border:0; color:#d9e4ff; cursor:pointer; padding:6px; border-radius:8px}
body.style-classic .submit{
  position:absolute;right:6px;top:50%;transform:translateY(-50%);
  background:linear-gradient(180deg,var(--accent) 0%,var(--accent-2) 100%); border:1px solid #1E3D7C;
  color:#fff;font-weight:700;cursor:pointer;padding:8px 12px;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.35)
}

/* Options-Link + Menü */
.options{margin-top:10px;width:100%;display:flex;justify-content:center;align-items:center;font-size:14px;color:var(--muted);position:relative}
.link{color:var(--hint);text-decoration:none;cursor:pointer;padding:6px 10px;border-radius:8px}
.link:hover{background:rgba(255,255,255,.08)}
.optmenu{position:absolute;top:38px;min-width:220px;background:rgba(12,20,35,.9);border:1px solid rgba(255,255,255,.12);backdrop-filter:blur(10px);border-radius:10px;display:none;padding:8px;z-index:5}
.optmenu a{display:flex;justify-content:space-between;gap:10px;color:#e8f0ff;text-decoration:none;padding:8px;border-radius:8px}
.optmenu a:hover{background:rgba(255,255,255,.08)}
.optmenu .tag{opacity:.7;font-size:12px}

/* Sysbuttons unten rechts */
.sysbar{position:fixed; bottom:16px; right:16px; display:flex; gap:10px; filter:drop-shadow(0 2px 10px rgba(0,0,0,.6))}
.sysbtn{width:40px;height:40px;border-radius:10px;display:grid;place-items:center;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.12);color:#E8F0FF;cursor:pointer;backdrop-filter:blur(10px)}
.sysbtn:hover{background:rgba(0,0,0,.5)}

/* =======================
   Update / Crash / BIOS
   ======================= */
.update-overlay{position:fixed; inset:0; display:none; place-items:center; z-index:9999; color:#fff; background:#0B2E66}
.update-wrap{text-align:center; width:min(720px, 92vw); padding:32px 20px}
.spinner{position:relative; width:72px; height:72px; margin:0 auto 22px}
.spinner i{position:absolute; left:50%; top:50%; width:10px; height:10px; margin:-5px 0 0 -5px; background:#fff; border-radius:50%; transform-origin:26px 0; animation:spinDot 1.2s linear infinite; opacity:.85}
.spinner i:nth-child(1){transform:rotate(0deg) translate(26px);   animation-delay:-1.0s}
.spinner i:nth-child(2){transform:rotate(72deg) translate(26px);  animation-delay:-0.8s}
.spinner i:nth-child(3){transform:rotate(144deg) translate(26px); animation-delay:-0.6s}
.spinner i:nth-child(4){transform:rotate(216deg) translate(26px); animation-delay:-0.4s}
.spinner i:nth-child(5){transform:rotate(288deg) translate(26px); animation-delay:-0.2s}
@keyframes spinDot{0%{transform:rotate(0deg) translate(26px);opacity:.35}50%{opacity:1}100%{transform:rotate(360deg) translate(26px);opacity:.35}}

.u-pct{font-size:42px; font-weight:300; margin-bottom:8px}
.u-line1{font-size:20px; margin-bottom:4px}
.u-line2{font-size:16px; color:#CFE1FF; margin-bottom:18px}
.u-funny{font-size:14px; color:#BBD0FF; min-height:20px}

.crash-overlay{
  position:fixed; inset:0; display:none;    /* wichtig: ausblenden bis JS zeigt */
  place-items:center; z-index:10000;
  background:#0C2E5C; color:#fff; text-align:center; padding:24px
}
.crash-box{max-width:760px; margin:0 auto}
.crash-emoji{font-size:56px;margin-bottom:12px;opacity:.95}
.crash-title{font-size:28px;font-weight:600;margin-bottom:8px}
.crash-sub{font-size:16px;color:#CFE1FF;margin-bottom:22px}
.crash-btn{padding:10px 16px;border-radius:6px;border:0;cursor:pointer;background:#E81123;color:#fff;font-weight:700}
.crash-small{opacity:.8;margin-top:10px;font-size:12px}

.bios-overlay{
  position:fixed; inset:0; display:none;    /* wichtig: ausblenden bis JS zeigt */
  z-index:10001; background:#000; color:#0f0;
  font-family:ui-monospace,Consolas,Menlo,monospace; padding:24px; line-height:1.4
}
.bios-line{white-space:pre;opacity:.92}
.bios-dim{color:#0a0}
.bios-cursor{display:inline-block;width:8px;height:16px;background:#0f0;animation:blink 1s steps(1,end) infinite}
@keyframes blink { 50% { opacity:0; } }

/* Responsive Tweaks */
@media (max-width:520px){
  .clock .time{font-size:44px}
  .clock .date{font-size:16px}
}

/* === Classic simple card === */
.classic-body {
  margin:0;
  display:grid;
  place-items:center;
  min-height:100vh;
  background:#0b0f1a;
  color:#e6e7ee;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.card {
  width:min(420px,92vw);
  background:#171a2b;
  border:1px solid #2b2f46;
  border-radius:16px;
  padding:22px 20px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}

.card h1 {margin:0 0 6px;font-size:20px;font-weight:700}
.card p {margin:0 0 12px;color:#9aa0b5}

label{display:block;margin:10px 0 6px;color:#9aa0b5}
.err{color:#ff6b6b;margin-top:8px}

.card input[type=password]{
  width:100%;
  padding:12px;
  border-radius:10px;
  background:#0f1222;
  border:1px solid #2b2f46;
  color:#e6e7ee
}

.btn{
  margin-top:12px;
  padding:12px 14px;
  border-radius:10px;
  background:#3a75cc;
  color:#fff;
  border:1px solid #2b2f46;
  cursor:pointer;
  font-weight:600
}

.opts{margin-top:10px;text-align:center;font-size:14px}
.opts a{color:#9fb7e7;text-decoration:none}
.opts a:hover{text-decoration:underline}

/* ===== Classic: CMD-Window ===== */
.classic-term-body{
  margin:0; background:#0b0f1a; color:#e6e7ee; min-height:100vh;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.noselect{ user-select:none; }

.term-window{
  position:fixed;                     /* statt absolute */
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(860px,96vw);
  height:min(520px,78vh);
  background:#0d0d0d;
  border:1px solid #222;
  border-radius:8px;
  box-shadow:0 20px 80px rgba(0,0,0,.6);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  z-index:5;

  /* Sofort mittig (ohne JS) */
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) !important; /* initial mittig */
}

.term-window.is-dragging{
  transform:none !important;          /* wichtig: hebt translate auf */
  cursor:default;
}

.term-titlebar{
  height:36px; display:flex; align-items:center; justify-content:space-between;
  background:linear-gradient(180deg,#1c1c1c,#151515);
  border-bottom:1px solid #202020; padding:0 8px;
  cursor:move;
}
.term-title{
  font-size:13px; color:#cfd6e6; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.term-title .term-sub{ color:#8ea2c8; margin-left:8px; font-weight:500; opacity:.85; }

.term-controls{ display:flex; gap:6px; }
.ctrl{
  width:28px; height:22px; border:1px solid #2a2a2a; border-radius:4px;
  background:#1a1a1a; color:#d7e3ff; cursor:pointer; line-height:18px; padding:0;
}
.ctrl:hover{ background:#242424; }
.ctrl-close{ color:#fff; border-color:#542; }
.ctrl-close:hover{ background:#8b1d1d; }

.term-body{
  flex:1; background:#000; color:#d7e3ff; font-family:ui-monospace,Consolas,Menlo,monospace;
  font-size:14px; line-height:1.45; padding:12px 14px; overflow:auto;
}
.term-line{ white-space:pre-wrap; }
.term-line.dim{ color:#91a3c3; opacity:.8; }
.term-line.error{ color:#ff6b6b; }
.term-line.hint{ color:#8da9ff; }
.term-link{ color:#9fb7ff; text-decoration:none; border-bottom:1px dotted #9fb7ff; }
.term-link:hover{ text-decoration:underline; }

.prompt{ color:#7dff7d; }  /* grüner Prompt */
.hl{ color:#c5ddff; }

/* Inline-Form wie in einer Shell */
.term-form{ display:inline; }
.term-form .prompt{ user-select:none; }
.term-form input[type=password]{
  border:0; outline:none; background:transparent; color:#d7e3ff;
  font:inherit; padding:0; margin:0; min-width:240px;
}
/* Caret wie Block-Cursor */
.term-form input[type=password]::selection{ background:#2a55ff; color:#fff; }

.brand-m{ color:var(--accent); font-weight:700; }
.brand{ white-space:nowrap; }

/* ===== Netzwerk-Ring am Sysbar-Button ===== */
.sysbtn.netbtn { position: relative; border: none; background: transparent; }
.ring {
  border-radius: 10px;
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(255,255,255,.08) inset;
  transition: outline-color .18s ease, box-shadow .18s ease, filter .12s ease;
}
.ring-on {
  outline-color: var(--ok, #2ecc71);
  box-shadow: 0 0 0 2px var(--ok, #2ecc71) inset, 0 0 12px rgba(46,204,113,.35);
}
.ring-off {
  outline-color: var(--danger, #e74c3c);
  box-shadow: 0 0 0 2px var(--danger, #e74c3c) inset, 0 0 12px rgba(231,76,60,.28);
}

/* ===== kleines Netz-Popup ===== */
.net-pop{
  position: fixed;
  left: 14px; bottom: 56px;   /* erscheint über der Sysbar links */
  min-width: 220px;
  background: var(--bg-nav, #161624);
  color: var(--text, #E0E0E0);
  border: 1px solid var(--border, #2B2B3F);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  z-index: 80;
}
.net-pop .np-title{ font-weight: 700; margin-bottom: 6px; }
.net-pop .np-row{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06);
}
.net-pop .np-row:first-of-type{ border-top: 0; padding-top: 0; }
.net-pop .np-hint{ color: var(--text-2, #A0A0A0); font-size: .85rem; margin-top: 6px; }

/* Terminal-Footer unten fix im sichtbaren Bereich der term-body */
.term-body{
  display:flex;               /* Flex-Layout */
  flex-direction:column;
  overflow:auto;              /* bleibt scrollable */
}

.term-foot{
  position: sticky;           /* bleibt unten sichtbar */
  bottom: 0;
  background:#000;            /* Terminal-Hintergrund */
  border-top:1px solid #202020;
  padding-top:8px;
  /* leichter Fade für Lesbarkeit */
  box-shadow: 0 -12px 24px rgba(0,0,0,.35);
}

/* dichterer Zeilenabstand im Footer */
.term-foot .term-line{ margin:0; }
.term-foot .term-line + .term-line { margin-top:4px; }
