/* checkout.css - Premium Fintech Investment Flow */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dashboard Color Theme - Consistent */
  --blue: #1A3C6E;
  --blue-mid: #2756A0;
  --blue-light: #3B78D4;
  --blue-pale: #EBF2FC;
  --blue-subtle: #F4F8FD;
  --accent: #F0A500;
  --accent-light: #FFB92A;
  --green: #16a34a;
  --green-pale: #f0fdf4;
  --red: #dc2626;
  --red-pale: #fef2f2;
  --white: #FFFFFF;
  --text: #1A1F2E;
  --text-mid: #4A5568;
  --text-muted: #8A96A8;
  --border: #D6E4F5;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Shadows - Matching Dashboard */
  --shadow-sm: 0 1px 3px rgba(26,60,110,0.06);
  --shadow-md: 0 4px 12px rgba(26,60,110,0.08);
  --shadow-lg: 0 12px 48px rgba(26,60,110,0.16);
  --shadow-xl: 0 12px 48px rgba(26,60,110,0.16);
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--blue-subtle);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* SKIP LINK */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.sr-only:focus { position: static; width: auto; height: auto; padding: 0.5rem 1rem; margin: 0; overflow: visible; clip: auto; white-space: normal; background: var(--blue); color: var(--white); z-index: 9999; }

/* NAV */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blue-mid);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-back:hover {
  color: var(--blue);
  gap: 0.75rem;
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-pale);
  color: var(--green);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.secure-badge i { font-size: 0.9rem; }

/* MAIN CONTAINER */
main { flex: 1; padding: 2rem 1rem; }

.wizard-container {
  max-width: 900px;
  margin: 0 auto;
}

/* STEP INDICATOR */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue-pale);
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-item.active .step-number {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  transform: scale(1.1);
}

.step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}

.step-item.active .step-title {
  color: var(--blue);
  font-weight: 700;
}

.step-connector {
  width: 60px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
  position: relative;
  bottom: 24px;
}

.step-connector.active {
  background: var(--blue-mid);
}

/* WIZARD STEPS */
.wizard-step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.wizard-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-content {
  background: var(--white);
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.step-content h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 2rem;
}

/* PLAN GRID */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-light), var(--blue-mid));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.plan-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.plan-card.selected {
  border-color: var(--blue);
  background: var(--blue-pale);
  box-shadow: var(--shadow-lg);
}

.plan-card-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.plan-card.selected .plan-card-name {
  color: var(--blue-mid);
}

.plan-card-range {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.plan-card-rate {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.plan-card-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* AMOUNT INPUT */
.amount-input-section {
  margin-bottom: 2rem;
}

.amount-input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.amount-input-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--blue-pale);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}

.amount-input-field:focus-within {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(26, 77, 122, 0.1);
}

.currency {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue);
  margin-right: 0.5rem;
}

.amount-input-field input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue);
  outline: none;
}

.amount-input-field input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

/* PREVIEW */
.amount-preview {
  background: var(--blue-pale);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.preview-row span:first-child {
  color: var(--text-mid);
  font-weight: 500;
}

.preview-row span:last-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
}

/* CRYPTO SELECTOR */
.crypto-selector {
  margin-bottom: 2rem;
}

.crypto-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.crypto-option {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.crypto-option:hover {
  border-color: var(--blue-light);
  box-shadow: var(--shadow-md);
}

.crypto-option.selected {
  border-color: var(--blue);
  background: var(--blue-pale);
  box-shadow: var(--shadow-lg);
}

.crypto-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--blue);
  font-weight: 700;
}

.crypto-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.crypto-ticker {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.crypto-amount {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-mid);
}

/* ADDRESS DISPLAY */
.address-display {
  margin-bottom: 2rem;
}

.address-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.address-box {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.address-text {
  flex: 1;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--white);
  word-break: break-all;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.address-copy {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--blue);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.address-copy:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

.address-copy.copied {
  background: var(--green);
  color: var(--white);
}

/* SUMMARY CARD */
.summary-card {
  background: var(--blue-pale);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
  padding-top: 0.5rem;
}

.summary-row span:first-child {
  color: var(--text-mid);
  font-weight: 500;
}

.summary-row span:last-child {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
}

/* WIZARD ACTIONS */
.wizard-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-back, .btn-next, .btn-submit {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-back {
  background: var(--border);
  color: var(--text-mid);
  border: 2px solid var(--border);
  min-width: 200px;
}

.btn-back:hover:not(:disabled) {
  background: var(--blue-pale);
  border-color: var(--blue-light);
  color: var(--blue);
}

.btn-next, .btn-submit {
  background: var(--blue);
  color: var(--white);
  min-width: 200px;
  box-shadow: var(--shadow-md);
}

.btn-next:hover:not(:disabled), .btn-submit:hover:not(:disabled) {
  background: var(--blue-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-next:disabled, .btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-submit {
  background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
  min-width: 280px;
}

.btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

/* LOADING STATE */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

/* NOTIFICATION */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--white);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

.notification.success {
  border-left: 4px solid var(--green);
}

.notification.error {
  border-left: 4px solid var(--red);
}

.notification-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.notification-close:hover {
  color: var(--text);
  transform: scale(1.2);
}

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-wrapper { padding: 1rem; }
  .step-indicator { gap: 1rem; margin-bottom: 2rem; }
  .step-connector { width: 40px; }
  .step-content { padding: 1.5rem; }
  .step-content h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }
  .plan-grid { grid-template-columns: 1fr; gap: 1rem; }
  .crypto-options { grid-template-columns: 1fr 1fr; }
  .wizard-actions { flex-direction: column; }
  .btn-back, .btn-next, .btn-submit { min-width: 100%; }
  .address-box { flex-direction: column; align-items: stretch; }
  .address-copy { width: 100%; }
  .notification { max-width: calc(100vw - 40px); right: 20px; left: 20px; }
}

@media (max-width: 480px) {
  main { padding: 1rem 0.5rem; }
  .step-indicator { flex-wrap: wrap; gap: 0.5rem; }
  .step-connector { display: none; }
  .step-number { width: 40px; height: 40px; font-size: 0.9rem; }
  .step-content { padding: 1rem; border-radius: 12px; }
  .step-content h2 { font-size: 1.1rem; margin-bottom: 1rem; }
  .amount-input-field input { font-size: 1.2rem; }
  .crypto-options { grid-template-columns: 1fr; }
  .summary-card { gap: 0.75rem; }
  .btn-back, .btn-next, .btn-submit { padding: 0.85rem 1.5rem; font-size: 0.85rem; }
}