/* Xtremio 2 — broadcast control surface */
:root {
  --bg: #07080c;
  --bg-elev: #10131a;
  --bg-elev-2: #161b25;
  --bg-soft: rgba(16, 19, 26, 0.78);
  --line: rgba(232, 238, 246, 0.08);
  --line-strong: rgba(232, 238, 246, 0.16);
  --text: #e8eef6;
  --text-dim: #9aa3b5;
  --muted: #6f788a;
  --cyan: #3ee0ff;
  --cyan-2: #7af0ff;
  --violet: #8b7cff;
  --ok: #3ee8a0;
  --warn: #ffc14a;
  --bad: #ff5d6c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Syne", "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar: 64px;
  --focus: 0 0 0 3px rgba(62, 224, 255, 0.28);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  min-height: 100vh;
  color: var(--text);
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--cyan-2);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(62, 224, 255, 0.28);
  color: #fff;
}

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
}

.bg-glow-a {
  top: -22vw;
  left: -12vw;
  background: radial-gradient(circle, #1a6b88 0%, transparent 70%);
}

.bg-glow-b {
  right: -18vw;
  bottom: -24vw;
  background: radial-gradient(circle, #3a2d88 0%, transparent 70%);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 8, 12, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a,
.nav-link {
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a:hover,
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav a.is-active {
  color: var(--text);
  background: rgba(62, 224, 255, 0.08);
}

/* Layout */
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.shell-narrow {
  width: min(520px, calc(100% - 40px));
}

.hero {
  margin-bottom: 28px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--cyan);
}

h1,
.h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
  font-weight: 700;
}

h2,
.h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.lede {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0;
}

/* Panels */
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.15);
}

.panel-pad {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 46px;
  background: #0b0e14;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(62, 224, 255, 0.7);
  box-shadow: var(--focus);
}

.input-row {
  display: flex;
  align-items: stretch;
}

.input-row .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.input-row .icon-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0b0e14;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: rgba(62, 224, 255, 0.12);
}

.icon-btn.is-ok {
  color: var(--ok);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%239aa3b5' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  color: inherit;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--cyan);
  color: #041016;
}

.btn-primary:hover {
  background: var(--cyan-2);
  color: #041016;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-ok {
  background: transparent;
  border-color: rgba(62, 232, 160, 0.45);
  color: var(--ok);
}

.btn-ok:hover {
  background: var(--ok);
  color: #041016;
}

.btn-warn {
  background: transparent;
  border-color: rgba(255, 193, 74, 0.45);
  color: var(--warn);
}

.btn-warn:hover {
  background: var(--warn);
  color: #041016;
}

.btn-bad {
  background: transparent;
  border-color: rgba(255, 93, 108, 0.45);
  color: var(--bad);
}

.btn-bad:hover {
  background: var(--bad);
  color: #fff;
}

.btn-block {
  width: 100%;
}

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

.actions .btn {
  flex: 1;
  min-width: 140px;
}

/* Status */
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(111, 120, 138, 0.12);
}

.led-ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(62, 232, 160, 0.14);
}

.led-bad {
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(255, 93, 108, 0.14);
}

.led-warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(255, 193, 74, 0.14);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-ok {
  color: var(--ok);
  border-color: rgba(62, 232, 160, 0.3);
}

.chip-bad {
  color: var(--bad);
  border-color: rgba(255, 93, 108, 0.3);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.stat span {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--cyan-2);
}

.empty {
  color: var(--text-dim);
  text-align: center;
  padding: 28px 12px;
}

.empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--display);
}

.hr {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 16px 0;
}

/* Credential rows */
.cred {
  display: grid;
  gap: 12px;
}

.paste-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.paste-bar .input {
  flex: 1;
}

/* Result list */
.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  padding: 14px;
}

.result-card h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

/* Login split */
.split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.brand-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.brand-pane h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  max-width: 8ch;
}

.points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  color: var(--text-dim);
}

.points li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.points li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex: none;
}

.form-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.form-card {
  width: min(420px, 100%);
}

/* Alerts */
.alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  margin-bottom: 14px;
  border: 1px solid;
}

.alert-bad {
  background: rgba(255, 93, 108, 0.08);
  border-color: rgba(255, 93, 108, 0.35);
  color: #ffb4bc;
}

.alert-ok {
  background: rgba(62, 232, 160, 0.08);
  border-color: rgba(62, 232, 160, 0.35);
  color: #b8f8dc;
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  background: #141821;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease;
}

.toast-ok {
  border-color: rgba(62, 232, 160, 0.4);
}

.toast-bad {
  border-color: rgba(255, 93, 108, 0.45);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(4, 16, 22, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
}

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

.center {
  text-align: center;
}

.mt {
  margin-top: 16px;
}

/* 404 */
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.error-page .code-big {
  font-family: var(--display);
  font-size: 6rem;
  letter-spacing: -0.08em;
  line-height: 1;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 880px) {
  .workspace,
  .grid-2,
  .split {
    grid-template-columns: 1fr;
  }

  .brand-pane {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  h1,
  .h1 {
    font-size: 2rem;
  }
}
