/* finitebase-console — hand-written dark theme, no framework. */

:root {
  --bg: #0b0f17;
  --bg-raised: #111827;
  --bg-inset: #0d1320;
  --border: #1f2a3d;
  --text: #dbe4f0;
  --text-muted: #8291a8;
  --accent: #4f8cff;
  --accent-strong: #689aff;
  --ok: #2fbf71;
  --warn: #e0a13e;
  --danger: #e05252;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  word-break: break-all;
}

h1 { font-size: 1.7rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
p { margin: 0.5rem 0; }

/* Header / footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  flex-wrap: wrap;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-muted); }

/* Panels & layout */

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.4rem;
}
.panel.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.panel.center { text-align: center; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.prose h2 { margin-top: 1.5rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }

/* Hero & features */

.hero { text-align: center; padding: 3.2rem 1rem 2.4rem; }
.hero h1 { font-size: 2.8rem; margin-bottom: 0.4rem; letter-spacing: -0.03em; }
.hero .tagline { font-size: 1.3rem; color: var(--accent-strong); margin: 0 0 0.8rem; }
.hero .sub { max-width: 620px; margin: 0 auto 1.6rem; color: var(--text-muted); }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.feature {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}
.feature h3 { color: var(--accent-strong); }
.feature p { color: var(--text-muted); font-size: 0.93rem; margin: 0; }

/* Buttons & forms */

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-inset);
  color: var(--text);
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: center;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.25rem 0.65rem; font-size: 0.8rem; }

.stack { display: flex; flex-direction: column; gap: 0.9rem; margin: 1rem 0; }
.stack label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--text-muted); }

input[type="text"], input[type="email"], input[type="password"] {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.row-form { display: flex; gap: 0.6rem; margin: 0.8rem 0 0.3rem; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 200px; }
.inline-form { display: inline; }

/* Tables */

.table-wrap { overflow-x: auto; margin: 0.6rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: rgba(79, 140, 255, 0.05); }

/* Badges, alerts, pills */

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  vertical-align: middle;
}
.badge-ok { background: rgba(47, 191, 113, 0.15); color: var(--ok); }
.badge-warn { background: rgba(224, 161, 62, 0.15); color: var(--warn); }
.badge-muted { background: rgba(130, 145, 168, 0.15); color: var(--text-muted); }

.alert { border-radius: 8px; padding: 0.75rem 1rem; margin: 0.9rem 0; font-size: 0.93rem; border: 1px solid; }
.alert-error { border-color: var(--danger); background: rgba(224, 82, 82, 0.1); color: #f2b8b8; }
.alert-info { border-color: var(--accent); background: rgba(79, 140, 255, 0.1); color: #b9d0f7; }

.plan-pill { color: var(--text-muted); font-size: 0.9rem; }

/* Pricing */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}
.plan-card {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.plan-card.plan-current { border-color: var(--accent); }
.plan-price { font-size: 1.6rem; font-weight: 700; }
.plan-price span { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }
.plan-card ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); font-size: 0.88rem; flex: 1; }
.plan-card li { margin: 0.2rem 0; }

/* Key/value rows & secrets */

.kv { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.6rem 0; }
.kv-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.kv-row > span { min-width: 110px; color: var(--text-muted); font-size: 0.88rem; }

.secret-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg-inset);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  flex-wrap: wrap;
}
.secret-box code { border: none; background: none; font-size: 0.95rem; }

/* Usage meters */

.meter { margin: 0.7rem 0; }
.meter-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.meter-track { height: 8px; border-radius: 999px; background: var(--bg-inset); border: 1px solid var(--border); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.meter-fill.meter-warn { background: var(--warn); }
.meter-fill.meter-over { background: var(--danger); }

/* Admin */

.tab-nav { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--border); margin: 1.2rem 0 1rem; flex-wrap: wrap; }
.tab-nav a {
  padding: 0.45rem 0.9rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
}
.tab-nav a:hover { color: var(--text); text-decoration: none; }
.tab-nav a.tab-active { color: var(--text); background: var(--bg-inset); border-color: var(--border); }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.6rem 0 0.4rem; }
.stat {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.stat strong { font-size: 1.25rem; }
.stat span { color: var(--text-muted); font-size: 0.78rem; }

@media (max-width: 640px) {
  .site-main { padding: 1rem 0.8rem 2rem; }
  .panel { padding: 1.1rem 1rem; }
  .hero h1 { font-size: 2.1rem; }
}
