/* R2D2 web — strony logowania i kont oraz dodatki do HUD-a w przeglądarce. Ten sam świat co src/styles.css:
   cyjanowy wireframe na głębokiej czerni, bursztyn jako akcent, dane w monospace. */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #05080c; --bg-deep: #03050a;
  --cyan: hsl(189 92% 62%); --cyan-soft: hsl(189 70% 72% / .78); --cyan-dim: hsl(195 45% 60% / .5);
  --cyan-line: hsl(189 90% 60% / .3); --cyan-glow: hsl(189 100% 62% / .5);
  --amber: hsl(42 100% 60%); --warn: hsl(8 92% 62%); --ok: hsl(150 70% 55%);
  --font-d: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------------- strony poza HUD-em ---------------- */
body.web-page {
  margin: 0; min-height: 100vh; color: var(--cyan-soft); font-family: var(--font-m); font-size: 14px;
  background: radial-gradient(120% 90% at 50% -10%, #0b1724 0%, var(--bg) 50%, var(--bg-deep) 100%);
}
body.web-page::before {             /* delikatna siatka przyrządu */
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--cyan-line) 1px, transparent 1px), linear-gradient(90deg, var(--cyan-line) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 80%);
}
.web-page * { box-sizing: border-box; }

.gate { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.gate-card {
  position: relative; width: min(420px, 100%); padding: 36px 32px 28px;
  border: 1px solid var(--cyan-line); background: hsl(205 60% 6% / .82); backdrop-filter: blur(6px);
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.gate-card::after {                 /* narożnik przyrządu */
  content: ''; position: absolute; top: 0; left: 0; width: 46px; height: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow);
}
.mark { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.mark b { font-family: var(--font-d); font-weight: 700; font-size: 44px; letter-spacing: .08em; color: var(--cyan); text-shadow: 0 0 18px var(--cyan-glow); line-height: 1; }
.mark span { font-size: 11px; letter-spacing: .24em; color: var(--cyan-dim); text-transform: uppercase; }
.lede { margin: 0 0 26px; font-size: 12.5px; line-height: 1.6; color: var(--cyan-dim); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 7px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan-dim); }
.field input, .field select {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 15px; color: #e6fbff; background: hsl(205 70% 4% / .9);
  border: 1px solid var(--cyan-line); border-radius: 0; outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px hsl(189 90% 60% / .14); }
.field small { display: block; margin-top: 6px; font-size: 11px; color: var(--cyan-dim); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; min-height: 42px;
  font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--bg); background: var(--cyan); border: 1px solid var(--cyan); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.btn:hover { box-shadow: 0 0 18px var(--cyan-glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--cyan); }
.btn.ghost:hover { background: hsl(189 90% 60% / .1); }
.btn.danger { background: transparent; color: var(--warn); border-color: hsl(8 92% 62% / .55); }
.btn.danger:hover { background: hsl(8 92% 62% / .12); box-shadow: none; }
.btn.small { min-height: 32px; padding: 6px 12px; font-size: 12.5px; letter-spacing: .12em; }
.btn.wide { width: 100%; }

.msg { min-height: 20px; margin: 4px 0 14px; font-size: 12.5px; line-height: 1.5; }
.msg.err { color: var(--warn); }
.msg.ok { color: var(--ok); }
.foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--cyan-line); font-size: 11px; line-height: 1.6; color: var(--cyan-dim); }

/* ---------------- panel kont ---------------- */
.admin { position: relative; max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.admin-top .mark b { font-size: 34px; }
.admin-top nav { display: flex; gap: 10px; flex-wrap: wrap; }
.admin h2 { margin: 34px 0 12px; font-family: var(--font-d); font-weight: 700; font-size: 15px; letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); }
.admin h2 small { margin-left: 10px; font-family: var(--font-m); font-weight: 400; font-size: 11px; letter-spacing: .08em; color: var(--cyan-dim); text-transform: none; }

