/* Demo Crypto Wallet — aligned with site visual language */

.demo-wallet-section {
  position: relative;
  background-color: #fff;
  padding-top: var(--section-pad-y, 3rem);
  padding-bottom: var(--section-pad-y, 3rem);
  border-top: 1px solid #e2e8f0;
}

@media (min-width: 640px) {
  .demo-wallet-section {
    padding-top: var(--section-pad-y-md, 4rem);
    padding-bottom: var(--section-pad-y-md, 4rem);
  }
}

.demo-wallet-section__header {
  margin-bottom: 2.5rem;
}

.demo-wallet-section__header .section-lead {
  margin-top: 1rem;
}

.demo-wallet-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.demo-wallet-notice {
  margin: 1.25rem auto 0;
  max-width: 36rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background-color: #f1f5f9;
  color: #475569;
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: left;
}

.demo-wallet-notice strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-wallet {
  display: grid;
  gap: 1.5rem;
}

.demo-wallet__top {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .demo-wallet__top {
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: stretch;
  }
}

/* Shared card shell — like signup / review surfaces */
.demo-wallet__balance-card,
.demo-wallet__swap-panel,
.demo-wallet__history,
.demo-wallet__soft-cta {
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
}

.demo-wallet__field-card {
  border-radius: 0.75rem;
  background-color: #f1f5f9;
  border: none;
  padding: 1.15rem 1.25rem;
}

/* Balance — dark slate block like dark-feature / cta-banner */
.demo-wallet__balance-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  background-color: #0f172a;
  color: #fff;
  border: none;
}

