/* Crypto Checkout Page — fintech light theme (Stripe x Coinbase Commerce inspired) */

:root {
  --cx-primary: #4b59f5;
  --cx-primary-dark: #2f3bd6;
  --cx-primary-light: #eef0ff;
  --cx-bg: #eef2fb;
  --cx-card: #ffffff;
  --cx-text: #10162f;
  --cx-text-muted: #6b7280;
  --cx-border: #e7eaf3;
  --cx-success: #16a34a;
  --cx-warning: #f59e0b;
  --cx-danger: #ef4444;
  --cx-radius-lg: 20px;
  --cx-radius-md: 16px;
  --cx-radius-sm: 10px;
  --cx-shadow: 0 20px 60px -15px rgba(30, 41, 90, 0.18);
  --cx-shadow-sm: 0 6px 20px -8px rgba(30, 41, 90, 0.15);
}

.cx-page {
  font-family: 'Inter', 'Arial', sans-serif;
  background: radial-gradient(circle at 15% 10%, #dce4fb 0%, var(--cx-bg) 45%, #e6ebfa 100%);
  color: var(--cx-text);
  min-height: 100vh;
  padding: 32px 16px 60px;
  position: relative;
  overflow-x: hidden;
}

.cx-page * {
  box-sizing: border-box;
}

/* Top bar */
.cx-topbar {
  max-width: 1180px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cx-brand span {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.cx-topbar-link {
  font-size: 14px;
  color: var(--cx-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .2s ease;
}

.cx-topbar-link:hover {
  color: var(--cx-primary);
}

/* Layout */
.cx-wrap {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  align-items: start;
  position: relative;
}

.cx-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--cx-radius-lg);
  box-shadow: var(--cx-shadow);
  padding: 32px;
}

/* Left panel header */
.cx-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.cx-merchant {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cx-merchant-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.cx-merchant-sub {
  font-size: 13px;
  color: var(--cx-text-muted);
  margin-top: 2px;
}

/* Timer */
.cx-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cx-primary-light);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background .3s ease, color .3s ease;
}

.cx-timer.is-warning {
  background: #fff4e0;
}

.cx-timer.is-danger {
  background: #fde8e8;
  animation: cx-pulse 1s ease-in-out infinite;
}

@keyframes cx-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.cx-timer-icon {
  font-size: 14px;
  color: var(--cx-primary);
}

.cx-timer.is-warning .cx-timer-icon { color: var(--cx-warning); }
.cx-timer.is-danger .cx-timer-icon { color: var(--cx-danger); }

.cx-timer-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--cx-primary);
  letter-spacing: 0.02em;
}

.cx-timer.is-warning .cx-timer-value { color: var(--cx-warning); }
.cx-timer.is-danger .cx-timer-value { color: var(--cx-danger); }

/* Section titles */
.cx-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cx-text-muted);
  margin: 28px 0 14px;
}

.cx-section-title:first-of-type {
  margin-top: 0;
}

/* Order summary */
.cx-summary-list {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-md);
  overflow: hidden;
}

.cx-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--cx-border);
}

.cx-summary-row:last-child {
  border-bottom: none;
}

.cx-summary-row.cx-total {
  background: var(--cx-primary-light);
  font-weight: 700;
  font-size: 16px;
}

.cx-summary-label {
  color: var(--cx-text-muted);
}

.cx-summary-row.cx-total .cx-summary-label {
  color: var(--cx-text);
}

.cx-summary-value {
  font-weight: 600;
  text-align: right;
}

.cx-mono {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* Crypto selector */
.cx-coin-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.cx-coin {
  border: 1.5px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  background: #fff;
  padding: 18px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.cx-coin:hover {
  transform: translateY(-2px);
  box-shadow: var(--cx-shadow-sm);
}

.cx-coin.is-active {
  border-color: var(--cx-primary);
  background: var(--cx-primary-light);
  box-shadow: 0 0 0 3px rgba(75, 89, 245, 0.12);
}

.cx-coin span {
  font-size: 13px;
  font-weight: 700;
}

/* Network selector */
.cx-network-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cx-network-pill {
  border: 1.5px solid var(--cx-border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--cx-text-muted);
  transition: all .18s ease;
}

.cx-network-pill:hover {
  border-color: var(--cx-primary);
  color: var(--cx-primary);
}

.cx-network-pill.is-active {
  border-color: var(--cx-primary);
  background: var(--cx-primary);
  color: #fff;
}

/* Address + QR */
.cx-address-block {
  display: flex;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-md);
  padding: 18px;
  flex-wrap: wrap;
}

.cx-qr {
  width: 108px;
  height: 108px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--cx-border);
  padding: 6px;
  flex-shrink: 0;
  background: #fff;
}

