/* HostKB Managed Databases — visual system */
:root {
  --ink: #0c1222;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --teal: #0f766e;
  --teal-deep: #0a5c56;
  --teal-soft: #ccfbf1;
  --amber: #d97706;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #a16207;
  --info: #0369a1;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(217, 119, 6, 0.08), transparent 50%),
    linear-gradient(180deg, #f4f7f6 0%, #eef2f1 45%, #f8faf9 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  z-index: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

/* —— Nav —— */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
}

.topnav-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
}

.brand-mark span {
  color: var(--teal);
}

.brand-product {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-deep);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 4.1rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }
}

/* —— Typography / motion —— */
.page-enter {
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 36rem;
}

/* —— Hero (landing) —— */
.hero {
  display: grid;
  gap: 1.5rem;
  padding: 2.5rem 0 1rem;
  min-height: min(70vh, 560px);
  align-content: center;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 0;
}

.hero-brand em {
  font-style: normal;
  color: var(--teal);
}

.hero-copy {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 28rem;
  margin: 0;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hero-plane {
  margin-top: 1.5rem;
  height: 160px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(15, 23, 42, 0.04) 40%, rgba(217, 119, 6, 0.12)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.35) 12px,
      rgba(255, 255, 255, 0.35) 13px
    );
  box-shadow: var(--shadow);
  animation: fade-in 1s ease 0.15s both;
  position: relative;
  overflow: hidden;
}

.hero-plane::after {
  content: "PostgreSQL  ·  MySQL";
  position: absolute;
  left: 1.25rem;
  bottom: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

/* —— Panels / forms —— */
.panel {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0 0 0.35rem;
}

.panel-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-head h1,
.page-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.35rem;
}

.auth-shell {
  width: min(420px, 100%);
  margin: 2rem auto;
  animation: rise 0.5s ease both;
}

.auth-shell h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.form-control,
.form-select {
  border-radius: 10px !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  padding: 0.65rem 0.8rem !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18) !important;
}

/* —— Buttons —— */
.btn {
  border-radius: 999px !important;
  font-weight: 600 !important;
  padding: 0.55rem 1.15rem !important;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: var(--teal-deep) !important;
  border-color: var(--teal-deep) !important;
}

.btn-outline-primary {
  color: var(--teal-deep) !important;
  border-color: rgba(15, 118, 110, 0.35) !important;
}

.btn-outline-primary:hover {
  background: var(--teal-soft) !important;
  color: var(--teal-deep) !important;
}

.btn-sm {
  padding: 0.3rem 0.75rem !important;
  font-size: 0.82rem !important;
}

.btn-success {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
}

.btn-outline-danger {
  color: var(--danger) !important;
  border-color: rgba(185, 28, 28, 0.35) !important;
}

/* —— Status pills —— */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.status-awaiting { background: #fef3c7; color: var(--warn); }
.status-queued,
.status-provisioning { background: #e0f2fe; color: var(--info); }
.status-active { background: #dcfce7; color: var(--ok); }
.status-failed,
.status-rejected { background: #fee2e2; color: var(--danger); }
.status-deleting,
.status-deleted { background: #f1f5f9; color: var(--muted); }

/* —— Tables —— */
.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.table {
  margin: 0 !important;
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 650;
  border-bottom-color: var(--line) !important;
  background: rgba(248, 250, 249, 0.9);
}

.table td {
  vertical-align: middle;
  border-color: var(--line) !important;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(15, 118, 110, 0.04);
}

/* —— Alerts —— */
.alert {
  border-radius: 12px !important;
  border: 1px solid var(--line) !important;
  animation: rise 0.35s ease both;
}

.alert-danger { background: #fef2f2 !important; color: var(--danger) !important; }
.alert-success { background: #f0fdf4 !important; color: var(--ok) !important; }
.alert-warning { background: #fffbeb !important; color: var(--warn) !important; }
.alert-info { background: #f0f9ff !important; color: var(--info) !important; }

/* —— Details / connection —— */
.mono-box {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #0c1222;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  border: none;
  width: 100%;
  resize: vertical;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.meta-item {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.meta-item .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.meta-item .value {
  font-weight: 650;
  color: var(--ink);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--teal-deep);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--font-display);
  margin-bottom: 0.35rem;
}

.layout-split {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 992px) {
  .layout-split {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    align-items: start;
  }
}

.sso-pulse {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 3px solid var(--teal-soft);
  border-top-color: var(--teal);
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
