/* -
   QuantumVault - Premium Dark Glassmorphism UI
   - */

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

/* - Variables - */
:root {
  --bg-base:    #050b14;
  --bg-surface: #0a1628;
  --bg-card:    rgba(10, 22, 40, 0.7);
  --bg-glass:   rgba(0, 240, 255, 0.04);

  --cyan:       #00f0ff;
  --cyan-dim:   rgba(0, 240, 255, 0.15);
  --cyan-glow:  rgba(0, 240, 255, 0.35);
  --purple:     #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.15);
  --green:      #10b981;
  --green-dim:  rgba(16, 185, 129, 0.15);
  --red:        #ef4444;
  --red-dim:    rgba(239, 68, 68, 0.15);
  --amber:      #f59e0b;
  --amber-dim:  rgba(245, 158, 11, 0.15);

  --fg:         #e8f4f8;
  --fg-dim:     #8ca0b8;
  --border:     rgba(0, 240, 255, 0.12);
  --border-strong: rgba(0, 240, 255, 0.3);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-cyan: 0 0 32px rgba(0, 240, 255, 0.12);
  --shadow-glow: 0 0 60px rgba(0, 240, 255, 0.18);

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  --nav-h: 68px;
}

/* - Reset - */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:  var(--bg-base);
  color:       var(--fg);
  min-height:  100vh;
  line-height: 1.6;
  overflow-x:  hidden;
}

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,240,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Radial glow behind content */
body::after {
  content: '';
  position: fixed;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse at center,
    rgba(0, 240, 255, 0.07) 0%,
    rgba(124, 58, 237, 0.05) 50%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* - Scrollbar - */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* - Nav - */
nav.qv-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 2rem;
  background: rgba(5, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.nav-brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none;
  font-size: 1.25rem; font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 20px var(--cyan-glow);
}
.nav-brand span { color: var(--cyan); }

.nav-links {
  display: flex; align-items: center; gap: .25rem;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: var(--fg-dim);
  font-size: .875rem; font-weight: 500;
  padding: .45rem .9rem;
  border-radius: var(--r-sm);
  transition: all .2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.nav-right {
  display: flex; align-items: center; gap: .75rem;
  margin-left: auto;
}
.nav-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: .8rem; color: var(--fg-dim);
  background: var(--bg-glass);
}
.nav-user .avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #000;
}

/* - Layout - */
.page-wrap {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* - Cards - */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  transition: border-color .3s, box-shadow .3s, transform 0.1s ease-out;
  transform-style: preserve-3d;
}
.card:hover { border-color: var(--border-strong); }
.card.glow   { box-shadow: var(--shadow-card), var(--shadow-cyan); }

.card-sm { padding: 1.25rem 1.5rem; border-radius: var(--r-md); }

/* - Stat Cards - */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  text-align: center;
  transition: border-color .3s, transform 0.1s ease-out;
  transform-style: preserve-3d;
  backdrop-filter: blur(16px);
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-icon { font-size: 2rem; margin-bottom: .5rem; }
.stat-value {
  font-size: 2.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label { font-size: .8rem; color: var(--fg-dim); margin-top: .35rem; text-transform: uppercase; letter-spacing: .06em; }

/* - Buttons - */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem;
  border: none; border-radius: var(--r-sm);
  font: 600 .875rem/1 var(--font);
  cursor: pointer; text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0099aa);
  color: #000;
  box-shadow: 0 0 20px var(--cyan-glow);
}
.btn-primary:hover { box-shadow: 0 0 35px var(--cyan-glow); brightness: 1.1; }

.btn-purple {
  background: linear-gradient(135deg, var(--purple), #5b21b6);
  color: #fff;
  box-shadow: 0 0 20px rgba(124,58,237,.3);
}
.btn-purple:hover { box-shadow: 0 0 35px rgba(124,58,237,.45); }

.btn-ghost {
  background: var(--bg-glass);
  color: var(--cyan);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--cyan-dim); }

.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; border-radius: var(--r-md); }
.btn-full { width: 100%; justify-content: center; }

/* Loading spinner inside button */
.btn .spin { display: none; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite; }
.btn.loading .spin { display: inline-block; }
.btn.loading .btn-text { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* - Forms - */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; margin-bottom: .5rem;
  font-size: .85rem; font-weight: 600; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: .05em;
}
.form-control {
  width: 100%;
  background: rgba(0,240,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--fg);
  font: 400 .95rem/1.5 var(--font);
  padding: .75rem 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.form-control::placeholder { color: var(--fg-dim); opacity: .6; }

textarea.form-control { resize: vertical; min-height: 130px; }

/* File dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  background: var(--bg-glass);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 24px var(--cyan-glow);
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.dropzone p { color: var(--fg-dim); font-size: .9rem; }
.dropzone strong { color: var(--cyan); }
.dropzone input[type="file"] { display: none; }

/* - Divider - */
.or-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--fg-dim); font-size: .8rem; margin: 1.5rem 0;
  text-transform: uppercase; letter-spacing: .08em;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* - Alerts & Flash - */
.flash-wrap { padding: .75rem 0; }
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500;
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

