/* ============ Vars ============ */
:root{
  --bg: #05081f;
  --bg-2: #0a0f2d;
  --card:#0f1b5a;
  --text:#e9eeff;
  --muted:#a7b8ff;
  --accent:#4da3ff;
  --accent2:#78f3ff;
  --good:#14f1c6;
  --warn:#ffd66b;
  --bad:#ff6b88;
  --ring: rgba(77,163,255,.55);
  --ring-strong: rgba(120,243,255,.75);
  --shadow: 0 0 18px rgba(72,160,255, .35), 0 0 44px rgba(72,160,255,.18);
  --glass: rgba(8,12,40,.55);
  --stroke: rgba(120, 160, 255, .25);
  --stroke-strong: rgba(120, 160, 255, .45);
}

/* ============ Base ============ */
*{ box-sizing: border-box; }
html,body{
  margin:0; padding:0;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, #14207a 0%, var(--bg) 55%);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;
}
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
h1,h2,h3{ margin:0 0 12px; line-height: 1.1; }
p{ margin:0 0 12px; }

/* ============ Ambient BG ============ */
.bg{ position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.orb{
  position: absolute; filter: blur(60px);
  border-radius: 50%;
  opacity:.75; mix-blend-mode: screen;
  transform: translateZ(0);
  animation: float 18s ease-in-out infinite alternate;
}
.orb-a{ width: 520px; height: 520px; left:-120px; top:-120px; background: radial-gradient(closest-side, #2046ff, transparent); }
.orb-b{ width: 620px; height: 620px; right:-160px; bottom:-160px; background: radial-gradient(closest-side, #06e3ff, transparent); animation-duration:22s; }
@keyframes float{
  to{ transform: translate3d(40px, 30px, 0) scale(1.04); }
}
.gridlines::before{
  content:""; position: absolute; inset:-200% -200% -200% -200%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.05), transparent 30%),
    linear-gradient(transparent 98%, rgba(120,160,255,.15) 100%),
    linear-gradient(90deg, transparent 98%, rgba(120,160,255,.15) 100%);
  background-size: 400px 400px, 60px 60px, 60px 60px;
  transform: rotate(2deg);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.7), transparent 70%);
}
.noise{
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' opacity='0.06'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'></feTurbulence></filter><rect width='100%' height='100%' filter='url(%23n)'></rect></svg>");
  pointer-events: none;
}

/* ============ Layout ============ */
.container{ max-width: 1200px; margin: 28px auto; padding: 0 16px; }
.glass{
  background: linear-gradient(180deg, rgba(20,33,105,.4), var(--glass));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px) saturate(120%);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ============ Nav ============ */
.nav{ position: sticky; top: 0; z-index: 10; margin: 0 0 16px; }
.nav-inner{
  display:flex; align-items:center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(90deg, rgba(7,16,58,.7), rgba(12,28,103,.6));
  border-radius: 0 0 16px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.brand{ display:flex; gap: 10px; align-items:center; }
.logo{ width: 34px; height: 34px; border-radius: 8px; object-fit: cover; box-shadow: 0 0 12px rgba(120,180,255,.45); }
.brand-text{ font-weight: 800; letter-spacing:.4px; font-size: 18px; text-transform: lowercase; }
.brand-text .sub{ font-weight: 700; color: var(--accent); opacity: .95; margin-left: 4px; }
.nav-actions{ display:flex; gap: 10px; }
.pill{
  padding: 8px 12px; border-radius: 999px; border:1px solid var(--stroke);
  background: rgba(10,22,72,.75);
  transition: box-shadow .25s, transform .2s;
}
.pill:hover{ transform: translateY(-1px); box-shadow: 0 8px 22px rgba(72,160,255,.3); }
.pill.neon{ box-shadow: 0 0 0 0 var(--ring) inset; }
.pill.outline{ background: transparent; }

/* ============ Sections & Cards ============ */
.card{ padding: 20px; margin-bottom: 20px; }
.section-title{ font-weight: 800; letter-spacing: .2px; margin-bottom: 12px; }

/* HERO */
.hero{
  display:grid; place-items:center; text-align:center;
  padding: 42px 24px; position: relative; overflow: hidden;
}
.title{ font-size: clamp(28px, 4vw, 44px); }
.subtitle{ color: var(--muted); margin-bottom: 16px; }

/* Buttons with sheen */
.btn{
  padding: 12px 18px;
  border-radius: 12px;
  border:1px solid var(--stroke-strong);
  cursor:pointer;
  background: linear-gradient(180deg, #0e2bc0, #0a168a);
  color: var(--text);
  transition: transform .2s, filter .35s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.btn-secondary{ background: linear-gradient(180deg, #0b5f7e, #09364b); border-color: rgba(120,255,255,.35); }
.btn:hover{ transform: translateY(-1px); box-shadow: 0 10px 26px rgba(72,160,255,.35), 0 0 12px rgba(72,160,255,.65) inset; }
.shiny::before{
  content:""; position:absolute; top:var(--y,50%); left:var(--x,50%);
  width: 0; height: 0; pointer-events:none; opacity:.85;
  box-shadow: 0 0 110px 28px rgba(255,255,255,.18);
  transform: translate(-50%, -50%);
}

/* Upload form */
.upload-form{
  display:grid; grid-template-columns: 1.2fr .8fr auto; gap: 14px; align-items: start;
}
@media (max-width: 1000px){ .upload-form{ grid-template-columns: 1fr; } }

.dropzone{
  grid-column: 1 / -1;
  display:flex; align-items:center; justify-content:center;
  min-height: 160px; border-radius: 16px; cursor:pointer;
  border: 1px dashed var(--stroke-strong);
  background: linear-gradient(180deg, rgba(15,27,90,.65), rgba(8,12,40,.75));
  position: relative;
}
.dropzone:hover{ box-shadow: 0 8px 26px rgba(72,160,255,.25), inset 0 0 22px rgba(120,180,255,.18); }
.dropzone input{ display:none; }
.dz-visual{ display:flex; gap:16px; align-items:center; text-align:left; }
.dz-icon{
  width: 46px; height: 46px; display:grid; place-items:center;
  border-radius: 12px; background: rgba(120,160,255,.18);
  border:1px solid var(--stroke-strong);
  text-shadow: 0 0 12px rgba(120,180,255,.7);
}
.dz-text .file-cta{ display:block; font-weight: 800; }
.selected-name{ margin-top: 4px; font-size: 13px; color: var(--accent2); opacity:.9; }

/* Select */
.select-label{ display:grid; gap:8px; }
.glow-select{
  appearance: none;
  padding: 12px 14px; border-radius: 12px;
  border:1px solid var(--stroke-strong);
  background: #0a1648 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' width='12' height='12' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 12px center/12px;
  color: var(--text); box-shadow: inset 0 0 10px rgba(100,150,255,.15);
}

/* Player */
.player{
  width:100%; max-height: 520px; border-radius: 16px; border:1px solid var(--stroke);
  background:#000; box-shadow: var(--shadow);
}
.neon-border{ box-shadow: 0 0 0 1px var(--stroke) inset, 0 0 18px rgba(77,163,255,.35), 0 0 48px rgba(77,163,255,.2); }

/* Grid outputs */
.grid.two{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px){ .grid.two{ grid-template-columns: 1fr; } }

.kv{ display:flex; gap:10px; margin:10px 0; align-items: center; }
.k{ width: 190px; color: var(--muted); }
.v{ flex:1; }
.v-col{ display:grid; gap:8px; }

/* Chips for action top-2 */
.chip{
  display:inline-flex; gap:8px; align-items:center; margin:0 8px 8px 0;
  padding:8px 12px; border-radius: 12px;
  border:1px solid var(--stroke-strong); background: rgba(120,160,255,.08);
}
.chip-key{ font-weight: 700; }
.chip-val{ opacity:.9; }

/* Meters for severity */
.meter{ display:grid; grid-template-columns: 120px 1fr 60px; gap:8px; align-items:center; }
.meter .label{ color: var(--muted); }
.meter .bar{
  height:10px; border-radius:999px; background: rgba(255,255,255,.08); overflow:hidden; border:1px solid var(--stroke);
}
.meter .bar i{
  display:block; height:100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 14px rgba(120,243,255,.6);
}

/* Decision + badges */
.badge{
  display:inline-block; padding:8px 12px; border-radius: 12px; margin-left:6px;
  border:1px solid rgba(255,255,255,.25);
}
.badge-glow{
  background: linear-gradient(180deg, #1630ad, #0d236b); color: #dff0ff;
  box-shadow: 0 0 16px rgba(110,180,255,.55), inset 0 0 10px rgba(110,180,255,.35);
}
.badge.soft{
  background: rgba(120,160,255,.12);
  border-color: var(--stroke-strong);
}

/* Notes */
.notes{ margin-top:12px; }
.notes-title{ color: var(--muted); margin-bottom:8px; }
.list{ padding-left: 18px; margin:0; }

/* Snapshot */
.snapshot{ width:100%; border-radius: 16px; border:1px solid var(--stroke); box-shadow: var(--shadow); margin-top:10px; }

/* Errors */
.error{
  margin-top:12px; padding:10px 12px; border-radius:10px;
  background: rgba(255, 80, 80, .1);
  border: 1px solid rgba(255, 120, 120, .4); color: #ffdcdc;
}

/* Footer */
.footer{
  text-align:center; padding: 16px; color: var(--muted); margin-top: 24px;
}
.footer.glass-line{ border-top: 1px solid var(--stroke); }

/* Helpful utilities */
.glow-text{ text-shadow: 0 0 12px rgba(120,180,255,.6); }
.hidden{ display:none !important; }
