:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #030506;
  --bg-2: #07100f;
  --ink: #f5f7ef;
  --muted: #aab3ac;
  --soft: #d7dfd5;
  --line: rgba(245, 247, 239, 0.14);
  --panel: rgba(8, 14, 14, 0.82);
  --panel-strong: rgba(13, 22, 21, 0.94);
  --yellow: #f7ff2f;
  --teal: #00d4b1;
  --danger: #ff747b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(3, 5, 6, 0.96), rgba(7, 16, 15, 0.98)),
    var(--bg);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  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: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 82%);
}

a {
  color: inherit;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(245, 247, 239, 0.16);
  border-radius: 7px;
  background: rgba(2, 3, 3, 0.62);
  color: var(--ink);
  padding: 13px 14px;
}

input,
select {
  min-height: 48px;
}

input[readonly] {
  color: var(--muted);
  background: rgba(245, 247, 239, 0.05);
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(247, 255, 47, 0.34);
  outline-offset: 2px;
  border-color: var(--yellow);
}

button {
  min-height: 42px;
  border: 1px solid rgba(247, 255, 47, 0.42);
  border-radius: 6px;
  background: rgba(247, 255, 47, 0.08);
  color: var(--yellow);
  padding: 0 15px;
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  border-color: var(--yellow);
  background: rgba(247, 255, 47, 0.16);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 0.98;
  text-transform: uppercase;
}

h2 {
  font-size: 22px;
  line-height: 1.12;
}

h3 {
  margin-top: 18px;
  font-size: 15px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 17px;
  border: 1px solid rgba(245, 247, 239, 0.14);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sidebar-head {
  display: grid;
  gap: 14px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.auth-brand::before {
  content: "UAT";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-size: 10px;
}

.language-switcher {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(245, 247, 239, 0.16);
  border-radius: 999px;
  background: rgba(2, 3, 3, 0.58);
  padding: 3px;
}

.language-option {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: none;
}

.language-option:hover,
.language-option.is-active {
  background: var(--yellow);
  color: #050604;
}

.eyebrow {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-summary {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(245, 247, 239, 0.14);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.055);
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
}

.auth-summary strong {
  color: var(--ink);
}

.primary-action {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #050604;
}

.primary-action:hover {
  background: #ffff69;
  color: #050604;
}

.secondary-action {
  color: var(--soft);
  border-color: rgba(245, 247, 239, 0.18);
  background: rgba(245, 247, 239, 0.06);
}

.subtle-link {
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  border-right: 1px solid rgba(245, 247, 239, 0.1);
  background: rgba(3, 5, 6, 0.82);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.dashboard-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.dashboard-nav a {
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--soft);
  padding: 0 11px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-nav a:hover,
.dashboard-nav a.is-active {
  border-color: rgba(247, 255, 47, 0.28);
  background: rgba(247, 255, 47, 0.08);
  color: var(--yellow);
}

.dashboard-main {
  width: min(1220px, 100%);
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 28px;
}

.dashboard-topbar,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-topbar {
  border-bottom: 1px solid rgba(245, 247, 239, 0.1);
  padding-bottom: 18px;
}

.dashboard-page {
  display: grid;
  gap: 18px;
}

.page-intro {
  display: grid;
  gap: 7px;
  max-width: 720px;
}

.page-intro p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.overview-column {
  display: grid;
  gap: 18px;
}

.dashboard-panel {
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(0, 212, 177, 0.12);
  color: var(--teal);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  text-transform: capitalize;
  white-space: nowrap;
}

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

.stat-tile {
  min-width: 0;
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.055);
  padding: 13px;
}

.stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-tile strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 20px;
}

.referral-share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 16px;
}

.referral-share-box .form-message {
  grid-column: 1 / -1;
  color: var(--yellow);
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.order-form {
  margin-top: 0;
}

.order-form > label {
  grid-column: 1 / -1;
}

.model-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.model-option-card {
  position: relative;
  display: grid;
  min-width: 0;
}

.model-option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-option-content {
  min-height: 122px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.045);
  padding: 12px;
  cursor: pointer;
}

.model-option-card input:checked + .model-option-content {
  border-color: rgba(247, 255, 47, 0.56);
  background: rgba(247, 255, 47, 0.09);
  box-shadow: 0 0 0 1px rgba(247, 255, 47, 0.18);
}

.model-option-card input:disabled + .model-option-content {
  cursor: not-allowed;
  opacity: 0.58;
}

.model-option-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.model-option-topline strong {
  color: var(--yellow);
  font-size: 15px;
  font-weight: 950;
}

.model-option-topline em,
.model-option-lock {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.model-option-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.model-option-meta {
  align-self: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: auto;
  order: 3;
  text-align: right;
}

.model-option-lock {
  order: 2;
}

.order-summary {
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.05);
  padding: 14px;
}