.alert-success { background: var(--green-dim); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.alert-danger   { background: var(--red-dim);   border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.alert-warning  { background: var(--amber-dim); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }
.alert-info     { background: var(--cyan-dim);  border: 1px solid rgba(0,240,255,.3);  color: var(--cyan); }

/* - QRC Code Display - */
.qrc-box {
  background: var(--bg-surface);
  border: 2px solid var(--cyan);
  border-radius: var(--r-md);
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 0 40px var(--cyan-glow);
  position: relative;
  overflow: hidden;
}
.qrc-box::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--cyan-dim), transparent 60%);
  pointer-events: none;
}
.qrc-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-dim); margin-bottom: .5rem; }
.qrc-code {
  font: 700 2rem/1 var(--mono);
  color: var(--cyan);
  letter-spacing: .12em;
  text-shadow: 0 0 20px var(--cyan-glow);
  word-break: break-all;
}
.qrc-copy-btn {
  margin-top: 1rem;
  padding: .5rem 1.2rem;
  background: var(--cyan-dim);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--cyan);
  font: 600 .85rem var(--font);
  cursor: pointer;
  transition: all .2s;
}
.qrc-copy-btn:hover { background: var(--cyan); color: #000; }
.qrc-copy-btn.copied { background: var(--green-dim); border-color: rgba(16,185,129,.3); color: #34d399; }

/* - Success card - */
.success-banner {
  border: 1px solid rgba(16,185,129,.3);
  background: linear-gradient(135deg, rgba(16,185,129,.08), transparent);
  border-radius: var(--r-md);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.success-banner .check { font-size: 2rem; }

/* - Preview box - */
.preview-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.preview-header {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
  font-size: .85rem; color: var(--fg-dim);
  background: rgba(0,240,255,.03);
}
.preview-body { padding: 1.5rem; }
.preview-text {
  font: 400 .9rem/1.7 var(--mono);
  color: var(--fg);
  white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
}
.preview-body img { max-width: 100%; border-radius: var(--r-sm); }
.preview-body iframe { width: 100%; height: 500px; border: none; border-radius: var(--r-sm); }

/* - Table - */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: rgba(0,240,255,.05); }
th { padding: .9rem 1.1rem; text-align: left; font: 600 .78rem var(--font);
     color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em;
     border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .85rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.04);
     color: var(--fg); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,240,255,.03); }

/* - Badges - */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 50px;
  font: 600 .72rem var(--font);
  text-transform: uppercase; letter-spacing: .06em;
}
.badge-cyan    { background: var(--cyan-dim);   color: var(--cyan); }
.badge-green   { background: var(--green-dim);  color: var(--green); }
.badge-red     { background: var(--red-dim);    color: var(--red); }
.badge-amber   { background: var(--amber-dim);  color: var(--amber); }
.badge-purple  { background: var(--purple-dim); color: #a78bfa; }

/* - Page headings - */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--fg) 60%, var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p { color: var(--fg-dim); margin-top: .4rem; font-size: .95rem; }

/* - Section titles - */
.section-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 1rem;
  color: var(--fg); display: flex; align-items: center; gap: .5rem;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* - Landing page - */
.hero {
  text-align: center; padding: 6rem 1rem 4rem;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem 1rem;
  background: var(--cyan-dim); border: 1px solid var(--border-strong);
  border-radius: 50px; color: var(--cyan);
  font-size: .8rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900; line-height: 1.1; letter-spacing: -.04em;
  margin-bottom: 1.5rem;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem; color: var(--fg-dim);
  max-width: 560px; margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem; margin: 4rem 0;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  transition: border-color .3s, transform 0.1s ease-out;
  transform-style: preserve-3d;
  backdrop-filter: blur(16px);
}
.feature-card:hover { border-color: var(--border-strong); }
.feature-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p  { font-size: .9rem; color: var(--fg-dim); line-height: 1.6; }

/* - Auth pages - */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; position: relative; z-index: 1;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-card), var(--shadow-cyan);
  backdrop-filter: blur(24px);
  transition: transform 0.1s ease-out;
  transform-style: preserve-3d;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto .75rem;
  box-shadow: 0 0 30px var(--cyan-glow);
}
.auth-logo h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.auth-logo p  { color: var(--fg-dim); font-size: .875rem; margin-top: .25rem; }

/* - Misc - */
.text-muted   { color: var(--fg-dim); }
.text-cyan    { color: var(--cyan); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-amber   { color: var(--amber); }
.text-center  { text-align: center; }
.mono         { font-family: var(--mono); }

.mt-1 { margin-top:.5rem; }
.mt-2 { margin-top:1rem; }
.mt-3 { margin-top:1.5rem; }
.mt-4 { margin-top:2rem; }
.mb-2 { margin-bottom:1rem; }
.mb-3 { margin-bottom:1.5rem; }
.gap-1 { gap:.5rem; }
.flex  { display:flex; align-items:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.flex-wrap { flex-wrap:wrap; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; }

/* - Download permission card - */
.permission-card {
  border: 1px solid rgba(245,158,11,.3);
  background: linear-gradient(135deg, rgba(245,158,11,.08), transparent);
  border-radius: var(--r-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.permission-card .perm-icon { font-size: 2rem; flex-shrink: 0; }

/* - Responsive - */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2    { grid-template-columns: 1fr; }
  .page-wrap { padding: 1.5rem 1rem; }
  .qrc-code  { font-size: 1.4rem; }
}

/* - Animations - */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:none; }
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px var(--cyan-glow); }
  50%      { box-shadow: 0 0 50px var(--cyan-glow); }
}

.fade-up { animation: fadeUp .5s ease both; }
.pulse   { animation: pulse-glow 3s ease-in-out infinite; }

/* Stagger children */
.fade-up:nth-child(1) { animation-delay: .05s; }
.fade-up:nth-child(2) { animation-delay: .12s; }
.fade-up:nth-child(3) { animation-delay: .19s; }
.fade-up:nth-child(4) { animation-delay: .26s; }


/* - Scroll Reveal - */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
