:root {
  --bg: #07111f;
  --bg-soft: #0d1b31;
  --panel: rgba(8, 20, 40, 0.78);
  --panel-strong: rgba(12, 29, 56, 0.92);
  --panel-light: rgba(239, 246, 255, 0.1);
  --line: rgba(148, 190, 255, 0.16);
  --line-strong: rgba(148, 190, 255, 0.28);
  --text: #ebf4ff;
  --muted: #a7bddb;
  --accent: #3b82f6;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --danger: #fca5a5;
  --shadow-lg: 0 30px 80px rgba(1, 8, 20, 0.45);
  --shadow-md: 0 20px 50px rgba(2, 12, 27, 0.3);
  --radius-lg: 28px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: system-ui, "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.24), transparent 24%),
    linear-gradient(180deg, #08111e 0%, #0c1930 45%, #060d18 100%);
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(59, 130, 246, 0.08), transparent 35%),
    radial-gradient(circle at 20% 25%, rgba(125, 211, 252, 0.12), transparent 18%),
    radial-gradient(circle at 78% 18%, rgba(37, 99, 235, 0.16), transparent 20%);
}

body,
input,
button,
textarea {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 0.18rem 0.42rem;
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.55);
  color: #cfe2ff;
}

.site-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(5, 12, 24, 0.5);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: #8ec5ff;
  font-weight: 700;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-nav a,
.nav-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.site-nav a:hover,
.nav-button:hover,
.ghost-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.site-main {
  position: relative;
  flex: 1;
  padding: 2.6rem 0 4rem;
}

.hero-panel-shell,
.empty-state-panel,
.surface-card,
.auth-card,
.status-toast {
  position: relative;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.hero-panel-shell,
.empty-state-panel,
.surface-card,
.auth-card {
  background: linear-gradient(180deg, rgba(10, 21, 41, 0.92), rgba(8, 16, 32, 0.82));
}

.hero-panel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 1.2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.hero-copy-block h1 {
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  line-height: 0.96;
  margin-bottom: 1rem;
}

.hero-copy {
  max-width: 620px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  gap: 1rem;
}

.hero-stat-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(20, 39, 73, 0.92), rgba(9, 18, 36, 0.94));
  border: 1px solid var(--line);
}

.hero-stat-value {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 700;
}

.hero-stat-label,
.tool-role,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: #8ec5ff;
  font-weight: 700;
}

.section-heading,
.section-copy {
  margin-bottom: 1.2rem;
}