.demo-wallet__balance-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 18rem;
  height: 18rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(186, 238, 173, 0.45) 0%, rgba(143, 206, 247, 0.25) 45%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.demo-wallet__balance-card::after {
  content: "";
  position: absolute;
  inset: auto auto -35% -25%;
  width: 16rem;
  height: 16rem;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.demo-wallet__balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-wallet__balance-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.demo-wallet__funds-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.demo-wallet__balance-value {
  margin: 1rem 0 0.5rem;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #fff;
}

.demo-wallet__prices-meta {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
}

.demo-wallet__balance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

@media (min-width: 480px) {
  .demo-wallet__balance-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.demo-wallet__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.demo-wallet__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.demo-wallet__btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.demo-wallet__btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.demo-wallet__btn--primary {
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.demo-wallet__btn--primary:hover:not(:disabled) {
  opacity: 0.9;
}

.demo-wallet__btn--reset {
  grid-column: 1 / -1;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.85);
}

.demo-wallet__btn--reset:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Assets — soft slate cards like review quotes */
.demo-wallet__assets {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

@media (min-width: 640px) {
  .demo-wallet__assets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.demo-wallet__asset {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
  padding: 1.15rem 1.25rem;
  background-color: #f1f5f9;
  border-radius: 1rem;
  border: none;
  box-shadow: none;
}

.demo-wallet__asset-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.demo-wallet__asset-icon--btc {
  background-image: linear-gradient(to top right, #f59e0b, #f97316);
}

.demo-wallet__asset-icon--eth {
  background-image: linear-gradient(to top right, #6366f1, #3b82f6);
}

.demo-wallet__asset-icon--usdt {
  background-image: linear-gradient(to top right, #14b8a6, #34d399);
}

.demo-wallet__asset-icon--sol {
  background-image: linear-gradient(to top right, #8b5cf6, #06b6d4);
}

.demo-wallet__asset-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.demo-wallet__asset-ticker {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: #475569;
}

.demo-wallet__asset-qty {
  margin: 0;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.demo-wallet__asset-usd {
  margin: 0.125rem 0 0;
  text-align: right;
  font-size: 0.8125rem;
  color: #64748b;
}

.demo-wallet__asset-price {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.8125rem;
  color: #64748b;
}

/* Panels */
.demo-wallet__swap-panel,
.demo-wallet__history,
.demo-wallet__soft-cta {
  padding: 1.75rem 1.5rem;
  background-color: #fff;
  border: 1px solid #e2e8f0;
}

@media (min-width: 640px) {
  .demo-wallet__swap-panel,
  .demo-wallet__history,
  .demo-wallet__soft-cta {
    padding: 2rem 1.75rem;
  }
}

.demo-wallet__panel-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.demo-wallet__panel-sub {
  margin: 0.5rem 0 1.35rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #64748b;
}

.demo-wallet__swap-form {
  display: grid;
  gap: 0.5rem;
  position: relative;
}

.demo-wallet__field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
}

.demo-wallet__max-btn {
  min-height: 32px;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.demo-wallet__max-btn:hover {
  opacity: 0.9;
}

.demo-wallet__field-row {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 120px);
  gap: 0.5rem;
}

.demo-wallet__amount-input,
.demo-wallet__asset-select {
  min-height: 50px;
  width: 100%;
  border: 1px solid #9ca3af;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-size: 1rem;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.demo-wallet__amount-input:focus,
.demo-wallet__asset-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.demo-wallet__amount-input--readonly {
  background: #f8fafc;
  color: #334155;
  cursor: default;
}

.demo-wallet__available {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.demo-wallet__flip-btn {
  width: 44px;
  height: 44px;
  margin: 0.15rem auto;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #2563eb;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.demo-wallet__flip-btn:hover {
  background: #f8fafc;
  opacity: 0.95;
}

.demo-wallet__quote {
  margin-top: 1.15rem;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 0.5rem;
}

.demo-wallet__quote-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: #64748b;
}

.demo-wallet__quote-row strong {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.demo-wallet__error {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  line-height: 1.4;
}

.demo-wallet__swap-btn {
  width: 100%;
  margin-top: 1.15rem;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 9999px;
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: opacity 0.15s ease;
}

.demo-wallet__swap-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.demo-wallet__swap-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.demo-wallet__swap-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}

/* History */
.demo-wallet__history-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.demo-wallet__history-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  border-radius: 1rem;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
}

.demo-wallet__tx {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.25rem;
  border: none;
  border-radius: 1rem;
  background: #f1f5f9;
}

.demo-wallet__tx-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.demo-wallet__tx-type {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-wallet__tx-status {
  font-size: 0.75rem;
  font-weight: 500;
  color: #047857;
  background: #d1fae5;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.demo-wallet__tx-pair {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.demo-wallet__tx-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

/* Soft CTA */
.demo-wallet__soft-cta {
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(186, 238, 173, 0.25), transparent 55%),
    radial-gradient(ellipse 60% 70% at 0% 100%, rgba(143, 206, 247, 0.2), transparent 50%),
    #fff;
}

.demo-wallet__soft-cta-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.demo-wallet__soft-cta-text {
  margin: 0.5rem auto 1.25rem;
  max-width: 32rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #475569;
}

.demo-wallet__soft-cta .demo-wallet__btn--primary {
  min-width: min(100%, 280px);
}

/* Modals — match form-submit-success style */
.dw-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dw-modal.is-open {
  display: flex;
}

.dw-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.dw-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@media (min-width: 640px) {
  .dw-modal__dialog {
    padding: 2.5rem;
  }
}

.dw-modal__title {
  margin: 0 0 0.85rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
  text-align: center;
}

.dw-modal__text,
.dw-modal__demo-note {
  margin: 0 0 1.25rem;
  font-size: 0.975rem;
  color: #475569;
  line-height: 1.6;
  text-align: center;
}

.dw-modal__demo-note {
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  border: none;
  color: #334155;
  font-size: 0.875rem;
  text-align: left;
}

.dw-modal__body {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.dw-modal__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: #64748b;
}

.dw-modal__row strong {
  color: #0f172a;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dw-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dw-modal__actions .demo-wallet__btn--ghost {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

.dw-modal__actions .demo-wallet__btn--ghost:hover:not(:disabled) {
  background: #e2e8f0;
}

.dw-modal__actions .demo-wallet__btn--primary {
  background-image: linear-gradient(to top right, #4f46e5, #2563eb);
  color: #fff;
}

.dw-modal__actions .demo-wallet__btn--reset {
  grid-column: auto;
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.dw-modal__actions .demo-wallet__btn--reset:hover:not(:disabled) {
  background: #fee2e2;
}

@media (max-width: 479px) {
  .dw-modal__actions {
    grid-template-columns: 1fr;
  }
}

body.dw-modal-open {
  overflow: hidden;
}
