
/* Modern, minimal UI inspired by ChatGPT */
:root {
  --bg: #0b0f14;
  --surface: #11161c;
  --muted-surface: #0f141a;
  --border: #222b36;
  --text: #e6edf3;
  --text-muted: #9fb0c0;
  --accent: #10a37f;
  --accent-hover: #0e8e70;
  --danger: #e5534b;
  --warning: #e6a700;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 10% -10%, #12202b 0%, var(--bg) 45%) no-repeat fixed;
  background-color: var(--bg);
  color: var(--text);
  /* Sticky footer layout */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ensure overscroll shows dark background on all pages */
html { background-color: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 20, 26, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand a { color: var(--text); text-decoration: none; }

.page {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 20px 40px;
}

.page.center {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 64px);
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--muted-surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h2 { margin: 0 0 10px; font-size: 18px; }
.muted { color: var(--text-muted); }

.btn, input[type="submit"], button {
  appearance: none;
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .02s ease;
}
.btn:hover, input[type="submit"]:hover, button:hover { background: var(--accent-hover); }
.btn:active, input[type="submit"]:active, button:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); }

.plain-link { border: none !important; background: transparent !important; padding: 0 !important; color: var(--text); cursor: pointer; }
.plain-link:hover { text-decoration: underline; }

/* Small, red, link-like destructive action */
.link-danger { border: none !important; background: transparent !important; padding: 0 !important; color: var(--danger) !important; cursor: pointer; font-size: 12px; }
.link-danger:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label { color: var(--text-muted); font-size: 13px; }
input[type="text"], input[type="password"], input[type="email"], select, input[type="number"] {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0e141a;
  color: var(--text);
}

.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.key-item {
  background: #0e141a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.key-item p { margin: 4px 0; }
.remove-key-button { background: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
thead th { color: var(--text-muted); font-weight: 600; }

.centered {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 12px; }

a { color: var(--text); text-decoration: none; opacity: 0.85; }
a:hover { opacity: 1; }

.notice { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #0f171f; }

#creditDisplay { display: flex; flex-direction: column; gap: 6px; }

/* Emphasized BTC balance display */
.usd-amount {
  display: block;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.2px;
  margin: 6px 0 2px;
}
.usd-amount .unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Topbar separator between nav and auth status */
.topbar-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 12px;
  vertical-align: middle;
}

/* Service status label next to title */
.status-label {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.status-label.active { color: var(--accent); }
.status-label.disabled { color: var(--danger); }

/* Tabs */
.tabs { display:flex; gap:16px; border-bottom:1px solid var(--border); margin-bottom:10px; }

/* Force tab buttons to be line-style (no pill/bubble), overriding global button styles */
button.tab-btn, button.tab-btn:hover, button.tab-btn:focus, button.tab-btn:active {
  appearance: none;
  background: transparent !important;
  color: var(--text-muted) !important;
  border: none !important;
  padding: 8px 2px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  position: relative;
}
button.tab-btn.active { color: var(--text) !important; }
button.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

/* Big user price under title */
.big-price {
  font-size: 32px;
  font-weight: 800;
  margin: 4px 0 0;
}

/* Status dot for lists */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}
.status-dot.active { background: var(--accent); }
.status-dot.disabled { background: var(--danger); }

.service-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0e141a;
  cursor: pointer;
}
.service-main, .service-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.service-row1 { justify-content: space-between; }
.service-row1-left { display:flex; align-items:center; gap:10px; }
.service-row1-left .line1 { display:flex; align-items:center; gap:10px; }
.status-line { display:flex; align-items:center; gap:6px; font-size: 12px; color: var(--text-muted); }
.service-row2 { display:flex; align-items:center; justify-content: space-between; gap: 12px; }
.service-meta { color: var(--text-muted); font-size: 13px; }
.service-name { font-weight: 700; }
.service-price { font-weight: 700; color: var(--text); }
.service-price-small { font-weight: 700; color: var(--text); font-size: 14px; opacity: 0.95; }
.status-text.active { color: var(--accent); }
.status-text.disabled { color: var(--danger); }
.service-hash { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; opacity: 0.9; }
.service-date { color: var(--text-muted); font-size: 12px; }
.row2-left { display:flex; align-items:center; gap: 8px; }
.row2-left .spacer { display:inline-block; width: 20px; }
.row2-right { display:flex; align-items:center; gap: 10px; }

/* Circular icon button for Add Service */
.circle-btn {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  min-width: 0 !important;
  white-space: normal !important;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.sep-dot, .sep-pipe { color: var(--text-muted); opacity: 0.9; }
.sep-dot { margin: 0 8px; }
.sep-pipe { margin: 0 10px; }

/* Bubble back button + container */
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}
.bubble-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0f171f;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  opacity: 0.95;
}
.bubble-btn:hover {
  opacity: 1;
}

/* Site footer (always at bottom) */
.site-footer {
  margin-top: auto;
  background: rgba(15, 20, 26, 0.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