.tool-grid,
.management-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.management-grid {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.tool-card,
.surface-card,
.empty-state-panel {
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.tool-card {
  display: grid;
  gap: 0.85rem;
  background: linear-gradient(180deg, rgba(14, 31, 59, 0.94), rgba(8, 17, 35, 0.88));
  border: 1px solid var(--line);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.tool-card-head,
.user-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.tool-card p,
.empty-state-panel p,
.section-copy p,
.user-meta p,
.auth-copy {
  color: var(--muted);
  line-height: 1.7;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #d9ecff;
  font-size: 0.73rem;
  font-weight: 700;
}

.tool-badge-alert {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(29, 78, 216, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(29, 78, 216, 0.32);
}

.auth-shell {
  min-height: calc(100vh - 8.5rem);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(560px, 100%);
  padding: 2rem;
  border-radius: 32px;
}

.auth-card-wide {
  display: grid;
  gap: 1.5rem;
}

.auth-form,
.field-grid,
.user-list,
.user-actions,
.locust-form-stack {
  display: grid;
  gap: 0.9rem;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.auth-form label,
.field-group label,
.form-label {
  font-weight: 600;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"],
.form-input,
textarea.form-input {
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(3, 10, 22, 0.76);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.auth-form input:focus,
.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.95);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.remember-me,
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-weight: 600;
}

.toggle-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.toggle-chip {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.toggle-chip input {
  margin: 0;
}

.validation-summary,
.field-error,
.text-danger,
.validation-summary-errors {
  color: var(--danger);
}

.validation-summary ul,
.validation-summary-errors ul {
  margin: 0;
  padding-left: 1rem;
}

.toast-stack {
  position: sticky;
  top: 5.25rem;
  z-index: 50;
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-toast {
  width: min(520px, 100%);
  margin-left: auto;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 34, 68, 0.96), rgba(9, 21, 42, 0.96));
}

.status-toast p {
  color: var(--muted);
}

.status-toast-warning {
  border-color: rgba(250, 204, 21, 0.3);
  background: linear-gradient(180deg, rgba(62, 46, 9, 0.98), rgba(39, 29, 6, 0.96));
}

.user-list {
  gap: 1rem;
}

.user-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.user-meta strong {
  font-size: 1.05rem;
}

.user-actions {
  align-content: start;
}

.ghost-button {
  width: 100%;
  border-color: var(--line);
}

.error-panel {
  max-width: 720px;
  margin: 4rem auto 0;
}

.locust-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 1.2rem;
}

.locust-control-card,
.locust-frame-card {
  min-height: 320px;
}

.locust-studio-card {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(11, 24, 46, 0.96), rgba(6, 14, 28, 0.92));
}

.locust-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.locust-panel-head h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

.locust-panel-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: rgba(59, 130, 246, 0.12);
  color: #dbeeff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locust-panel-copy {
  margin-bottom: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

.locust-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.locust-form-section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 190, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.locust-form-section-wide {
  grid-column: 1 / -1;
}

.locust-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.locust-section-title-row h3 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.locust-section-kicker {
  display: inline-block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: #8ec5ff;
  font-weight: 700;
}

.locust-input-strong {
  min-height: 56px;
  font-size: 1rem;
  background: rgba(5, 14, 28, 0.92);
}

.locust-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.locust-paths-section {
  margin-top: 0.2rem;
}

.locust-path-help {
  color: var(--muted);
  font-size: 0.96rem;
}

.locust-path-list {
  display: grid;
  gap: 0.75rem;
}

.locust-path-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.locust-path-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #dbeeff;
  font-weight: 700;
}

.locust-path-input {
  min-height: 50px;
}

.locust-add-path-button,
.locust-remove-path-button {
  width: auto;
}

.locust-remove-path-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.locust-actions {
  display: grid;
  gap: 0.8rem;
}

.locust-actions-wide {
  margin-top: 0.35rem;
}

.locust-actions-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.locust-session-strip {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.locust-target-value {
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.4;
}

.locust-frame {
  width: 100%;
  min-height: 780px;
  border: 0;
  border-radius: 18px;
  background: rgba(3, 10, 22, 0.76);
}

.locust-empty {
  min-height: 100%;
  display: grid;
  place-content: center;
}

@media (max-width: 920px) {
  .hero-panel-shell,
  .management-grid,
  .field-grid,
  .user-row,
  .locust-layout,
  .locust-form-grid,
  .locust-mini-grid,
  .locust-actions-split {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header-inner {
    align-items: start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
  }

  .user-actions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .locust-frame {
    min-height: 640px;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 1rem, 1180px);
  }

  .site-main {
    padding-top: 1.6rem;
  }

  .hero-panel-shell,
  .tool-card,
  .surface-card,
  .empty-state-panel,
  .auth-card,
  .locust-form-section {
    padding: 1.15rem;
    border-radius: 22px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .hero-copy-block h1 {
    font-size: 2.4rem;
  }

  .status-toast {
    width: 100%;
  }

  .locust-panel-head,
  .locust-path-row,
  .locust-section-title-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .locust-path-row {
    gap: 0.55rem;
  }
}

/* ─── Active nav indicator ─────────────────────────────────────────────────── */

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
}

/* ─── Danger button ─────────────────────────────────────────────────────────── */

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.danger-button:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

/* ─── Button loading / disabled states ─────────────────────────────────────── */

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.primary-button[data-loading],
.ghost-button[data-loading],
.danger-button[data-loading] {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(5, 12, 24, 0.45);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* ─── Dashboard empty state gap ────────────────────────────────────────────── */

.hero-panel-shell + .empty-state-panel {
  margin-top: 1.6rem;
}

/* ─── Status toast success variant ─────────────────────────────────────────── */

.status-toast-success {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(180deg, rgba(5, 46, 22, 0.97), rgba(3, 28, 13, 0.95));
}

/* ─── User row locked badge alignment ──────────────────────────────────────── */

.user-badge-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.user-email {
  font-size: 0.9rem;
}