.cx-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.cx-address-info {
  flex: 1;
  min-width: 200px;
}

.cx-address-label {
  font-size: 12px;
  color: var(--cx-text-muted);
  margin-bottom: 6px;
}

.cx-address-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f7fc;
  border-radius: var(--cx-radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.cx-address-text {
  font-size: 13px;
  word-break: break-all;
  flex: 1;
}

.cx-copy-btn {
  border: none;
  background: var(--cx-primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, transform .12s ease;
}

.cx-copy-btn:hover {
  background: var(--cx-primary-dark);
}

.cx-copy-btn:active {
  transform: scale(0.94);
}

.cx-copy-btn.is-copied {
  background: var(--cx-success);
}

.cx-amount-to-send {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cx-amount-to-send strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Expiry notice */
.cx-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--cx-text-muted);
  background: #f6f7fc;
  border-radius: var(--cx-radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
}

.cx-notice i {
  color: var(--cx-primary);
  margin-top: 2px;
}

/* Warning */
.cx-warning-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  background: #fff8e6;
  border: 1px solid #fbe4b0;
  color: #92660a;
  border-radius: var(--cx-radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
}

.cx-warning-box i {
  margin-top: 2px;
  color: var(--cx-warning);
}

/* Security badge */
.cx-security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cx-text-muted);
  margin-top: 18px;
  justify-content: center;
}

/* Right panel */
.cx-right {
  position: sticky;
  top: 24px;
}

.cx-right-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cx-right-sub {
  font-size: 13px;
  color: var(--cx-text-muted);
  margin-bottom: 22px;
}

.cx-field {
  margin-bottom: 18px;
}

.cx-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cx-text-muted);
  margin-bottom: 8px;
}

.cx-amount-input-wrap {
  position: relative;
}

.cx-amount-input-wrap .cx-currency-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--cx-text-muted);
}

.cx-amount-input {
  width: 100%;
  border: 1.5px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  padding: 14px 16px 14px 32px;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  color: var(--cx-text);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.cx-amount-input:focus {
  outline: none;
  border-color: var(--cx-primary);
  box-shadow: 0 0 0 4px rgba(75, 89, 245, 0.12);
}

.cx-amount-hint {
  font-size: 12px;
  color: var(--cx-text-muted);
  margin-top: 6px;
}

.cx-amount-hint.is-error {
  color: var(--cx-danger);
}

.cx-right-summary {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-md);
  overflow: hidden;
  margin-bottom: 22px;
}

.cx-cta {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--cx-primary), #6b78ff);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 17px 20px;
  border-radius: var(--cx-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 24px -8px rgba(75, 89, 245, 0.5);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.cx-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -8px rgba(75, 89, 245, 0.55);
}

.cx-cta:active {
  transform: translateY(0);
}

.cx-cta:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cx-cta-note {
  text-align: center;
  font-size: 12px;
  color: var(--cx-text-muted);
  margin-top: 12px;
}

/* Success state */
.cx-success {
  max-width: 560px;
  margin: 8vh auto;
  text-align: center;
  padding: 56px 40px;
  display: none;
}

.cx-success.is-visible {
  display: block;
  animation: cx-fade-up .5s ease both;
}

@keyframes cx-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.cx-success-icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #e9f9ef;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  position: relative;
}

.cx-success-icon i {
  font-size: 40px;
  color: var(--cx-success);
  animation: cx-pop .5s ease .1s both;
}

@keyframes cx-pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.cx-success-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.cx-success-text {
  font-size: 15px;
  color: var(--cx-text-muted);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 28px;
}

.cx-confirm-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--cx-text-muted);
  margin-bottom: 30px;
}

.cx-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--cx-border);
  border-top-color: var(--cx-primary);
  animation: cx-spin .8s linear infinite;
}

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

.cx-return-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--cx-border);
  background: #fff;
  color: var(--cx-text);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--cx-radius-sm);
  text-decoration: none;
  transition: all .18s ease;
}

.cx-return-btn:hover {
  border-color: var(--cx-primary);
  color: var(--cx-primary);
}

/* Responsive */
@media (max-width: 992px) {
  .cx-wrap {
    grid-template-columns: 1fr;
  }
  .cx-right {
    position: static;
  }
}

@media (max-width: 576px) {
  .cx-card {
    padding: 22px;
    border-radius: var(--cx-radius-md);
  }
  .cx-coin-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .cx-address-block {
    flex-direction: column;
  }
  .cx-qr {
    margin: 0 auto;
  }
  .cx-address-info {
    width: 100%;
  }
  .cx-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cx-success {
    margin: 4vh auto;
    padding: 40px 22px;
  }
}
