/* MEXC Crypto - wallet connect modal and account wallet rows. */

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wallet-modal[hidden] { display: none; }
body.wallet-open { overflow: hidden; }

.wallet-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 11, .58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.wallet-panel {
  position: relative;
  width: min(432px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 26px 28px 22px;
  color: var(--led-ink);
  background: var(--led-paper-soft);
  border: 1px solid color-mix(in srgb, var(--led-ink) 16%, transparent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .30);
  font-family: var(--led-sans);
}

.wallet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.wallet-kicker {
  display: block;
  color: var(--led-muted);
  font-family: var(--led-mono);
  font-size: 8px;
  letter-spacing: .20em;
}
.wallet-head h2 {
  margin: 5px 0 0;
  font-family: var(--led-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.wallet-x {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: -4px -6px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--led-muted);
  cursor: pointer;
}
.wallet-x:hover { color: var(--led-ink); background: var(--led-sage); }

.wallet-sub {
  margin: 10px 0 16px;
  color: var(--led-muted);
  font-size: 11px;
  line-height: 1.75;
}

.wallet-list { display: flex; flex-direction: column; gap: 2px; }
.wallet-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border: 0;
  background: transparent;
  color: var(--led-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.wallet-opt:hover { background: color-mix(in srgb, var(--led-sage) 50%, transparent); }
.wallet-opt:focus-visible { outline: 2px solid var(--led-focus); outline-offset: -2px; }
.wallet-ico {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--led-paper-deep);
  color: var(--led-pine);
  overflow: hidden;
}
.wallet-ico img { width: 20px; height: 20px; display: block; }
.wallet-opt-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wallet-opt-txt b { font-size: 12px; font-weight: 600; }
.wallet-opt-txt span {
  overflow: hidden;
  color: var(--led-muted);
  font-family: var(--led-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-opt-arrow { flex: none; color: var(--led-muted); font-family: var(--led-mono); font-size: 12px; }

.wallet-empty { padding: 10px 0 2px; }
.wallet-empty b { display: block; font-family: var(--led-serif); font-size: 17px; font-weight: 400; }
.wallet-empty p { margin: 8px 0 0; color: var(--led-muted); font-size: 10px; line-height: 1.7; }
.wallet-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.wallet-links a { color: var(--led-pine); font-family: var(--led-mono); font-size: 9px; text-underline-offset: 2px; }
.wallet-hint { margin: 10px 0 0; color: var(--led-muted); font-size: 9px; line-height: 1.65; }

.wallet-status {
  display: none;
  margin-top: 14px;
  color: var(--led-pine);
  font-family: var(--led-mono);
  font-size: 9px;
  line-height: 1.6;
}
.wallet-status.on { display: flex; align-items: center; gap: 8px; }
.wallet-status.on::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--led-saffron);
  animation: wallet-pulse 1.1s ease-in-out infinite;
}
@keyframes wallet-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.wallet-error {
  display: none;
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--led-clay);
  background: color-mix(in srgb, var(--led-clay) 9%, transparent);
  font-size: 10px;
  line-height: 1.6;
}
.wallet-error.on { display: block; }

.wallet-note {
  margin: 20px 0 0;
  padding-top: 0;
  border-top: 0;
  color: var(--led-muted);
  font-size: 9px;
  line-height: 1.65;
}
.wallet-legacy-wrap { margin: 10px 0 0; text-align: center; }
.wallet-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--led-pine);
  font-family: var(--led-sans);
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.wallet-link:focus-visible { outline: 2px solid var(--led-focus); outline-offset: 3px; }
.wallet-back { display: block; margin: 12px auto 0; }

.wallet-legacy-form { display: flex; flex-direction: column; }
.wallet-legacy-form label {
  color: var(--led-muted);
  font-family: var(--led-mono);
  font-size: 8px;
  letter-spacing: .08em;
}
.wallet-input {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--led-ink) 18%, transparent);
  border-radius: 0;
  background: var(--led-paper);
  color: var(--led-ink);
  font-family: var(--led-mono);
  font-size: 11px;
  outline: none;
}
.wallet-input:focus { border-color: var(--led-pine); box-shadow: 0 0 0 1px var(--led-pine); }
.wallet-submit {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 0;
  background: var(--led-pine);
  color: var(--led-paper);
  font-family: var(--led-sans);
  font-size: 11px;
  letter-spacing: .02em;
  cursor: pointer;
}
.wallet-submit:hover { background: var(--led-pine-deep); }
.wallet-submit:disabled, .wallet-opt:disabled { opacity: .55; cursor: wait; }

/* Account security: linked wallets. */
.wallet-bind .wallet-legacy-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  color: var(--led-clay);
  background: color-mix(in srgb, var(--led-clay) 8%, transparent);
  border-left: 0;
  font-size: 10px;
  line-height: 1.65;
}
.wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 0;
  border-top: 0;
}
.wallet-row + .wallet-row {
  margin-top: 14px;
  border-top: 0;
}
.wallet-row:first-child { border-top: 0; }
.wallet-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wallet-row-main b {
  overflow: hidden;
  font-family: var(--led-mono);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-row-main span { color: var(--led-muted); font-size: 9px; line-height: 1.5; }
.wallet-row-act { flex: none; display: flex; gap: 2px; }
.wallet-row-act .s-btn { min-height: 26px; padding: 0 8px; font-size: 9px; }
.wallet-row-act .s-btn:disabled { opacity: .4; cursor: not-allowed; }
.wallet-bind .wallet-actions { margin-top: 12px; }
.wallet-bind .empty { padding: 6px 0 2px; }
.wallet-bind .wallet-help { margin: 10px 0 0; color: var(--led-muted); font-size: 9px; line-height: 1.7; }

@media (max-width: 520px) {
  .wallet-modal { align-items: flex-end; padding: 0; }
  .wallet-panel {
    width: 100%;
    max-height: 92vh;
    padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-status.on::before { animation: none; opacity: 1; }
  .wallet-opt { transition: none; }
  .wallet-panel { scroll-behavior: auto; }
}
