:root {
  color-scheme: dark;
  --background: #080808;
  --surface: #111111;
  --surface-raised: #171717;
  --border: #292929;
  --text: #f5f5f5;
  --muted: #a6a6a6;
  --soft: #d6d6d6;
  --danger: #ff9a9a;
  --success: #a9f3bd;
  --radius: 18px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.07), transparent 27rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.92);
}

.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-decoration: none;
}

.back-link {
  color: var(--soft);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

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

.account-shell {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.loading-view {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--muted);
}

.loader {
  width: 34px;
  height: 34px;
  border: 3px solid #303030;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  min-height: 66vh;
}

.auth-intro h1,
.dashboard-heading h1 {
  max-width: 720px;
  margin: 8px 0 18px;
  font-size: clamp(2.25rem, 6vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-intro > p:last-child {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.auth-card,
.panel-card,
.summary-card,
.item-row {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border-radius: var(--radius);
}

.auth-card {
  padding: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: #090909;
  border: 1px solid #222222;
  border-radius: 13px;
}

.switch-button,
.tab-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.switch-button {
  padding: 11px 12px;
  border-radius: 9px;
}

.switch-button.is-active {
  color: #0a0a0a;
  background: #ffffff;
}

.account-form {
  display: grid;
  gap: 17px;
  padding: 22px 4px 4px;
}

.account-form h2,
.panel-heading h2,
.panel-card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.account-form label {
  display: grid;
  gap: 7px;
}

.account-form label > span {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #333333;
  border-radius: 11px;
  background: #090909;
  color: var(--text);
}

.account-form input:disabled {
  color: #888888;
  cursor: not-allowed;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-help,
.form-message,
.muted,
.panel-heading p {
  color: var(--muted);
}

.field-help {
  margin: -10px 0 0;
  font-size: 0.78rem;
}

.form-message {
  min-height: 1.3em;
  margin: 0;
  font-size: 0.86rem;
}

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

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

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #090909;
}

.primary-button:hover {
  background: #dcdcdc;
  border-color: #dcdcdc;
}

.secondary-button {
  border: 1px solid #393939;
  background: #121212;
  color: var(--text);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.dashboard-heading h1 {
  margin-bottom: 9px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
}

.dashboard-heading .muted {
  margin: 0;
}

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

.summary-card {
  display: grid;
  gap: 7px;
  padding: 26px;
}

.summary-card strong {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.summary-label,
.summary-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.account-tabs {
  display: flex;
  gap: 4px;
  margin: 38px 0 22px;
  padding-bottom: 1px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 17px;
}

.tab-button.is-active {
  color: var(--text);
}

.tab-button.is-active::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: #ffffff;
  content: "";
}

.panel-card {
  padding: 28px;
}

.details-list {
  margin: 22px 0 0;
}

.details-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) 1fr;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
}

.details-list dt {
  color: var(--muted);
}

.details-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-heading p {
  margin: 5px 0 0;
}

.balance-pill {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid #383838;
  border-radius: 999px;
  background: #151515;
  font-size: 0.82rem;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 21px;
}

.item-row h3,
.item-row p {
  margin: 0;
}

.item-row h3 {
  font-size: 1rem;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.item-value {
  text-align: right;
  font-weight: 900;
}

.item-value.is-positive {
  color: var(--success);
}

.item-value.is-negative {
  color: var(--danger);
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed #303030;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.profile-card {
  max-width: 680px;
}

.profile-card .account-form {
  padding-top: 22px;
}



.text-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.form-link {
  justify-self: end;
  margin-top: -7px;
  font-size: 0.82rem;
}

.auth-note {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.back-to-login {
  justify-self: center;
  font-size: 0.86rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .auth-view {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .auth-intro h1 {
    font-size: clamp(2.5rem, 12vw, 4.4rem);
  }
}

@media (max-width: 600px) {
  .site-header {
    min-height: 66px;
    padding: 0 18px;
  }

  .account-shell {
    width: min(100% - 24px, var(--max-width));
    padding: 38px 0 60px;
  }

  .name-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-heading .secondary-button {
    width: 100%;
  }

  .item-row {
    grid-template-columns: 1fr;
  }

  .item-value {
    text-align: left;
  }

  .details-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