.order-summary h3 {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-summary h3 + .stats-grid,
.order-summary h3 + .rule-summary,
.order-summary h3 + #new-challenge-rules {
  margin-top: 12px;
}

.order-summary .stats-grid {
  margin-bottom: 18px;
}

.rule-summary {
  display: grid;
  gap: 12px;
}

.rule-summary h4 {
  margin: 4px 0 0;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.rule-summary-grid {
  display: grid;
  gap: 8px;
}

.rule-summary-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(245, 247, 239, 0.1);
  border-radius: 7px;
  background: rgba(2, 3, 3, 0.28);
  padding: 10px;
}

.rule-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.rule-summary-grid strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.alpha-levels {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(245, 247, 239, 0.1);
  border-radius: 7px;
}

.alpha-levels table {
  min-width: 0;
}

.alpha-levels th,
.alpha-levels td {
  padding: 8px;
  font-size: 12px;
}

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

.payment-address-list div {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(247, 255, 47, 0.38);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(247, 255, 47, 0.12), rgba(0, 212, 177, 0.08)),
    rgba(245, 247, 239, 0.06);
  box-shadow:
    0 0 0 1px rgba(247, 255, 47, 0.08),
    0 16px 36px rgba(0, 0, 0, 0.24);
  padding: 14px;
}

.payment-address-list span {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.payment-address-list code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.payment-address-note {
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: rgba(247, 255, 47, 0.06);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 12px;
  padding: 10px 12px;
}

.api-order-card {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr));
  gap: 10px;
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.05);
  padding: 12px;
}

.api-order-card + .api-order-card {
  margin-top: 10px;
}

.api-order-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.api-order-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-order-card strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.api-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.api-status-badge.is-bound {
  background: var(--teal);
  color: #03100d;
  box-shadow: 0 0 0 1px rgba(0, 212, 177, 0.36);
}

.api-status-badge.is-ready {
  background: var(--yellow);
  color: #111403;
  box-shadow: 0 0 0 1px rgba(247, 255, 47, 0.36);
}

.api-key-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(245, 247, 239, 0.18);
  border-radius: 6px;
  background: rgba(2, 3, 3, 0.48);
  padding: 0 9px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.dashboard-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dashboard-form .wide-field,
.dashboard-form .check-row,
.dashboard-form button,
.dashboard-form .form-message,
.dashboard-form .kyc-address-note {
  grid-column: 1 / -1;
}

.profile-form {
  margin-top: 14px;
}

.kyc-address-note {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(247, 255, 47, 0.26);
  border-radius: 7px;
  background: rgba(247, 255, 47, 0.07);
  color: var(--soft);
  padding: 12px;
  font-size: 13px;
}

.kyc-address-note strong {
  color: var(--yellow);
}

.embedded-chart {
  margin-top: 32px;
}

.embedded-chart h3 {
  margin: 0 0 6px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.file-upload input[type="file"] {
  min-height: auto;
  padding: 11px;
}

.attachment-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.equity-chart {
  margin-top: 10px;
  border: 1px solid rgba(245, 247, 239, 0.1);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(0, 212, 177, 0.08), rgba(247, 255, 47, 0.035)),
    rgba(2, 3, 3, 0.44);
  padding: 16px;
}

.equity-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.equity-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.equity-area {
  fill: rgba(0, 212, 177, 0.14);
}

.equity-line {
  fill: none;
  stroke: var(--yellow);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.equity-dot {
  fill: var(--teal);
  stroke: #03100f;
  stroke-width: 2;
}

.kyc-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.kyc-flow div {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(245, 247, 239, 0.12);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.05);
  padding: 12px;
}

.kyc-flow span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #050604;
  font-size: 12px;
  font-weight: 950;
}

.kyc-flow strong {
  font-size: 13px;
}

.kyc-flow small {
  color: var(--muted);
}

.form-section-title {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(245, 247, 239, 0.1);
  color: var(--yellow);
  padding-top: 14px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.check-row span {
  line-height: 1.35;
}

.check-row a {
  color: var(--yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(245, 247, 239, 0.1);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-state {
  margin-top: 14px;
  border: 1px dashed rgba(245, 247, 239, 0.16);
  border-radius: 7px;
  background: rgba(245, 247, 239, 0.045);
  color: var(--muted);
  padding: 14px;
}

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

  .dashboard-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

  .dashboard-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

  .order-layout,
  .payment-address-list {
    grid-template-columns: 1fr;
  }

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

  .kyc-flow {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .auth-shell,
  .dashboard-main,
  .dashboard-sidebar {
    padding: 16px;
  }

  .dashboard-nav,
  .dashboard-form,
  .api-order-card,
  .stats-grid,
  .model-picker,
  .referral-share-box {
    grid-template-columns: 1fr;
  }

  .dashboard-topbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-topline,
  .sidebar-head {
    align-items: start;
  }
}
