/* Look and feel of the GLBNXT portals: the tokens, fonts and component sizes
   of @glbnxt/ui (shadcn/ui), written out as plain CSS. */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 600; font-display: swap; src: url('fonts/Archivo-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Red Hat Mono'; font-weight: 400; font-display: swap; src: url('fonts/RedHatMono-Regular.ttf') format('truetype'); }

:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(222.2 84% 4.9%);
  --card: hsl(0 0% 100%);
  --muted: hsl(210 40% 96%);
  --muted-foreground: hsl(215.4 16.3% 46.9%);
  --accent: hsl(210 40% 96%);
  --border: hsl(214.3 31.8% 91.4%);
  --destructive: hsl(0 84.2% 60.2%);
  --success: hsl(142 71% 45%);
  --primary: hsl(221.2 83.2% 53.3%);
  --primary-foreground: hsl(210 40% 98%);
  --radius: 0.5rem;
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Red Hat Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-heading: 'Archivo', 'Inter', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(222.2 84% 4.9%);
    --foreground: hsl(210 40% 98%);
    --card: hsl(222.2 84% 4.9%);
    --muted: hsl(217.2 32.6% 17.5%);
    --muted-foreground: hsl(215 20.2% 65.1%);
    --accent: hsl(217.2 32.6% 17.5%);
    --border: hsl(217.2 32.6% 17.5%);
    --destructive: hsl(0 72% 60%);
  }
}

* { box-sizing: border-box; border-color: var(--border); }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 400 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; margin: 0; }

a { color: var(--primary); }

code, pre { font-family: var(--font-mono); }

code {
  background: var(--muted);
  border-radius: calc(var(--radius) - 4px);
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

pre {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--muted);
  border-radius: calc(var(--radius) - 2px);
  overflow-x: auto;
  font-size: 13px;
}

[hidden] { display: none !important; }

.muted { color: var(--muted-foreground); margin: 0; }
.small { font-size: 0.875rem; }
.error { color: var(--destructive); margin: 0.75rem 0 0; }

[data-icon] { display: inline-flex; flex-shrink: 0; }
[data-icon] svg { width: 1rem; height: 1rem; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* Layout: page header on top, section menu on the left, content on the
   right. Same as the customer page in the Management Portal. */
.container { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }

.top { margin-bottom: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }
.logo { width: 1.5rem; height: 1.5rem; }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; }
.title-row h1 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; letter-spacing: -0.025em; }
.title-row .badge { transform: translateY(-2px); }
.top .muted { margin-top: 0.5rem; }

.columns { display: flex; flex-direction: column; gap: 1.5rem; }

.nav-column { width: 100%; flex-shrink: 0; }

.section-nav { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; }
.nav-group + .nav-group { margin-top: 0.75rem; }
.nav-group { display: flex; flex-direction: column; gap: 0.125rem; }
.nav-title {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  color: var(--foreground);
  text-decoration: none;
}
.nav-item [data-icon] { color: var(--muted-foreground); }
.nav-item:hover { background: var(--muted); }
.nav-item[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
}
.nav-item[aria-current="page"] [data-icon] { color: var(--primary); }

.main { min-width: 0; flex: 1; }

.page { display: flex; flex-direction: column; gap: 1.5rem; }

.page-header { display: flex; flex-direction: column; gap: 0.375rem; }
.page-header h2 { font-size: 1.5rem; line-height: 2rem; }
.page-header .muted { max-width: 48rem; }

@media (min-width: 1024px) {
  .columns { flex-direction: row; }
  .nav-column { width: 15rem; }
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.card-header { padding: 1.5rem 1.5rem 0; display: flex; flex-direction: column; gap: 0.375rem; }
.card-title { font-size: 1.125rem; line-height: 1.4; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.card-description { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
.card-content { padding: 1.5rem; }
.card-content.flush { padding: 0; }
.card-content > p { margin: 0 0 0.5rem; }
.card-content > p:last-child { margin-bottom: 0; }

.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.hero-content .muted { margin-top: 0.375rem; max-width: 36rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.625rem 2rem; margin: 0; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: 0.375rem; padding: 1.25rem; color: inherit; text-decoration: none; }
a.tile { transition: border-color .15s, box-shadow .15s; }
a.tile:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: 0 4px 12px -4px rgb(0 0 0 / 0.1); }
.tile-icon { color: var(--primary); margin-bottom: 0.25rem; }
.tile-icon svg { width: 1.25rem; height: 1.25rem; }
.tile-title { font-weight: 600; }

.step-number {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.125rem 0.625rem;
  font: 600 0.75rem/1.25rem var(--font-sans);
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge.success { background: hsl(141 84% 93%); color: hsl(144 61% 20%); gap: 0.375rem; }
.badge.secondary { background: var(--muted); color: var(--foreground); }
@media (prefers-color-scheme: dark) {
  .badge.success { background: hsl(144 61% 20% / 0.4); color: hsl(141 79% 85%); }
}

.steps, .list { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { height: 3rem; padding: 0 1rem; text-align: left; font-weight: 500; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
td { padding: 1rem; vertical-align: top; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.warn { color: var(--destructive); font-size: 0.8125rem; margin-top: 0.25rem; }

/* Form controls */
.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.input {
  flex: 1 1 14rem;
  min-width: 0;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font: 500 0.875rem var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { background: color-mix(in srgb, var(--primary) 90%, black); }
.button.ghost { background: transparent; color: var(--foreground); }
.button.ghost:hover { background: var(--accent); }
.button.icon-only { width: 2.5rem; padding: 0; }

.button:focus-visible, .input:focus-visible, .menu-item:focus-visible, a.tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.inline-icon { color: var(--success); }

/* Toast, bottom right, like the portal */
.toaster { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px -6px rgb(0 0 0 / 0.18);
  animation: toast-in .25s ease-out;
}
.toast [data-icon] { color: var(--success); margin-top: 0.125rem; }
.toast-title { font-weight: 600; }
.toast-text { color: var(--muted-foreground); font-size: 0.8125rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.5rem); } }

@media (max-width: 767px) {
  .title-row h1 { font-size: 1.5rem; line-height: 2rem; }
  .toaster { right: 1rem; left: 1rem; bottom: 1rem; }
  .toast { width: auto; }
}

.status-dot { width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; }
