@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --ruby: #DC2626;
  --ruby-hover: #B91C1C;
  --ruby-light: #EF4444;
  --ruby-soft: rgba(220, 38, 38, 0.14);
  --bg: #000000;
  --bg-white: #0D0D12;
  --bg-elevated: #161620;
  --border: #1E1E2A;
  --border-hover: #2A2A3A;
  --text-1: #EBEBF0;
  --text-2: #A0A0B2;
  --text-3: #6B6B80;
  --green: #34D058;
  --red: #F04040;
  color-scheme: dark;
}

[data-theme="light"] {
  --ruby: #B91C1C;
  --ruby-hover: #991B1B;
  --ruby-light: #DC2626;
  --ruby-soft: rgba(185, 28, 28, 0.10);
  --bg: #FAFAFA;
  --bg-white: #FFFFFF;
  --bg-elevated: #F3F4F6;
  --border: #E5E7EB;
  --border-hover: #D1D5DB;
  --text-1: #1A1A2E;
  --text-2: #4B5563;
  --text-3: #9CA3AF;
  --green: #16A34A;
  --red: #DC2626;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text-1); overflow-x: hidden; -webkit-font-smoothing: antialiased; }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--bg-white); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1em; color: var(--text-1); }
.nav-logo { width: 36px; height: 36px; border-radius: 8px; }

.checkout-page { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 100px 24px 40px; }

.checkout-container {
  display: flex;
  max-width: 900px;
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.checkout-left {
  width: 400px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 40px;
  display: flex;
  flex-direction: column;
}

.order-label { font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--ruby); margin-bottom: 28px; }

.order-product { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.order-product-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--bg-white); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.order-logo { width: 48px; height: 48px; border-radius: 10px; }
.order-product-name { font-weight: 700; font-size: 1.1em; color: var(--text-1); }
.order-product-desc { color: var(--text-3); font-size: 0.78em; margin-top: 2px; }

.order-features { display: flex; flex-direction: column; gap: 10px; }
.order-feature { display: flex; align-items: center; gap: 10px; font-size: 0.82em; color: var(--text-2); }
.order-feature .check { color: var(--green); font-weight: 700; font-size: 0.9em; }

.order-divider { height: 1px; background: var(--border); margin: 28px 0; }

.order-total-row { display: flex; align-items: center; justify-content: space-between; }
.order-total-row span:first-child { color: var(--text-2); font-size: 0.88em; }
.order-subtotal-row, .order-fee-row { margin-bottom: 8px; }
.order-fee-row span { font-size: 0.85em; color: var(--text-2); }
.order-total { font-size: 1.6em; font-weight: 900; color: var(--text-1); }
.order-guarantee { color: var(--text-3); font-size: 0.72em; margin-top: 8px; text-align: right; }

.checkout-right { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.checkout-form-wrap h2 { font-size: 1.5em; font-weight: 800; margin-bottom: 8px; color: var(--text-1); }
.checkout-desc { color: var(--text-2); font-size: 0.88em; margin-bottom: 28px; line-height: 1.5; }

.checkout-cancelled {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.82em;
  font-weight: 500;
  margin-bottom: 20px;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.82em; font-weight: 600; margin-bottom: 8px; color: var(--text-2); }
.form-group input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-1);
  font-size: 0.92em;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: var(--ruby); }

