:root {
  --bg: #0f1220;
  --bg-soft: #171b2e;
  --card: #1c2138;
  --border: #2b3152;
  --text: #e8eaf6;
  --muted: #9aa1c7;
  --primary: #6c7bff;
  --primary-hover: #8592ff;
  --success: #2fbf71;
  --error: #ff5d6c;
  --danger: #d64555;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code.uuid {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}
code.uuid.big { font-size: 0.95rem; padding: 8px 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.5px;
}
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); }
form.inline { display: inline; }

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1;
}

.footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 16px; letter-spacing: -1px; }
.lead { color: var(--muted); max-width: 560px; margin: 0 auto 28px; font-size: 1.05rem; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.step h3 { margin: 8px 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 0.92rem; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card h1, .card h2 { margin-top: 0; }

.auth-card { max-width: 440px; margin: 24px auto; }
.notice { border-left: 4px solid var(--primary); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
}
.page-head h1, .page-head h2 { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}
textarea { resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e55666; }
.btn-voted { background: rgba(47, 191, 113, 0.15); color: var(--success); border-color: var(--success); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.row-form { display: flex; gap: 12px; }
.row-form input { flex: 1; }

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}
.flash-success { background: rgba(47, 191, 113, 0.15); color: var(--success); border: 1px solid var(--success); }
.flash-error { background: rgba(255, 93, 108, 0.12); color: var(--error); border: 1px solid var(--error); }

.errors {
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 8px;
  padding: 12px 12px 12px 32px;
  margin: 0 0 16px;
}

.app-list, .feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.app-item, .feature-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.app-name:hover { color: var(--primary); }

.feature-body { flex: 1; min-width: 0; }
.feature-body h3 { margin: 0 0 4px; font-size: 1.02rem; }
.feature-body p { margin: 4px 0 6px; color: var(--muted); font-size: 0.92rem; }

.feature-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.votes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-weight: 700;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty h1 { font-size: 3rem; margin: 0 0 8px; color: var(--text); }

.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

@media (max-width: 600px) {
  .app-item, .feature-item { flex-direction: column; align-items: stretch; }
  .feature-meta { flex-direction: row; justify-content: flex-start; }
  .row-form { flex-direction: column; }
}
