:root {
  --bg: #1e1d1a;
  --bg-soft: rgba(255, 255, 255, 0.04);
  --panel: rgba(14, 14, 13, 0.88);
  --panel-strong: #141412;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2ecde;
  --muted: #a59e91;
  --accent: #5be0a8;
  --accent-soft: rgba(91, 224, 168, 0.14);
  --warn: #f0c66b;
  --danger: #ff8d72;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(91, 224, 168, 0.12), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(232, 176, 81, 0.12), transparent 20%),
    linear-gradient(180deg, #2b2a27 0%, #1a1917 45%, #141412 100%);
  color: var(--text);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
  opacity: 0.55;
}

.ambient-a {
  width: 260px;
  height: 260px;
  top: 12%;
  right: 12%;
  background: rgba(91, 224, 168, 0.16);
}

.ambient-b {
  width: 240px;
  height: 240px;
  bottom: 8%;
  left: 6%;
  background: rgba(232, 176, 81, 0.14);
}

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -16px);
  min-width: min(520px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 15, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  border-color: rgba(91, 224, 168, 0.28);
}

.toast.warning {
  border-color: rgba(240, 198, 107, 0.28);
}

.toast.error {
  border-color: rgba(255, 141, 114, 0.3);
}

.auth-shell {
  width: min(520px, calc(100% - 24px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-items: start;
  padding: 32px 0 24px;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.panel-shell {
  display: block;
}

.workspace-panel {
  display: grid;
  gap: 24px;
}

.deposit-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.intro-panel,
.deposit-card,
.auth-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 22, 20, 0.86), rgba(13, 13, 12, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.intro-panel {
  padding: 38px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.auth-card {
  padding: 34px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

.intro-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(91, 224, 168, 0.06), transparent 35%, transparent 70%, rgba(232, 176, 81, 0.05));
  pointer-events: none;
}

.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(91, 224, 168, 0.05), transparent 40%, transparent 70%, rgba(232, 176, 81, 0.05));
  pointer-events: none;
}

.eyebrow,
.card-kicker,
.detail span,
.copy-block label,
.status-row .step-value,
.ghost-button,
.feedback,
.security-note,
.input-shell span {
  font-family: 'IBM Plex Mono', monospace;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.97;
  max-width: 10ch;
}

.lead {
  margin-top: 18px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

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

.auth-form {
  grid-template-columns: 1fr;
}

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

.field.wide,
.submit-button {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 0.92rem;
}

.field input,
.field select,
.copy-block textarea,
.input-shell {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 16px;
  min-height: 54px;
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field select:focus,
.copy-block textarea:focus,
.input-shell:focus-within {
  border-color: rgba(91, 224, 168, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.money-shell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.money-shell input {
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
}

.money-shell input:focus {
  border: 0;
}

.submit-button,
.secondary-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.submit-button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #5be0a8 0%, #72d6f6 100%);
  color: #121313;
  font-weight: 700;
  margin-top: 4px;
  box-shadow: 0 14px 30px rgba(91, 224, 168, 0.24);
}

.submit-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled,
.secondary-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

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

.top-nav-shell {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 18, 0.88), rgba(12, 12, 11, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-tabs {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.panel-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}

.panel-tab.active {
  background: linear-gradient(135deg, rgba(91, 224, 168, 0.2), rgba(114, 214, 246, 0.18));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.panel-view {
  display: none;
  gap: 24px;
}

.panel-view.active {
  display: grid;
}

.panel-topbar .eyebrow {
  margin-bottom: 0;
}

.account-badge {
  display: inline-flex;
  margin-top: 18px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
}

.security-note {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.security-note span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(91, 224, 168, 0.12);
}

.card-panel {
  display: flex;
  justify-content: center;
}

.deposit-card {
  width: min(100%, 470px);
  padding: 24px;
  border-radius: 26px;
}

.statement-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 18, 17, 0.9), rgba(11, 11, 10, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 26px;
  padding: 24px;
}

.statement-header {
  align-items: center;
}

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

.card-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.card-header h2 {
  font-size: 1.5rem;
}

.ghost-button {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.status-block {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 16px;
}

.status-row.active {
  border-color: rgba(91, 224, 168, 0.22);
}

.status-row.done {
  border-color: rgba(91, 224, 168, 0.35);
  background: rgba(91, 224, 168, 0.08);
}

.status-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-copy strong {
  font-size: 0.96rem;
  font-weight: 500;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
}

.status-row.active .dot,
.status-row.done .dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(91, 224, 168, 0.14);
}

.step-value {
  color: var(--muted);
  font-size: 0.78rem;
}

.qr-stage {
  margin-top: 20px;
  min-height: 250px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top, rgba(91, 224, 168, 0.08), transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.qr-placeholder,
.qr-content {
  text-align: center;
}

.qr-placeholder span,
.qr-caption {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 12px;
}

.qr-placeholder p {
  color: var(--muted);
  line-height: 1.6;
}

.qr-content img {
  width: 220px;
  max-width: 100%;
  background: #f3efe8;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

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

.statement-summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.statement-filters {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.statement-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.statement-apply-button {
  width: auto;
  min-width: 180px;
}

.statement-list {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.statement-item,
.statement-empty {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 16px;
}

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

.statement-item strong {
  display: block;
  font-size: 1rem;
}

.statement-item span,
.statement-empty,
.statement-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.statement-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
}

.statement-open-button {
  justify-self: end;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(10px);
}

.qr-modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 18, 17, 0.95), rgba(10, 10, 9, 0.98));
  box-shadow: var(--shadow);
}

.statement-qr-stage {
  min-height: 320px;
}

.statement-qr-details {
  margin-top: 18px;
}

.detail {
  display: grid;
  gap: 7px;
}

.detail span {
  color: var(--muted);
  font-size: 0.74rem;
}

.detail strong {
  font-size: 0.95rem;
  word-break: break-word;
}

.copy-block {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.copy-block textarea {
  resize: vertical;
  min-height: 110px;
  padding: 14px 16px;
  color: var(--muted);
}

.secondary-button {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.feedback {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

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

.feedback.warning {
  color: var(--warn);
}

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

.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: lift-in 0.8s ease forwards;
}

.delay-1 {
  animation-delay: 0.14s;
}

@keyframes lift-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .top-nav-shell,
  .top-nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deposit-layout {
    grid-template-columns: 1fr;
  }

  .panel-tabs {
    width: 100%;
  }

  .panel-tab {
    flex: 1;
  }

  .intro-panel {
    padding: 28px;
  }

  h1 {
    max-width: none;
  }

  .shell-locked {
    padding-top: 24px;
  }
}

@media (max-height: 820px) {
  .auth-shell {
    padding-top: 20px;
  }

  .shell {
    padding-top: 20px;
  }

  h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    max-width: 14ch;
  }

  .lead,
  .account-badge {
    margin-top: 12px;
  }

  .deposit-form {
    margin-top: 20px;
  }

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 100%);
    gap: 18px;
    padding-bottom: 28px;
  }

  .top-nav-shell {
    padding: 16px;
  }

  .deposit-layout {
    gap: 18px;
  }

  .intro-panel,
  .deposit-card {
    border-radius: 24px;
  }

  .intro-panel {
    padding: 22px;
  }

  .deposit-form,
  .details-grid,
  .statement-filters,
  .statement-summary {
    grid-template-columns: 1fr;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header {
    align-items: center;
  }

  .statement-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .statement-meta {
    text-align: left;
  }

  .statement-open-button {
    justify-self: start;
  }

  .statement-filter-actions {
    flex-direction: column-reverse;
  }

  .statement-apply-button {
    width: 100%;
  }
}
