/* Core App Aid — Vault UI Theme
   Shared across all member-facing pages
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Space+Mono:wght@400;700&family=Unbounded:wght@400;600;800;900&display=swap');

/* ---- DESIGN TOKENS ---- */
:root {
  --bg-0:    #05060a;
  --bg-1:    #0a0d16;
  --bg-2:    #111624;
  --bg-3:    #1a2035;
  --ink:     #e8ecf7;
  --ink-dim: #7a839a;
  --ink-mut: #474f66;
  --line:    #1d2540;
  --line-h:  #2a3666;

  --acid:    #c6ff00;
  --acid-g:  rgba(198,255,0,.2);
  --plasma:  #ff2d7a;
  --cyan:    #00f0ff;
  --gold:    #ffb547;
  --violet:  #7b5cff;
  --teal:    #00d4aa;

  --r-rare:      #6aa3ff;
  --r-epic:      #b284ff;
  --r-legendary: #ffd24a;

  --font-ui:   'Space Mono', ui-monospace, monospace;
  --font-head: 'Unbounded', sans-serif;
  --font-px:   'VT323', monospace;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-0); color: var(--ink); font-family: var(--font-ui); }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 90% -10%, #1a0f3a 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 20%, #001a1f 0%, transparent 55%),
    radial-gradient(600px 400px at 50% 110%, #1a2800 0%, transparent 55%),
    var(--bg-0);
}

/* Ambient grid */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
  opacity: .25;
}

/* Noise grain */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  opacity: .07; mix-blend-mode: overlay;
}

/* ---- LAYOUT ---- */
.page-wrap {
  position: relative; z-index: 3;
  max-width: 520px; margin: 0 auto;
  padding: 20px 18px 110px;
}

/* ---- CLIP CORNERS ---- */
.clip-tl  { clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.clip-tr  { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.clip-br  { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.clip-all { clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }

/* ---- SURFACE PANELS ---- */
.panel {
  border: 1px solid var(--line-h);
  background: linear-gradient(180deg, #0b0f1c, #07091a);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.panel-acid { border-color: var(--acid); }
.panel-warn { border-color: var(--gold); }
.panel-danger { border-color: var(--plasma); }

/* ---- SECTION TITLE ---- */
.sec-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 14px;
}
.sec-title {
  font-family: var(--font-head); font-weight: 800;
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
}
.sec-title em { color: var(--acid); font-style: normal; }
.sec-count { font-size: 10px; letter-spacing: .25em; color: var(--ink-dim); text-transform: uppercase; }

/* ---- LABEL / VALUE ---- */
.lv-key { font-size: 9px; letter-spacing: .3em; color: var(--ink-dim); text-transform: uppercase; }
.lv-val { font-size: 13px; margin-top: 2px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block; text-align: center; cursor: pointer;
  font-family: var(--font-head); font-weight: 700;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  padding: 13px 20px; border: 1px solid var(--line-h);
  background: transparent; color: var(--ink);
  text-decoration: none; transition: all .15s;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.btn:hover { border-color: var(--acid); color: var(--acid); }
.btn-primary { background: var(--acid); color: #000; border-color: var(--acid); }
.btn-primary:hover { background: #d9ff3d; }
.btn-danger  { background: var(--plasma); color: #fff; border-color: var(--plasma); }
.btn-full    { display: block; width: 100%; }
.btn-sm      { font-size: 9px; padding: 8px 14px; }

/* ---- FORM ELEMENTS ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 9.5px; letter-spacing: .3em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-h);
  color: var(--ink); font-family: var(--font-ui); font-size: 13px;
  padding: 11px 14px; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acid); }
.field select option { background: var(--bg-2); }

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-block; font-size: 8.5px; letter-spacing: .28em;
  text-transform: uppercase; font-weight: 700; padding: 3px 9px;
}
.badge-active   { background: rgba(0,212,170,.15); color: var(--teal); border: 1px solid var(--teal); }
.badge-pending  { background: rgba(255,181,71,.1); color: var(--gold); border: 1px solid var(--gold); }
.badge-expired  { background: rgba(255,45,122,.1); color: var(--plasma); border: 1px solid var(--plasma); }
.badge-expiring { background: rgba(255,181,71,.2); color: var(--gold); border: 1px solid var(--gold); }
.badge-rejected { background: rgba(255,45,122,.1); color: var(--plasma); border: 1px solid var(--plasma); }

/* ---- XP BAR ---- */
.xp-bar { height: 8px; background: var(--bg-2); border: 1px solid var(--line-h); overflow: hidden; }
.xp-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--acid) 0 6px, #9ecc00 6px 10px);
  box-shadow: 0 0 12px rgba(198,255,0,.4);
  transition: width .6s ease;
}

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: rgba(5,6,10,.95); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-h);
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 520px; margin: 0 auto;
}
.bottom-nav a {
  text-align: center; padding: 12px 0 16px;
  text-decoration: none; color: var(--ink-dim);
  font-size: 8.5px; letter-spacing: .22em; text-transform: uppercase; font-weight: 700;
  border-right: 1px solid var(--line); transition: color .15s;
  position: relative;
}
.bottom-nav a:last-child { border-right: none; }
.bottom-nav a.active { color: var(--acid); }
.bottom-nav a.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--acid); box-shadow: 0 0 10px var(--acid);
}
.bottom-nav a .nav-ico {
  display: block; font-size: 16px; margin-bottom: 3px;
  font-family: var(--font-head);
}

/* ---- TOAST NOTIFICATION ---- */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(30px);
  background: var(--bg-2); border: 1px solid var(--acid);
  padding: 10px 20px; font-size: 11px; letter-spacing: .15em;
  color: var(--acid); z-index: 100; white-space: nowrap;
  opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- SCAN LINE ANIM ---- */
.scan-line {
  position: fixed; left: 0; right: 0; height: 2px;
  background: var(--acid); box-shadow: 0 0 20px var(--acid);
  z-index: 50; display: none;
}
.scan-line.on { display: block; animation: scanMove 1.2s ease-in-out forwards; }
@keyframes scanMove {
  0%   { top: 0;    opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---- FLASH SUCCESS ---- */
.flash-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(0,212,170,.25), rgba(0,0,0,.9));
  backdrop-filter: blur(12px);
}
.flash-overlay.on { display: flex; animation: flashFadeIn .4s ease; }
@keyframes flashFadeIn { from { opacity: 0; } }

/* ---- ANIMATIONS ---- */
@keyframes pulse { 50% { opacity: .3; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes scanH {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 0; }
}

.pulse { animation: pulse 1.6s ease-in-out infinite; }
.blink { animation: blink 1s step-end infinite; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--line-h); }
