/* Fonts */
:root{
  --bg: #0d0f17;
  --fg: #ffffff;
  --muted: #b9c2d0;
  --primary: #7a5cff;
  --primary-2: #d63384;
  --glass-bg: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.25);
  --success: #00d68f;
  --warning: #ffc107;
  --danger: #ff615a;
  --shadow: 0 20px 50px rgba(0,0,0,0.45);
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin:0;
  font-family: 'Jost', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg);
  background: radial-gradient(1200px 800px at 10% 10%, #162033 0%, #0d0f17 60%, #090b12 100%);
  overflow-x: hidden;
}

/* Background video */
#bgVideo{
  position: fixed;
  top:50%; left:50%;
  min-width:100%; min-height:100%;
  width:auto; height:auto;
  transform: translate(-50%,-50%);
  z-index:-3;
  opacity: 0.25;
  object-fit: cover;
}

/* Particles */
#particles{
  position: fixed;
  inset:0;
  z-index:-2;
}

/* Dark overlay */
.overlay{
  position: fixed; inset:0;
  background: radial-gradient(1000px 700px at 80% 10%, rgba(122,92,255,0.2), transparent 40%),
              radial-gradient(900px 600px at 10% 80%, rgba(214,51,132,0.15), transparent 45%);
  pointer-events: none;
  z-index:-1;
}

