/* licit — minimal, technical, alvdef.com aesthetic */

:root {
  --bg: #fff;
  --fg: #111;
  --fg-muted: #666;
  --fg-faint: #999;
  --border: #e0e0e0;
  --accent: #111;
  --accent-hover: #fff;
  --input-bg: transparent;
  --code-bg: #f5f5f5;
  --success: #1a7f37;
  --error: #cf222e;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, "Cascadia Code",
    "Fira Code", Menlo, monospace;
  --max-w: 640px;
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 2rem;
  --sp-xl: 4rem;
  --sp-2xl: 6rem;
}

/* --- Reset --- */

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

/* --- Base --- */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

}

a {
  color: var(--fg);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--fg-muted);
}

/* --- Layout --- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}

main {
  flex: 1;
}

/* --- Nav --- */

nav {
  padding: var(--sp-lg) 0;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--fg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.nav-links a {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--fg-muted);
}

.nav-links a:hover {
  color: var(--fg);
}

/* --- Hero --- */

.hero {
  padding: var(--sp-2xl) 0 var(--sp-xl);
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-sm);
}

.hero p {
  color: var(--fg-muted);
  font-size: 1.125rem;
  max-width: 480px;
}

.hero-actions {
  margin-top: var(--sp-lg);
  display: flex;
  gap: var(--sp-md);
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--accent);
  color: var(--accent-hover);
}

.btn-sm {
  font-size: 0.8rem;
  padding: var(--sp-xs) var(--sp-sm);
}

.btn-danger {
  border-color: var(--error);
  color: var(--error);
}

.btn-danger:hover {
  background: var(--error);
  color: #fff;
}

/* --- Stats grid --- */

.stats {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
}

.stat dt {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-xs);
}

.stat dd {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg-muted);
}

/* --- Features --- */

.features {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border);
}

.features h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--sp-lg);
}

.features ul {
  list-style: none;
}

.features li {
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9375rem;
}

.features li strong {
  color: var(--fg);
  font-weight: 500;
}

/* --- Problem section --- */

.problem {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border);
}

.problem h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--sp-md);
}

.problem p {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* --- Forms --- */

.form-page {
  padding: var(--sp-2xl) 0;
}

.form-page h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--sp-lg);
}

.form-group {
  margin-bottom: var(--sp-md);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-xs);
}

.form-group input {
  width: 100%;
  padding: var(--sp-sm) 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--fg);
  background: var(--input-bg);
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus {
  border-color: var(--fg);
}

.form-actions {
  margin-top: var(--sp-lg);
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--sp-sm);
  display: none;
}

.form-error.visible {
  display: block;
}

/* --- Key display (after registration) --- */

.key-display {
  margin-top: var(--sp-lg);
  padding: var(--sp-md);
  border: 1px solid var(--border);
  display: none;
}

.key-display.visible {
  display: block;
}

.key-display p {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: var(--sp-sm);
}

.key-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--code-bg);
  padding: var(--sp-sm) var(--sp-md);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
}

.key-value code {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.key-warning {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: var(--sp-sm);
}

/* --- Dashboard --- */

.dashboard {
  padding: var(--sp-2xl) 0;
}

.dashboard h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}

.dashboard-subtitle {
  color: var(--fg-muted);
  font-size: 0.9375rem;
  margin-bottom: var(--sp-xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

/* --- Tables --- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
}

td {
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.muted {
  color: var(--fg-muted);
}

.badge-active {
  color: var(--success);
}

.badge-revoked {
  color: var(--fg-faint);
}

/* --- Footer --- */

footer {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--sp-xl);
}

footer .container {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-faint);
}

footer a {
  color: var(--fg-faint);
}

footer a:hover {
  color: var(--fg-muted);
}

/* --- Utilities --- */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-md {
  margin-top: var(--sp-md);
}

.mt-lg {
  margin-top: var(--sp-lg);
}

/* --- Responsive --- */

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .stat dd {
    font-size: 1.25rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    text-align: center;
  }

  table {
    font-size: 0.8rem;
  }
}
