/* ================= CSS Variables ================= */
:root {
  --bg-base: #050b14;
  --bg-card: rgba(15, 23, 42, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(59, 130, 246, 0.4);
  
  --primary: #2563eb;
  --primary-hover: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.5);
  --cyan: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-text: #fca5a5;
  --error-border: rgba(239, 68, 68, 0.3);
}

/* ================= Reset & Global ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* ================= Background Effects ================= */
.tech-bg-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

.tech-bg-glow {
  position: fixed; z-index: -2; pointer-events: none;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}
.glow-left { background: radial-gradient(circle, var(--primary) 0%, transparent 70%); top: -20%; left: -10%; }
.glow-right { background: radial-gradient(circle, var(--cyan) 0%, transparent 70%); bottom: -20%; right: -10%; opacity: 0.25; }
.glow-center { background: radial-gradient(circle, var(--primary) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.3; }

#particle-canvas {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}

/* ================= Glass Panel (Shared) ================= */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  z-index: 10;
}

/* ================= Login Page Specific ================= */
.auth-wrapper {
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  margin-top: -4vh;
}
.card-header { text-align: center; margin-bottom: 40px; }
.brand-logo {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: 16px;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}
.brand-logo svg { width: 28px; height: 28px; color: #fff; }
.brand-title { font-size: 28px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.brand-subtitle { font-size: 14px; color: var(--text-muted); letter-spacing: 2px; }

/* Download Notice */
.download-notice {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 28px;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
  animation: pulse-border 2.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.3); }
  70% { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.notice-icon-wrapper {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.05));
  color: var(--cyan);
  flex-shrink: 0;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.notice-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notice-text strong {
  font-size: 15px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.notice-text span {
  font-size: 13px;
  color: #cffafe;
  opacity: 0.9;
}

/* Alert */
.alert-error {
  display: flex; align-items: center; gap: 10px;
  background: var(--error-bg); border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 16px; border-radius: 12px; margin-bottom: 24px; font-size: 14px;
}

/* Form */
.form-group { margin-bottom: 24px; }
.auth-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--error-border);
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 13px;
  text-align: center;
}
.form-group label {
  display: block; font-size: 13px; color: var(--text-muted);
  margin-bottom: 8px; font-weight: 500;
}
.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-dark); pointer-events: none;
  transition: color 0.3s;
}
.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
  color: #fff; font-size: 15px;
  transition: all 0.3s ease;
}
.input-wrapper input:focus {
  outline: none;
  border-color: var(--border-highlight);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.input-wrapper input:focus + .input-icon { color: var(--primary); }

/* Buttons */
.btn-primary {
  width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 12px;
  padding: 16px; font-size: 16px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; text-decoration: none;
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 8px 24px var(--primary-glow); }
.btn-large { padding: 18px; font-size: 18px; border-radius: 16px; }

/* ================= Download Page Specific ================= */
.download-wrapper { width: 100%; padding: 20px; display: flex; justify-content: center; align-items: center; }
.download-card { width: 100%; max-width: 680px; padding: 48px; }
.dl-header { margin-bottom: 40px; text-align: center; }
.dl-title { font-size: 32px; font-weight: 800; margin-bottom: 20px; letter-spacing: 1px; }
.dl-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tag { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.tag-blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border-color: rgba(37, 99, 235, 0.3); }
.tag-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.tag-ghost { background: rgba(255,255,255,0.05); color: var(--text-muted); border-color: var(--border-glass); }

.dl-main-info {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.2); border: 1px solid var(--border-glass);
  border-radius: 16px; padding: 24px 32px; margin-bottom: 32px;
}
.v-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.v-number { font-size: 28px; font-weight: 700; color: #fff; }
.meta-block { display: flex; flex-direction: column; gap: 8px; text-align: right; }
.meta-item { font-size: 14px; }
.meta-lbl { color: var(--text-dark); }
.meta-val { color: var(--text-main); font-weight: 500; }

.dl-action-area { text-align: center; margin-bottom: 40px; }
.security-hash { margin-top: 16px; font-size: 12px; color: var(--text-dark); font-family: monospace; word-break: break-all; }
.security-hash span { color: var(--text-muted); }

.dl-divider { height: 1px; background: var(--border-glass); margin: 0 -48px 32px; }

.dl-notes h3 { font-size: 16px; color: #fff; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dl-notes h3::before { content: ""; display: block; width: 4px; height: 14px; background: var(--primary); border-radius: 2px; }
.notes-content {
  font-size: 14px; color: var(--text-muted); line-height: 1.8;
  background: rgba(255,255,255,0.02); padding: 20px; border-radius: 12px;
}

.dl-footer { margin-top: 32px; display: flex; justify-content: center; }
.cs-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dark); background: rgba(0,0,0,0.3); padding: 8px 16px; border-radius: 20px; }