/* Top bar */
.topbar{
  position: sticky; top:0;
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), transparent);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.brand{
  display:flex; align-items:center; gap:12px;
  font-weight:700; letter-spacing: .3px;
}
.brand img{ height:32px; width:auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5)); }
.brand span{ font-family: 'Roboto Slab', serif; }
nav{ display:flex; align-items:center; gap:16px; }
.link{
  color: var(--muted); text-decoration:none; font-weight:500;
}
.link:hover{ color:#fff; }
.link.muted{ opacity: .8; }

/* Buttons */
.btn{
  appearance:none; border:1px solid transparent; border-radius: 16px;
  padding: 10px 16px; cursor:pointer; color:#fff; background:#2b2f3d;
  transition: .2s transform, .2s box-shadow, .2s background;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active{ transform: translateY(0); }
.btn-lg{ padding: 14px 22px; font-size:1.05rem; border-radius:18px; }
.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 1px solid rgba(255,255,255,.15);
}
.glow{
  box-shadow: 0 8px 22px rgba(122,92,255,.4), 0 6px 14px rgba(214,51,132,.35);
}
.pulse{ animation: pulse 1.8s infinite; }
@keyframes pulse{
  0%,100%{ filter: drop-shadow(0 0 0 rgba(122,92,255,.6)); }
  50%{ filter: drop-shadow(0 0 12px rgba(122,92,255,.9)); }
}
.arrow{ display:inline-block; transform: translateX(0); transition: .2s; }
.btn:hover .arrow{ transform: translateX(4px); }

/* Glass cards */
.glass{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.card-xl{ max-width: 1200px; margin-inline:auto; padding: 32px 28px; }
.card-md{ max-width: 1200px; margin-inline:auto; padding: 24px 22px; }

.mt-4{ margin-top: 24px; }
.mt-6{ margin-top: 48px; }

/* Landing hero */
.hero{
  min-height: calc(100vh - 72px);
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 24px;
}
.hero-title h1{
  margin: 0 0 6px;
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  letter-spacing: .2px;
}
.hero-title .muted{ color: var(--muted); font-weight: 500; }
.typing{
  width: fit-content;
  border-right: 2px solid rgba(255,255,255,.7);
  white-space: nowrap;
  overflow: hidden;
  animation: typing 2.8s steps(28,end), blink .9s infinite;
}
@keyframes typing{ from{ width:0 } to{ width: 280px } }
@keyframes blink{ 50%{ border-color: transparent } }
.hero-desc{ color: #d7deea; line-height: 1.6; }
.hero-actions{ margin-top: 12px; }

/* About */
.twocol{
  display:grid; gap:8px;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
}

/* Scan page */
.scan-main{ padding: 24px; max-width: 1100px; margin-inline:auto; }
.section-title{ margin:0 0 12px; font-family: 'Roboto Slab', serif; }
.scan-form{ display:flex; gap:12px; }
.input, .glass-input{
  border-radius: 14px; border:1px solid rgba(255,255,255,.2);
  padding: 12px 14px; background: rgba(255,255,255,.06);
  color:#fff; outline:none; width:100%;
}
.hint{ color: var(--muted); margin-top: 8px; }

/* Scan status */
.scan-status{
  list-style: none; margin:0; padding:0; display:grid; gap:10px;
}
.scan-item{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}
.scan-item .name{ font-weight:600; letter-spacing:.2px; }
.badge{
  font-size:.85rem; padding:6px 10px; border-radius: 12px; border:1px solid rgba(255,255,255,.2);
}
.badge.wait{ color:#fff; border-color: rgba(255,255,255,.28); }
.badge.ok{ background: rgba(0,214,143,.18); border-color: rgba(0,214,143,.35); color: #aaffea; }
.badge.fail{ background: rgba(255,97,90,.18); border-color: rgba(255,97,90,.35); color: #ffc7c4; }

.spinner{
  width:16px; height:16px; border:3px solid rgba(255,255,255,.25); border-top-color:#fff;
  border-radius: 50%; display:inline-block; animation: spin 1s linear infinite; margin-right:8px;
}
@keyframes spin{ to{ transform: rotate(360deg) } }

.tick{ color: var(--success); font-weight:700; }
.cross{ color: var(--danger); font-weight:700; }

/* Risk grid */
.section-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.controls{ display:flex; gap:10px; }

.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  margin-top: 16px;
}
.tile{
  padding: 16px; border-radius: 18px;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.tile:hover{ transform: translateY(-2px); box-shadow: var(--shadow); }
.tile h4{ margin:0 0 6px; }
.tile .meta{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.chip{
  font-size:.8rem; padding:6px 8px; border-radius: 10px;
  background: rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.16);
}
.score{
  font-weight:700; color:#fff; padding:4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(122,92,255,.5), rgba(214,51,132,.5));
  border:1px solid rgba(255,255,255,.2);
}
.tile .actions{ display:flex; gap:10px; margin-top: 10px; }

/* Empty state */
.empty-state{
  text-align:center; padding: 30px 10px; opacity:.95;
}
.empty-icon{ font-size:48px; margin-bottom:8px; }

/* Modal */
.modal-backdrop {
  display: none; /* initially hidden */
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease forwards;
}

.modal-center {
  max-width: 600px;
  width: 90%;
}



.modal{
  width: min(760px, 92vw); padding: 16px 16px 12px;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:8px;
  border-bottom:1px solid rgba(255,255,255,.18);
}
.modal-body{ padding: 16px 4px; line-height:1.6; }
.modal-foot{ display:flex; justify-content:flex-end; gap:8px; padding-top:10px; }
.icon-btn{
  background: transparent; color:#fff; border:1px solid rgba(255,255,255,.2);
  border-radius: 10px; padding:6px 10px; cursor:pointer;
}
.icon-btn:hover{ background: rgba(255,255,255,.06); }

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.logo {
  width: 80px;
  margin-bottom: 20px;
}




.loader {
  border: 6px solid rgba(255,255,255,0.2);
  border-top: 6px solid #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-fact {
  margin-top: 10px;
  font-style: italic;
  opacity: 0.8;
}

select.glass-input {
  background: rgba(30,30,30,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
select.glass-input option {
  background: #333;
  color: #fff;
}


/* ===== Login page additions ===== */
.login-hero{
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card{
  width: min(520px, 92vw);
  padding: 28px 24px 22px;
  border-radius: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.login-head{
  text-align: center;
  margin-bottom: 16px;
}

.login-head h1{
  margin: 6px 0 0;
  font-family: 'Roboto Slab', serif;
  letter-spacing: .2px;
}

.login-head .sub{
  color: var(--muted);
  margin: 6px 0 0;
}

.shield-wrap{
  display: grid; place-items: center;
}
.shield{
  width: 76px; height: 76px;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.45));
}

.login-form .field{
  display: grid; gap: 6px;
  margin-bottom: 12px;
}
.login-form label{
  font-size: .95rem; color: #cfd7e6;
}
.login-form .glass-input{
  width: 100%;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.2);
  padding: 12px 14px;
  background: rgba(255,255,255,.06);
  color:#fff; outline:none;
}

.alert{
  margin: 10px auto 0; width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  font-size: .95rem;
}
.alert.ok{
  background: rgba(0,214,143,.18);
  border-color: rgba(0,214,143,.35);
  color: #aaffea;
}
.alert.danger{
  background: rgba(255,97,90,.18);
  border-color: rgba(255,97,90,.35);
  color: #ffc7c4;
}

/* Make selects darker in scan page (better visibility) */
.controls .glass-input, .scan-form .glass-input, select.glass-input {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.28);
}

/* Centered modal improvements */
.modal-backdrop{
  animation: fadeIn .18s ease-out;
}
.modal{
  animation: floatIn .22s ease-out;
}
@keyframes fadeIn{
  from{ opacity:0 } to{ opacity:1 }
}
@keyframes floatIn{
  from{ transform: translateY(10px); opacity:0 }
  to{ transform: translateY(0); opacity:1 }
}
