:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #102033;
  --muted: #64748b;
  --line: #d9e2ee;
  --brand: #ff6a00;
  --brand-dark: #d94f00;
  --accent: #0f766e;
  --danger: #b42318;
  --shadow: 0 20px 70px rgba(15, 23, 42, 0.13);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101820;
  --panel: rgba(18, 28, 38, 0.92);
  --panel-strong: #172332;
  --text: #f8fafc;
  --muted: #a5b4c6;
  --line: #2b3c50;
  --brand: #ff7a1a;
  --brand-dark: #ff9b52;
  --accent: #38b2ac;
  --danger: #ff8a80;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.09), transparent 28%),
    linear-gradient(145deg, transparent 58%, rgba(15, 118, 110, 0.12)),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button,
.secondary-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

.icon-button,
.secondary-button {
  background: var(--panel);
  color: var(--text);
}

.primary-button {
  width: 100%;
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.text-button {
  display: block;
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  padding: 8px 0;
  margin: -4px 0 10px;
  cursor: pointer;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.72fr);
  gap: 24px;
  align-items: stretch;
}

.hero,
.auth-panel,
.status-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.hero {
  min-height: 590px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1 {
  margin: 12px 0 14px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.feature {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 8px;
  padding: 14px;
}

.feature strong {
  display: block;
  font-size: 15px;
  margin-bottom: 8px;
}

.feature span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-panel,
.status-panel {
  padding: 24px;
}

.provider-stack {
  display: grid;
  gap: 10px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.provider-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
}

.provider-button span {
  font-weight: 800;
}

.provider-button small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.provider-button.compact {
  min-height: 58px;
  display: grid;
  justify-items: start;
  gap: 3px;
  padding: 10px;
}

.provider-button.compact small {
  text-align: left;
}

.provider-button[disabled] {
  cursor: not-allowed;
  opacity: 0.54;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.12);
  margin-bottom: 22px;
}

.tab {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 8px;
  min-height: 46px;
  padding: 0 12px;
  outline: none;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.16);
}

.hint,
.message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message {
  min-height: 42px;
  margin: 14px 0 0;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--accent);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

.dashboard {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row span {
  color: var(--muted);
}

.metric-row strong {
  text-align: right;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-strong);
}

.chip.on {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.35);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel-strong);
}

.admin-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.admin-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: var(--muted);
}

.legal-shell {
  width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.legal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 34px;
}

.legal-card h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.legal-card h2 {
  margin: 28px 0 10px;
  font-size: 22px;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-card a {
  color: var(--brand);
  font-weight: 800;
}

.legal-meta {
  color: var(--muted);
  font-size: 14px;
}

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

.legal-box {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 8px;
  padding: 18px;
}

.legal-box h2 {
  margin-top: 0;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

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

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

  .legal-card {
    padding: 24px;
  }
}

/* TOPDMS SPORTS movement-account visual system */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b1c;
  --panel: rgba(18, 22, 51, 0.84);
  --panel-strong: rgba(25, 30, 68, 0.92);
  --text: #f8f7ff;
  --muted: #aeb4d0;
  --line: rgba(153, 168, 232, 0.2);
  --brand: #ff6f98;
  --brand-dark: #ff9a72;
  --accent: #69ddff;
  --success: #b5f45b;
  --danger: #ff8fa8;
  --shadow: 0 30px 100px rgba(2, 4, 18, 0.55);
}

[data-theme="light"] {
  --bg: #10142d;
  --panel: rgba(25, 29, 65, 0.82);
  --panel-strong: rgba(35, 40, 83, 0.94);
}

body {
  background:
    radial-gradient(circle at 11% 16%, rgba(109, 91, 255, 0.3), transparent 31%),
    radial-gradient(circle at 85% 5%, rgba(255, 111, 152, 0.2), transparent 26%),
    radial-gradient(circle at 78% 84%, rgba(105, 221, 255, 0.13), transparent 29%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(138, 154, 222, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 154, 222, 0.16) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.shell {
  width: min(1240px, calc(100vw - 40px));
  padding: 24px 0 56px;
  position: relative;
}

.topbar {
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), #806cff 66%, var(--accent));
  box-shadow: 0 12px 30px rgba(255, 111, 152, 0.28);
  letter-spacing: -0.04em;
}

.brand-title {
  letter-spacing: 0.04em;
}

.icon-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(17, 21, 50, 0.72);
  backdrop-filter: blur(18px);
}

.layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(350px, 0.68fr);
  gap: 20px;
}

.hero,
.auth-panel,
.status-panel {
  border-radius: 24px;
  border-color: var(--line);
  backdrop-filter: blur(24px);
}

.hero {
  min-height: 760px;
  padding: clamp(25px, 4vw, 46px);
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(145deg, rgba(44, 38, 100, 0.84), rgba(13, 18, 44, 0.92) 55%),
    var(--panel);
}

.hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  right: -120px;
  top: 80px;
  border: 1px solid rgba(105, 221, 255, 0.22);
  box-shadow: 0 0 90px rgba(105, 221, 255, 0.12);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.14em;
}

