/* Maptek x OpenBao -- Live Demo. Dark slate theme, Maptek orange accent. */

:root {
  --orange: #ff6600;
  --orange-soft: #ff8433;
  --orange-glow: rgba(255, 102, 0, 0.35);
  --bg: #0e141b;
  --bg-2: #131c26;
  --card: #17212e;
  --card-2: #1c2836;
  --border: #26374a;
  --border-soft: #1f2e3e;
  --text: #e8eef5;
  --text-dim: #9fb0c3;
  --text-faint: #6c7f93;
  --green: #35d07f;
  --red: #ff5c5c;
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 102, 0, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(53, 90, 140, 0.14), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

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

/* ---------- Top nav ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14, 20, 27, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}
.brand .logo-dot {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--orange);
  box-shadow: 0 0 14px var(--orange-glow);
}
.brand .x { color: var(--text-faint); font-weight: 400; }
.brand .bao { color: var(--text); }
.nav .spacer { flex: 1; }
.nav a.navlink {
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
}
.nav a.navlink:hover { color: var(--text); background: var(--card-2); text-decoration: none; }
.nav a.navlink.cta {
  background: var(--orange);
  color: #1a1206;
}
.nav a.navlink.cta:hover { background: var(--orange-soft); color: #1a1206; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 40px 32px 80px; }

.hero { text-align: center; padding: 40px 0 24px; }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  color: var(--orange-soft);
  font-weight: 700;
}
.hero h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin: 14px 0 12px;
  font-weight: 800;
}
.hero h1 .accent { color: var(--orange); }
.hero p.lede {
  font-size: 1.3rem;
  color: var(--text-dim);
  max-width: 760px;
  margin: 0 auto 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: 12px;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--orange);
  color: #1a1206;
  box-shadow: 0 6px 24px var(--orange-glow);
}
.btn-primary:hover { background: var(--orange-soft); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-lg { font-size: 1.2rem; padding: 18px 34px; }
.btn .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(26,18,6,0.35);
  border-top-color: #1a1206;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & grids ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
}
.card + .card { margin-top: 22px; }
.card h2 { margin: 0 0 6px; font-size: 1.5rem; }
.card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.feature {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
}
.feature .ico {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255,102,0,0.12);
  border: 1px solid rgba(255,102,0,0.25);
  margin-bottom: 12px;
}
.feature .ico svg {
  width: 22px; height: 22px;
  fill: none; stroke: var(--orange);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* inline glyphs used next to headings / in buttons */
.glyph {
  width: 1.05em; height: 1.05em;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.15em; flex: none;
}
.feature h3 { font-size: 1.1rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 0.98rem; }
.feature .badge {
  display: inline-block; margin-top: 12px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.badge-live { background: rgba(53,208,127,0.15); color: var(--green); border: 1px solid rgba(53,208,127,0.3); }

.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.pill {
  font-size: 0.9rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-dim);
}
.pill .dot { color: var(--orange); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 26px;
  flex-wrap: wrap;
}
.tab {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans);
  color: var(--text-dim);
  font-weight: 600; font-size: 1.02rem;
  padding: 12px 18px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab .count {
  font-size: 0.75rem; margin-left: 7px;
  background: var(--card-2); color: var(--text-dim);
  padding: 1px 8px; border-radius: 999px;
}
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Credential display ---------- */
.cred-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cred-actions .hint { color: var(--text-faint); font-size: 0.95rem; }

.cred-card {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}
.cred-card.flash { animation: mint 1.1s ease; }
@keyframes mint {
  0%   { box-shadow: 0 0 0 0 var(--orange-glow); border-color: var(--orange); }
  30%  { box-shadow: 0 0 34px 6px var(--orange-glow); border-color: var(--orange); }
  100% { box-shadow: 0 0 0 0 rgba(255,102,0,0); border-color: var(--border); }
}
.cred-card .head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 16px 22px;
  background: linear-gradient(90deg, rgba(255,102,0,0.14), transparent);
  border-bottom: 1px solid var(--border);
}
.cred-card .head .title { font-weight: 700; font-size: 1.1rem; }
.cred-card .body { padding: 22px; display: grid; gap: 16px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; align-items: baseline; }
.kv .k { color: var(--text-faint); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
.kv .v { font-family: var(--mono); font-size: 1.05rem; word-break: break-all; }
.kv .v.pw { color: var(--orange-soft); }

/* Countdown */
.countdown-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.countdown {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 18px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--green);
  min-width: 140px; text-align: center;
  transition: color .3s, border-color .3s, box-shadow .3s;
}
.countdown.warn { color: var(--orange); border-color: rgba(255,102,0,0.4); }
.countdown.danger {
  color: var(--red); border-color: rgba(255,92,92,0.5);
  animation: pulse 1s ease-in-out infinite;
}
.countdown.expired { color: var(--text-faint); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,92,92,0.0); }
  50% { box-shadow: 0 0 20px 2px rgba(255,92,92,0.4); }
}
.ttl-bar {
  height: 8px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--border); overflow: hidden; flex: 1; min-width: 180px;
}
.ttl-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft));
  transition: width 1s linear;
}

/* Proof of connection */
.proof {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--card);
  padding: 16px 18px;
}
.proof .proof-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 10px rgba(53,208,127,0.6); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 10px rgba(255,92,92,0.5); }
.sql-line { font-family: var(--mono); font-size: 0.95rem; padding: 3px 0; color: var(--text-dim); }
.sql-line .q { color: var(--orange-soft); }
.sql-line .r { color: var(--text); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
thead th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-2);
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td.mono, .mono { font-family: var(--mono); font-size: 0.9rem; }

.tag { font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: rgba(53,208,127,0.15); color: var(--green); }
.tag.err { background: rgba(255,92,92,0.15); color: var(--red); }

/* ---------- Alerts / empty states ---------- */
.alert {
  border-radius: 12px; padding: 16px 18px; margin-top: 18px;
  border: 1px solid var(--red);
  background: rgba(255,92,92,0.08);
  color: #ffd7d7;
  font-family: var(--mono);
  font-size: 0.95rem;
  white-space: pre-wrap;
  display: none;
}
.alert.show { display: block; }
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: 12px; background: var(--bg-2);
}
.empty .big { font-size: 2rem; margin-bottom: 8px; }

.section-desc { color: var(--text-dim); margin: 0 0 14px; max-width: 720px; }

.config-line {
  font-family: var(--mono); font-size: 0.85rem; color: var(--text-faint);
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft);
}
.config-line b { color: var(--text-dim); font-weight: 600; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; color: var(--text-faint);
  padding: 30px 24px 50px; font-size: 0.95rem;
  border-top: 1px solid var(--border-soft); margin-top: 40px;
}
.footer .adfinis { color: var(--orange-soft); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .wrap { padding: 24px 18px 60px; }
  .nav { padding: 14px 18px; }
}
