/* License server — UI */
:root {
  --bg-deep: #080c12;
  --bg: #0c1219;
  --surface: #131b26;
  --surface2: #1a2433;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf5;
  --muted: #8b9aaf;
  --accent: #7c6cf0;
  --accent2: #4ad4c9;
  --danger: #f4727a;
  --ok: #4ade80;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
}

.page {
  min-height: 100vh;
}

.page--home {
  background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 108, 240, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(74, 212, 201, 0.12), transparent 50%), var(--bg-deep);
}

.page--admin,
.page--install {
  background: linear-gradient(165deg, var(--bg-deep) 0%, #0a1018 40%, var(--bg) 100%);
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.shell--wide {
  max-width: 1200px;
}

.card {
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.card--narrow {
  max-width: 420px;
  margin: 0 auto;
}

.card--center {
  margin-top: 10vh;
}

.card--hint {
  background: rgba(124, 108, 240, 0.06);
  border-color: rgba(124, 108, 240, 0.2);
}

.card--table {
  margin-top: 1.5rem;
  padding: 0;
  overflow: hidden;
}

.card--table .h2 {
  padding: 1.25rem 1.5rem 0;
  margin: 0 0 0.5rem;
}

.h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.mt {
  margin-top: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.brand__mark {
  color: var(--accent2);
  font-size: 1.25rem;
  line-height: 1;
}

.brand__text {
  background: linear-gradient(90deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
}

.input:focus {
  outline: none;
  border-color: rgba(124, 108, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.15);
}

.input--select {
  max-width: 280px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #5b4fd4);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 108, 240, 0.35);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--danger {
  background: rgba(244, 114, 122, 0.15);
  border-color: rgba(244, 114, 122, 0.35);
  color: #fecdd3;
}

.btn--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert--ok {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #bbf7d0;
}

.alert--err {
  background: rgba(244, 114, 122, 0.12);
  border: 1px solid rgba(244, 114, 122, 0.25);
  color: #fecdd3;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.stat--accent {
  border-color: rgba(124, 108, 240, 0.35);
  background: linear-gradient(160deg, rgba(124, 108, 240, 0.12), var(--surface));
}

.stat--muted {
  opacity: 0.9;
}

.stat__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.key-cell {
  font-size: 0.78rem;
  word-break: break-all;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(124, 108, 240, 0.15);
  border: 1px solid rgba(124, 108, 240, 0.25);
  font-size: 0.75rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.badge--ok {
  background: rgba(74, 222, 128, 0.15);
  color: #bbf7d0;
}

.badge--off {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.codeblock {
  display: block;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  word-break: break-all;
  margin: 0.5rem 0 0;
}

.inline {
  display: inline;
}

.center {
  text-align: center;
}

/* Landing */
.hero {
  position: relative;
  min-height: 100vh;
}

.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 108, 240, 0.25), transparent);
  pointer-events: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 3rem;
}

.nav__links {
  display: flex;
  gap: 0.5rem;
}

.hero__content {
  max-width: 640px;
  padding: 2rem 0 4rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin: 0 0 0.75rem;
}

.hero__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.04em;
}

.hero__lead {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.feature-card {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(19, 27, 38, 0.65);
  backdrop-filter: blur(8px);
}

.feature-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.feature-card__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.card--setup {
  max-width: 720px;
  margin: 2rem auto 0;
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}

.legend {
  padding: 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.setup-grid .inst-field {
  margin-bottom: 0.75rem;
}

.setup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .setup-row {
    grid-template-columns: 1fr;
  }
}

.inst-field--narrow {
  max-width: 140px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.75rem 0;
  cursor: pointer;
}

.check-row input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.api-urls-panel {
  margin-top: 0.75rem;
}

.copy-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.codeblock--grow {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.mt-0 {
  margin-top: 0 !important;
}

@media (max-width: 520px) {
  .form--row {
    flex-direction: column;
    align-items: stretch;
  }
  .input--select {
    max-width: none;
  }
}