.btn-checkout {
  width: 100%;
  padding: 16px 24px;
  background: var(--ruby);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1em;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-checkout:hover { background: var(--ruby-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(204,52,45,0.2); }
.btn-checkout:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.checkout-error {
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.82em;
  margin-top: 16px;
}

.checkout-footer-info { margin-top: 24px; }
.payment-methods-badge { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 0.75em; font-weight: 500; margin-bottom: 10px; }
.payment-divider { color: var(--text-3); opacity: 0.5; }
.secure-badge { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 0.72em; font-weight: 500; margin-bottom: 6px; }
.tos-text { color: var(--text-3); font-size: 0.68em; }

.payment-methods { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.payment-method-btn {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 18px 20px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: all 0.2s;
}
.payment-method-btn:hover { border-color: var(--ruby); background: var(--ruby-soft); }
.payment-method-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pm-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pm-name { font-weight: 700; font-size: 0.95em; color: var(--text-1); }
.pm-desc { color: var(--text-3); font-size: 0.78em; margin-top: 2px; }

.btn-back {
  display: block; width: 100%; padding: 12px; margin-top: 10px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.88em; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: all 0.2s;
}
.btn-back:hover { border-color: var(--text-3); color: var(--text-1); }

.crypto-addresses { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.crypto-addr-row {
  padding: 14px 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 10px;
}
.crypto-coin { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.88em; color: var(--text-1); margin-bottom: 8px; }
.crypto-addr-value { display: flex; align-items: center; gap: 8px; }
.crypto-addr-value code {
  flex: 1; font-size: 0.72em; color: var(--text-2);
  background: var(--bg-white); padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--border); word-break: break-all; font-family: 'SF Mono', 'Consolas', monospace;
}
.btn-copy {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; font-family: inherit;
  font-size: 0.72em; font-weight: 600; color: var(--ruby);
  transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.btn-copy:hover { background: var(--ruby-soft); border-color: var(--ruby); }

.form-group input[type="text"] {
  width: 100%; padding: 14px 16px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-1); font-size: 0.92em; font-family: inherit;
  transition: border-color 0.2s; outline: none;
}
.form-group input[type="text"]:focus { border-color: var(--ruby); }

.package-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.package-option-btn {
  display: flex; align-items: flex-start; gap: 16px;
  width: 100%; padding: 20px; background: var(--bg-white);
  border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: all 0.2s;
}
.package-option-btn:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.package-option-btn.selected { border-color: var(--ruby); background: var(--ruby-soft); }

.pkg-radio {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px; transition: all 0.2s;
}
.package-option-btn.selected .pkg-radio { border-color: var(--ruby); }
.pkg-radio-inner {
  width: 12px; height: 12px; border-radius: 50%;
  background: transparent; transition: all 0.2s;
}
.package-option-btn.selected .pkg-radio-inner { background: var(--ruby); }

.pkg-info { flex: 1; }
.pkg-name { font-weight: 700; font-size: 1em; color: var(--text-1); margin-bottom: 2px; }
.pkg-price { font-size: 1.2em; font-weight: 900; color: var(--ruby); margin-bottom: 6px; }
.pkg-price span { font-size: 0.65em; font-weight: 600; color: var(--text-2); }
.pkg-desc { font-size: 0.78em; color: var(--text-2); line-height: 1.5; }
.pkg-cycle-label { font-size: 0.75em; font-weight: 600; color: var(--text-2); }
.pkg-save-badge { display: inline-block; background: rgba(74, 222, 128, 0.15); color: #4ade80; font-size: 0.7em; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.pkg-dev-warning {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 6px 10px;
  background: rgba(167, 139, 250, 0.08); border-radius: 6px;
  font-size: 0.72em; font-weight: 600; color: #A78BFA;
}
[data-theme="light"] .pkg-dev-warning { color: #7C3AED; background: rgba(124, 58, 237, 0.06); }

.waiting-container { text-align: center; padding: 20px 0; }
.waiting-icon { margin-bottom: 20px; }
.waiting-icon svg { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.denied-icon svg { animation: none; }
.waiting-status {
  margin-top: 24px; padding: 12px 20px; background: var(--ruby-soft);
  border-radius: 10px; font-size: 0.85em; font-weight: 600;
  color: var(--ruby); display: inline-block;
}

@media (max-width: 768px) {
  .checkout-container { flex-direction: column; }
  .checkout-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 28px; }
  .checkout-right { padding: 28px; }
}
