:root {
  /* Colors */
  --bg-main: #060606;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(20, 20, 20, 0.6);
  --bg-card-hover: rgba(30, 30, 30, 0.8);

  --red: #9e0015;
  --red-hover: #c4001a;
  --red-glow: rgba(158, 0, 21, 0.35);
  --red-soft: rgba(158, 0, 21, 0.15);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(229, 25, 36, 0.3);

  /* Fonts */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;

  /* Utilities */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 82% 8%, rgba(229, 25, 36, 0.07), transparent 30rem);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-8 { padding: 2rem; }
.flex-col { display: flex; flex-direction: column; }
.full-width { width: 100%; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); letter-spacing: -0.03em; }
h3 { font-size: 1.5rem; }

em {
  font-style: normal;
  color: var(--text-main);
  position: relative;
  display: inline-block;
  z-index: 1;
}

em::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 100%;
  height: 12px;
  background-color: var(--red);
  opacity: 0.4;
  z-index: -1;
  transform: rotate(-1deg);
}

.eyebrow {
  display: inline-block;
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.pt-navbar { padding-top: 100px; }

/* Navbar (Simplified for Auth) */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%; z-index: 100;
  padding: 1rem 0;
  background-color: rgba(6, 6, 6, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand img { width: 32px; height: 32px; filter: brightness(0) invert(1); }
.brand-text {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.02em;
}
.brand-text span { color: var(--red); }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-main); }
.nav-links i { width: 18px; height: 18px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  border-radius: var(--radius-md); text-decoration: none; transition: all var(--transition);
  cursor: pointer; border: none;
}
.btn-primary {
  background-color: var(--text-main); color: var(--text-dark);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.btn-primary:hover {
  transform: translateY(-2px); background-color: #fff; box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08); color: var(--text-main); border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px);
}
.btn-outline {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); color: var(--text-main); font-size: 0.875rem; padding: 0.5rem 1rem;
}
.btn-outline:hover { background-color: var(--red); border-color: var(--red); }
.btn i { width: 18px; height: 18px; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Forms & Inputs */
.form-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.form-header { margin-bottom: 1rem; }
.form-kicker { color: var(--red); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; display: block; margin-bottom: 0.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { color: #d1d5db; font-size: 0.875rem; font-weight: 600; }

.form-input {
  width: 100%; min-height: 48px; padding: 0.75rem 1rem;
  border: 1px solid var(--border-light); border-radius: var(--radius-md);
  outline: none; color: var(--text-main); background: rgba(0,0,0,0.4);
  transition: all var(--transition);
}
.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
  background: rgba(0,0,0,0.6);
}

.field-hint { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.875rem; }
.field-hint i { width: 16px; height: 16px; }
.form-error { min-height: 1.25rem; margin: 0; color: #ef4444; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.form-link { align-self: center; border: 0; padding: 0.25rem; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.form-link:hover, .form-link:focus-visible { color: var(--text-main); }

/* Auth Layout */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 4rem;
  align-items: center;
  min-height: calc(100vh - 100px);
  padding: 4rem 0;
}

.auth-intro .lead { margin-top: 1.5rem; font-size: 1.125rem; color: var(--text-muted); max-width: 480px; }
.alert-panel { padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start; border-left: 3px solid var(--red); }
.alert-icon i { color: var(--red); }
.alert-panel strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.alert-panel p { color: var(--text-muted); font-size: 0.875rem; margin: 0; }

.auth-card { padding: 2.5rem; position: relative; overflow: hidden; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -2.5rem -2.5rem 2rem; border-bottom: 1px solid var(--border-light); }
.auth-tab {
  padding: 1.25rem; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); background: transparent; cursor: pointer; font-weight: 700; font-size: 0.95rem;
  transition: all var(--transition);
}
.auth-tab.active { border-bottom-color: var(--red); color: var(--text-main); background: var(--red-soft); }
.auth-tab:hover:not(.active) { background: rgba(255,255,255,0.02); color: var(--text-main); }

/* Centered View */
.centered-view { display: grid; min-height: calc(100vh - 100px); place-items: center; padding: 4rem 0; position: relative; }
.centered-view .auth-card { width: 100%; max-width: 500px; z-index: 1; }
.hero-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 600px; height: 600px; background: radial-gradient(circle, var(--red-glow) 0%, transparent 60%); z-index: 0; pointer-events: none; }

/* Portal View */
.portal-view { padding: 3rem 0 6rem; }
.portal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3rem; }
.portal-header p { display: flex; align-items: center; gap: 0.5rem; }
.portal-header i { width: 16px; height: 16px; }

.portal-grid { display: grid; gap: 2rem; }

.section-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-light); }
.license-section, .downloads-section { padding: 2rem; }

/* License List */
.license-list { display: grid; gap: 1rem; }
.license-item {
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(190px, auto) auto; align-items: center; gap: 1.25rem;
  padding: 1.25rem; border: 1px solid var(--border-light); border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3); transition: all var(--transition);
}
.license-item:hover { border-color: rgba(255,255,255,0.15); background: rgba(0,0,0,0.5); }
.license-key-actions { display: flex; align-items: center; gap: 1rem; }
.license-item strong { font-size: 0.95rem; color: var(--text-main); letter-spacing: 0.05em; }
.license-item span { color: var(--text-muted); font-size: 0.875rem; }
.license-details { display: grid; gap: 0.25rem; }
.status-active { color: #10b981 !important; font-weight: 700; display: flex; align-items: center; gap: 0.25rem; }
.status-inactive { color: #f59e0b !important; font-weight: 700; }
.license-renew { white-space: nowrap; }

/* Downloads Grid */
.downloads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.download-card {
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.5rem; border: 1px solid var(--border-light); border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3); transition: all var(--transition);
}
.download-card:hover { border-color: var(--border-glow); transform: translateY(-3px); background: rgba(0,0,0,0.5); }
.download-card header { display: flex; align-items: center; gap: 1rem; }
.download-card img { width: 48px; height: 48px; object-fit: contain; }
.download-card h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.download-card p { color: var(--text-muted); font-size: 0.875rem; }
.download-card a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  padding: 1rem; border-radius: var(--radius-sm); color: var(--text-dark); background: var(--text-main);
  font-weight: 700; text-decoration: none; transition: all var(--transition);
}
.download-card a:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255,255,255,0.15); }
.download-card a span { color: rgba(0,0,0,0.6); font-size: 0.75rem; font-weight: 600; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  padding: 4rem 2rem; border: 1px dashed var(--border-light); border-radius: var(--radius-md);
  color: var(--text-muted); text-align: center;
}
.empty-state i { width: 48px; height: 48px; color: var(--border-light); }

/* Toast */
.toast {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1000;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.5rem;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast i { color: var(--red); width: 20px; height: 20px; }
.toast-message { font-size: 0.95rem; font-weight: 500; }

/* Responsive */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; gap: 3rem; padding: 2rem 0; }
  .auth-intro { text-align: center; }
  .auth-intro .lead { margin: 1.5rem auto 0; }
  .alert-panel { text-align: left; }
  .auth-card { margin: 0 auto; width: 100%; max-width: 500px; }
}

@media (max-width: 640px) {
  h1 { font-size: 2.5rem; }
  .nav-links { display: none; }
  .portal-header { flex-direction: column; gap: 1.5rem; }
  .license-item { grid-template-columns: 1fr; align-items: flex-start; gap: 1rem; }
  .license-key-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .downloads-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.5rem; }
  .auth-tabs { margin: -1.5rem -1.5rem 1.5rem; }
  .license-section, .downloads-section { padding: 1.5rem; }
}
