/* === Klix Pay Link PoC - Mobile-First Design === */

:root {
  --primary: #10B981;
  --primary-dark: #059669;
  --primary-light: #D1FAE5;
  --primary-bg: #ECFDF5;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --bg: #F9FAFB;
  --card-bg: #FFFFFF;
  --border: #E5E7EB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* === Banner === */

.mode-banner {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  text-align: center;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mode-banner.live {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* === Header === */

.header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 16px 16px;
  text-align: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.header .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.badge-klix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* === Container === */

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* === Cards === */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* === Forms === */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

/* === Buttons === */

.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

/* === Payment Info === */

.payment-info {
  text-align: center;
  padding: 10px 0;
}

.amount {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.amount .currency {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
}

.description {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.sender {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Fee Breakdown === */

.fee-breakdown {
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 16px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.fee-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.fee-row .label {
  flex-shrink: 0;
}

.fee-row .value {
  text-align: right;
}

/* === Bank Selection Grid === */

.bank-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.bank-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  min-height: 80px;
}

.bank-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.bank-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.bank-card .bank-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.bank-icon-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

/* === Status === */

.status-container {
  text-align: center;
  padding: 20px 0;
}

.status-icon {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}

.status-icon.success { color: var(--success); }
.status-icon.error { color: var(--error); }
.status-icon.pending { color: var(--warning); }

.status-message {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.status-detail {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Result Card (after creating request) === */

.result-section {
  display: none;
}

.result-section.visible {
  display: block;
}

.link-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  word-break: break-all;
  font-size: 14px;
  color: var(--primary-dark);
  font-family: 'SF Mono', 'Fira Code', monospace;
  cursor: pointer;
  transition: background 0.2s;
}

.link-box:hover {
  background: var(--primary-bg);
}

.qr-container {
  text-align: center;
  padding: 16px 0;
}

.qr-container canvas {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* === Error Box === */

.error-box {
  display: none;
  background: var(--error-bg);
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid #FECACA;
}

.error-box.visible {
  display: block;
}

/* === Spinner === */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

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

/* === Loading Overlay === */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.loading-overlay p {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === Copy Toast === */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  z-index: 2000;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Demo Mode Checkout === */

.demo-checkout {
  max-width: 400px;
  margin: 40px auto;
  padding: 20px;
}

.demo-checkout .demo-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.demo-checkout .demo-actions .btn {
  flex: 1;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
}

/* === Responsive === */

@media (min-width: 640px) {
  .container {
    padding: 24px;
  }

  .header {
    padding: 28px 24px 20px;
  }

  .header h1 {
    font-size: 24px;
  }

  .bank-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
