:root {
  --bg: #0a0e16;
  --bg-glow: radial-gradient(60rem 32rem at 50% -10%, rgba(59, 130, 246, 0.16), transparent 60%);
  --card: #131a28;
  --card-soft: #101623;
  --text: #eef2f7;
  --muted: #8b97a8;
  --muted-soft: #647082;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-border: rgba(59, 130, 246, 0.35);
  --success: #34d399;
  --border: #212c3f;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 20px 40px -28px rgba(0, 0, 0, 0.7);
  --container: 42rem;
  --container-wide: 74rem;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 22, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand {
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.main {
  flex: 1;
  padding: 2.5rem 1.5rem 4rem;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
}

.main.landing {
  max-width: var(--container-wide);
  padding-top: 1rem;
}

.main.admin-wide {
  max-width: 56rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

h1 {
  margin-top: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.lead {
  color: var(--muted);
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: #263449;
}

.btn.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.btn.btn-ghost:hover {
  background: var(--card-soft);
  border-color: var(--muted-soft);
}

.btn.btn-block {
  width: 100%;
}

.key {
  white-space: pre-wrap;
  word-break: break-all;
  background: #0d1320;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.balance {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.hint,
.warn {
  font-size: 0.9rem;
  color: var(--muted);
}

.warn {
  color: #fbbf24;
}

.foot {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted-soft);
}

.foot p {
  margin: 0;
  text-align: center;
}

code {
  font-size: 0.9em;
}

.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.flash {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  background: #422006;
  border-bottom: 1px solid var(--border);
  color: #fde68a;
  font-size: 0.95rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 22rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.field input {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0d1320;
  color: var(--text);
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-actions {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
}

.admin-actions li {
  margin-bottom: 0.75rem;
}

.inline-form {
  display: inline;
}

.inline-form .btn {
  margin-top: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
}

/* ---------------------------------------------------------------- */
/* Landing page                                                      */
/* ---------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  max-width: 42rem;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 34rem;
  margin: 0 auto 1.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted-soft);
}

.section {
  margin: 4rem 0;
}

.section-head {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

.section-sub {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
}

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.feature-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.feature h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.feature p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 2.75rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 {
  font-size: 1rem;
  margin: 0.15rem 0 0.4rem;
}

.step p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  align-items: stretch;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.4rem;
}

.price-card.featured {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, var(--accent-soft), var(--card) 55%);
}

.price-badge {
  position: absolute;
  top: -0.7rem;
  right: 1.2rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.price-name {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}

.price-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}

.price-value small {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.price-per {
  font-size: 0.85rem;
  color: var(--success);
  margin: 0.3rem 0 1.2rem;
  min-height: 1.2em;
}

.price-card .btn {
  margin-top: auto;
}

.pricing-note {
  text-align: center;
  color: var(--muted-soft);
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

.auth-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  align-items: start;
}

.auth-primary {
  border-color: var(--accent-border);
}

.auth-secondary {
  background: var(--card-soft);
}

.auth-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.auth-secondary .auth-kicker {
  color: var(--muted-soft);
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted-soft);
  font-size: 0.8rem;
  margin: 1.75rem 0;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

@media (max-width: 640px) {
  .hero {
    padding-top: 1.5rem;
  }

  .section {
    margin: 3rem 0;
  }
}