h1 {
  max-width: 760px;
  font-size: clamp(42px, 5.5vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lead {
  max-width: 680px;
  font-size: clamp(16px, 2vw, 19px);
}

.chips {
  gap: 9px;
}

.chip {
  border-color: rgba(105, 221, 255, 0.26);
  background: rgba(105, 221, 255, 0.08);
  color: #d8f7ff;
  letter-spacing: 0.06em;
}

.motion-demo {
  margin: 28px 0 22px;
  border: 1px solid rgba(105, 221, 255, 0.23);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(5, 9, 27, 0.72);
  box-shadow: inset 0 0 70px rgba(91, 74, 210, 0.18), 0 24px 70px rgba(2, 4, 18, 0.32);
}

.motion-demo-rail {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.motion-demo-rail strong {
  color: var(--success);
}

.motion-demo-stage {
  height: 310px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(105, 221, 255, 0.14), transparent 34%),
    linear-gradient(rgba(105, 221, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 221, 255, 0.07) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
}

.motion-demo-stage svg {
  position: absolute;
  width: 235px;
  height: 306px;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  stroke: var(--accent);
  stroke-width: 4;
  filter: drop-shadow(0 0 9px rgba(105, 221, 255, 0.62));
  animation: athleteFloat 3.2s ease-in-out infinite;
}

.motion-demo-stage .demo-joints {
  fill: var(--brand);
  stroke: #ffd1dc;
  stroke-width: 2;
}

.scan-line {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
  animation: scanMotion 3.6s linear infinite;
}

.detected-trampoline {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 16px;
  height: 42px;
  border: 2px solid var(--success);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(181, 244, 91, 0.3);
}

.detected-trampoline span {
  position: absolute;
  right: 0;
  top: -22px;
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.demo-badge {
  position: absolute;
  z-index: 3;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 14, 36, 0.86);
  backdrop-filter: blur(12px);
}

.demo-badge small,
.motion-demo-metrics small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.demo-badge strong {
  color: var(--accent);
  font-size: 12px;
}

.badge-pose { left: 14px; top: 16px; }
.badge-sync { right: 14px; top: 96px; }
.badge-sync strong { color: var(--success); }

.motion-demo-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.motion-demo-metrics > div {
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.motion-demo-metrics > div:last-child { border-right: 0; }
.motion-demo-metrics strong { display: block; margin-top: 4px; font-size: 15px; }
.motion-demo-metrics > div:last-child strong { color: var(--success); }

.feature-grid {
  margin-top: 0;
}

.feature {
  min-height: 112px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(28, 33, 72, 0.65);
}

.feature strong {
  color: #fff;
}

.auth-panel,
.status-panel {
  padding: 24px;
  background: linear-gradient(165deg, rgba(31, 35, 78, 0.92), rgba(12, 16, 39, 0.94));
}

.provider-button,
.field input,
.tabs {
  border-radius: 13px;
  background: rgba(16, 20, 50, 0.72);
}

.provider-button:hover,
.icon-button:hover,
.secondary-button:hover {
  border-color: rgba(105, 221, 255, 0.58);
}

.tab {
  border-radius: 10px;
}

.tab.active {
  background: linear-gradient(135deg, rgba(255, 111, 152, 0.25), rgba(105, 221, 255, 0.16));
  box-shadow: none;
}

.field input {
  min-height: 49px;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(105, 221, 255, 0.13);
}

.primary-button {
  min-height: 50px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(110deg, var(--brand), #8b6dff 64%, #617eff);
  box-shadow: 0 14px 32px rgba(255, 111, 152, 0.22);
}

.primary-button:hover {
  background: linear-gradient(110deg, #ff88a9, #9f86ff 64%, #7891ff);
}

.text-button {
  color: #ffb0c5;
}

.message.success,
.chip.on {
  color: var(--success);
}

.metric-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(15, 20, 48, 0.68);
}

.metric-row strong {
  color: var(--accent);
}

@keyframes athleteFloat {
  0%, 100% { transform: translateX(-50%) translateY(3px); }
  50% { transform: translateX(-50%) translateY(-7px); }
}

@keyframes scanMotion {
  from { top: 0; opacity: 0; }
  12%, 88% { opacity: 0.75; }
  to { top: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-demo-stage svg,
  .scan-line { animation: none; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1240px);
    padding-top: 13px;
  }

  .topbar {
    align-items: flex-start;
  }

  .toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .toolbar .secondary-button {
    display: none;
  }

  .hero,
  .auth-panel,
  .status-panel {
    border-radius: 19px;
  }

  .hero {
    padding: 22px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .motion-demo-stage {
    height: 270px;
  }

  .motion-demo-stage svg {
    height: 270px;
    width: 205px;
  }

  .motion-demo-metrics > div {
    padding: 11px 9px;
  }

  .motion-demo-metrics strong {
    font-size: 12px;
  }

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

  .feature {
    min-height: auto;
  }

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