:root {
  color-scheme: dark;
  --bg: #060b16;
  --bg-soft: #0b1120;
  --card: rgba(13, 19, 35, 0.82);
  --card-strong: rgba(10, 16, 30, 0.96);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e5ecf7;
  --muted: #9aa8bf;
  --primary: #f59e0b;
  --primary-soft: rgba(245, 158, 11, 0.18);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --neutral-soft: rgba(148, 163, 184, 0.12);
  --shadow-xl: 0 28px 60px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.22);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1360px;
  --font-stack: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(245, 158, 11, 0.08), transparent 24%),
    linear-gradient(180deg, #050814 0%, #070d1a 38%, #091120 100%);
  color: var(--text);
  font-family: var(--font-stack);
}

button,
input {
  font: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.bg-orb,
.app-bg {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: 90px;
  left: -40px;
  background: rgba(245, 158, 11, 0.22);
}

.orb-b {
  width: 340px;
  height: 340px;
  bottom: -40px;
  right: -40px;
  background: rgba(59, 130, 246, 0.18);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.brand-chip,
.eyebrow,
.section-kicker,
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--primary);
}

.lead-text,
.muted-text {
  color: var(--muted);
}

.small-text {
  font-size: 13px;
  line-height: 1.55;
}

.landing-body {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
  gap: 28px;
  align-items: stretch;
}

.landing-showcase,
.login-panel,
.sidebar-card,
.hero-card,
.panel-card,
.summary-card,
.sidebar-brand {
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-xl);
}

.landing-showcase,
.login-panel {
  border-radius: var(--radius-xl);
  padding: 34px;
}

.landing-showcase h1 {
  margin: 18px 0 14px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 12ch;
}

.lead-text {
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 26px;
}

.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.feature-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.feature-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: #ffcf72;
  font-weight: 700;
}

.domain-callout {
  margin-top: 24px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 14px;
}

.domain-callout span {
  color: #ffd089;
}

.login-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
}

.panel-header h2 {
  margin: 8px 0 10px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 14px;
  color: #d7dfeb;
}

input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 15px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 18, 0.7);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder {
  color: #7f8ca5;
}

input:focus {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.inline-error {
  min-height: 20px;
  margin: 0;
  color: #fca5a5;
  font-size: 14px;
}

.login-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 13px 18px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, border-color 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: #1a0f00;
  font-weight: 700;
}

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

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

.app-body {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.app-bg-a {
  width: 340px;
  height: 340px;
  top: -60px;
  right: -80px;
  background: rgba(245, 158, 11, 0.12);
}

.app-bg-b {
  width: 320px;
  height: 320px;
  bottom: -60px;
  left: -60px;
  background: rgba(59, 130, 246, 0.12);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 24px;
}

.sidebar-brand,
.sidebar-card,
.hero-card,
.panel-card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.sidebar-brand h1,
.sidebar-card h2,
.main-header h2,
.hero-card h3,
.section-head h3 {
  margin: 10px 0 8px;
  letter-spacing: -0.03em;
}

.sidebar-brand p,
.sidebar-card p,
.hero-card p {
  line-height: 1.68;
}

.tone-success {
  border-color: rgba(34, 197, 94, 0.26);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(13, 19, 35, 0.92));
}

.tone-warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(13, 19, 35, 0.92));
}

.tone-danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), rgba(13, 19, 35, 0.92));
}

.tone-neutral {
  border-color: var(--line);
}

.mini-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  overflow: hidden;
}

.endpoint-item code {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #dbe6f8;
  font-size: 12px;
}

.main-content {
  display: grid;
  gap: 22px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

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

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.status-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.tone-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.26);
}

.status-pill.tone-warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-pill.tone-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.26);
}

.status-pill.tone-neutral {
  background: var(--neutral-soft);
  border-color: var(--line);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.summary-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.summary-value {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.summary-detail {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head-spread {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.profile-card {
  display: grid;
  gap: 22px;
}

.profile-top {
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile-top h4 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(251, 146, 60, 0.18));
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #ffd492;
  font-size: 24px;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-meta {
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.profile-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.profile-meta strong {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.qr-panel {
  min-height: 100%;
  display: grid;
  gap: 14px;
}

.qr-box,
.empty-state {
  min-height: 332px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 34%),
    rgba(255, 255, 255, 0.02);
}

.qr-image {
  width: min(100%, 290px);
  background: #ffffff;
  padding: 16px;
  border-radius: 20px;
}

.empty-state strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 38ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segment {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
}

.segment.is-active {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
  color: #ffd18a;
}

.messages-list {
  display: grid;
  gap: 14px;
}

.message-card {
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.message-card.is-inbound {
  border-left: 4px solid rgba(59, 130, 246, 0.75);
}

.message-card.is-outbound {
  border-left: 4px solid rgba(245, 158, 11, 0.78);
}

.message-top,
.message-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.message-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-soft {
  background: rgba(255, 255, 255, 0.06);
  color: #dce6f6;
}

.badge-inbound {
  background: rgba(59, 130, 246, 0.18);
  color: #8dc1ff;
}

.badge-outbound {
  background: rgba(245, 158, 11, 0.18);
  color: #ffd18a;
}

.badge-highlight {
  background: rgba(34, 197, 94, 0.16);
  color: #98f1b5;
}

.message-time {
  color: var(--muted);
  font-size: 13px;
}

.message-body {
  margin: 16px 0;
  line-height: 1.7;
  color: #eef3fb;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-footer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 12px;
  z-index: 30;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(11, 17, 32, 0.96);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.28);
}

.toast-danger {
  border-color: rgba(239, 68, 68, 0.28);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .landing-shell,
  .panel-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .action-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .section-head-spread,
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-pill {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .landing-body,
  .app-body {
    padding: 16px;
  }

  .landing-showcase,
  .login-panel,
  .sidebar-brand,
  .sidebar-card,
  .hero-card,
  .panel-card {
    padding: 22px;
  }

  .landing-showcase h1 {
    font-size: 38px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 0;
  }

  .message-top,
  .message-footer {
    align-items: flex-start;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}