.users { width: 100%; border-collapse: collapse; }
.users th { padding: 9px 10px; text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan-dim); border-bottom: 1px solid var(--cyan-line); }
.users td { padding: 12px 10px; vertical-align: middle; border-bottom: 1px solid hsl(189 90% 60% / .12); }
.users tr.off td { opacity: .5; }
.users .who b { display: block; font-family: var(--font-d); font-weight: 700; font-size: 17px; letter-spacing: .04em; color: #e6fbff; }
.users .who span { font-size: 11.5px; color: var(--cyan-dim); }
.users .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.users .acts { text-align: right; white-space: nowrap; }
.users .acts .btn + .btn { margin-left: 6px; }
.tag { display: inline-block; padding: 2px 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; border: 1px solid var(--cyan-line); color: var(--cyan-soft); }
.tag.admin { color: var(--amber); border-color: hsl(42 100% 60% / .5); }
.tag.off { color: var(--warn); border-color: hsl(8 92% 62% / .5); }

.perm { display: inline-flex; align-items: center; gap: 7px; margin: 2px 12px 2px 0; font-size: 12px; cursor: pointer; user-select: none; white-space: nowrap; }
.perm input { appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--cyan-dim); background: transparent; cursor: pointer; position: relative; }
.perm input:checked { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); }
.perm input:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.perm input:disabled { opacity: .5; cursor: default; }
.limit { width: 76px; padding: 6px 8px; font: inherit; color: #e6fbff; background: hsl(205 70% 4% / .9); border: 1px solid var(--cyan-line); }

.new-user { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; align-items: end; padding: 20px; border: 1px solid var(--cyan-line); background: hsl(205 60% 6% / .6); }
.new-user .wide2 { grid-column: span 2; }
.new-user .perms { grid-column: span 3; padding-bottom: 12px; }
.new-user .field { margin: 0; }

.audit { margin: 0; padding: 0; list-style: none; font-size: 12px; max-height: 340px; overflow: auto; border: 1px solid hsl(189 90% 60% / .14); }
.audit li { display: grid; grid-template-columns: 150px 120px 140px 1fr; gap: 10px; padding: 7px 12px; border-bottom: 1px solid hsl(189 90% 60% / .08); }
.audit li:nth-child(odd) { background: hsl(205 60% 8% / .4); }
.audit .t { color: var(--cyan-dim); font-variant-numeric: tabular-nums; }
.audit .w.login-fail, .audit .w.login-locked { color: var(--warn); }

.dialog { position: fixed; inset: 0; display: none; place-items: center; background: hsl(210 60% 2% / .72); z-index: 20; padding: 16px; }
.dialog.open { display: grid; }
.dialog .gate-card { width: min(440px, 100%); }
.dialog h3 { margin: 0 0 14px; font-family: var(--font-d); font-weight: 700; font-size: 20px; letter-spacing: .1em; color: var(--cyan); }
.dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

@media (max-width: 820px) {
  .new-user { grid-template-columns: 1fr 1fr; }
  .new-user .perms, .new-user .wide2 { grid-column: span 2; }
  .users thead { display: none; }
  .users, .users tbody, .users tr, .users td { display: block; width: 100%; }
  .users tr { padding: 10px 0; border-bottom: 1px solid var(--cyan-line); }
  .users td { border: 0; padding: 6px 4px; }
  .users .acts { text-align: left; }
  .audit li { grid-template-columns: 1fr 1fr; }
}

/* ---------------- dodatki w HUD-zie (przeglądarka) ---------------- */
/* na razie bez: tętna (Bluetooth), skanera (radar), rdzenia 3D i przełącznika płci w karcie anatomii */
.module.heart, .module.radar, .module.holo, .an-sex { display: none !important; }

.web-user {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px;
  font-family: var(--font-m); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan-dim);
  border: 1px solid var(--cyan-line); background: hsl(205 60% 5% / .7); backdrop-filter: blur(4px);
}
.web-user b { color: var(--cyan-soft); font-weight: 500; letter-spacing: .1em; }
.web-user a, .web-user button {
  font: inherit; color: var(--cyan); background: transparent; border: 1px solid var(--cyan-line); padding: 4px 9px; cursor: pointer; text-decoration: none;
}
.web-user a:hover, .web-user button:hover { background: hsl(189 90% 60% / .12); }
.web-start {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: hsl(210 60% 2% / .78); backdrop-filter: blur(3px);
}
.web-start .gate-card { text-align: left; }
.web-start ul { margin: 0 0 20px; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: var(--cyan-soft); }
