/* CM Deposit Modal - fresh, accessible, responsive */

:root {
  --cm-bg: #0b0f0d;
  --cm-surface: #0f1512;
  --cm-surface-2: #0b0f0d;
  --cm-line: #163227;
  --cm-text: #e6f3ec;
  --cm-muted: #94a3b8;
  --cm-emerald: #10b981;
  --cm-emerald-600: #059669;
  --cm-emerald-700: #047857;
  --cm-danger: #ef4444;
}

body.cm-modal-open {
  overflow: hidden;
}

.cm-deposit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.cm-deposit-overlay.cm-open {
  display: block;
  opacity: 1;
}

.cm-deposit {
  position: fixed;
  inset: 0;
  z-index: 1410;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
}

.cm-deposit.cm-open {
  display: flex;
}

.cm-deposit__panel {
  width: 100%;
  max-width: 720px;
  border-radius: 14px;
  border: 1px solid var(--cm-line);
  background: linear-gradient(180deg, var(--cm-surface) 0%, var(--cm-surface-2) 100%);
  color: var(--cm-text);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 220ms ease;
}

.cm-deposit.cm-open .cm-deposit__panel {
  transform: translateY(0);
  opacity: 1;
}

.cm-deposit__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px 16px;
}

.cm-deposit__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.125rem;
  color: #d1fae5;
}

.cm-deposit__subtitle {
  margin: 8px 16px 16px 16px;
  color: var(--cm-muted);
  font-size: 13px;
}

.cm-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #1f2937;
  background: #0b0f0d;
  color: #e5e7eb;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cm-close-btn:hover {
  background: #102019;
  border-color: #163227;
  color: #f0fdf4;
}

.cm-form {
  padding: 0 16px 16px 16px;
  display: grid;
  gap: 16px;
}

.cm-field {
  display: grid;
  gap: 8px;
}
.cm-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #cbd5e1;
}
.cm-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.85) 0%, rgba(15, 23, 42, 0.85) 100%);
  color: #e5e7eb;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.cm-input::placeholder {
  color: #94a3b8;
}
.cm-input:hover {
  border-color: rgba(148, 163, 184, 0.35);
}
.cm-input:focus {
  outline: none;
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.9) 0%, rgba(18, 27, 42, 0.9) 100%);
}

.method-cards {
  display: grid;
  gap: 10px;
}
.method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #0f172a;
  color: #e5e7eb;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.method-card:hover {
  border-color: #264a3a;
  background: #111a33;
}
.method-card input[type="radio"] {
  accent-color: var(--cm-emerald);
}
.method-card .title {
  font-weight: 600;
  color: #e6f3ec;
}
.method-card .desc {
  font-size: 12px;
  color: var(--cm-muted);
}
.method-card--active {
  border-color: #065f46;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
.method-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #0b1220;
  border-color: #1f2937;
}

.cm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #1f2937;
  cursor: pointer;
  font-weight: 700;
}
.cm-btn--primary {
  background: var(--cm-emerald);
  color: #071410;
  border-color: var(--cm-emerald);
}
.cm-btn--primary:hover {
  background: var(--cm-emerald-600);
}
.cm-btn--ghost {
  background: transparent;
  color: #b0f2de;
}
.cm-btn--outline {
  background: transparent;
  color: #d1fae5;
  border-color: #264a3a;
}
.cm-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Step 2: Instructions */
.cm-instructions {
  padding: 0 16px 16px 16px;
  display: none;
}
.cm-instructions.cm-show {
  display: block;
}

.cm-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #264a3a;
  border-radius: 10px;
  background: #0b1220;
  margin-bottom: 12px;
}
.cm-summary .label {
  color: var(--cm-muted);
  font-size: 12px;
}
.cm-summary .value {
  font-weight: 800;
  color: #e6f3ec;
}

.cm-address-card {
  padding: 12px;
  border: 1px solid #264a3a;
  border-radius: 12px;
  background: #0f172a;
}
.cm-address-label {
  color: var(--cm-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.cm-address-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.cm-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  word-break: break-all;
  color: #d1fae5;
  font-weight: 700;
}
.cm-copy {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #264a3a;
  background: #0b0f0d;
  color: #e5e7eb;
  cursor: pointer;
}
.cm-copy:hover {
  background: #102019;
  border-color: #163227;
}
.cm-copy-note {
  color: var(--cm-muted);
  font-size: 12px;
  margin-top: 8px;
}

/* Toast (local to this module, also used by JS) */
.cm-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(10, 16, 22, 0.92);
  color: #e6f3ec;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.cm-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
.cm-toast--error {
  border-color: rgba(239, 68, 68, 0.65);
}
