/* FinPay — Minimalist Sovereign Design System */
/* Darkrooms Core Labs Co. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent-green: #059669;
  --accent-green-bg: #ecfdf5;
  --accent-green-border: #a7f3d0;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;
  --accent-red: #dc2626;
  --accent-red-bg: #fef2f2;
  --accent-red-border: #fecaca;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Container & Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.checkout-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
}

.checkout-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}

/* Card Header */
.card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.order-badge {
  text-align: right;
}

.order-badge .amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.order-badge .order-id {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Steps Progress */
.progress-bar {
  display: flex;
  height: 4px;
  background: #f1f5f9;
}

.progress-step {
  flex: 1;
  background: #f1f5f9;
  transition: background 0.3s ease;
}

.progress-step.active {
  background: var(--primary);
}

.progress-step.completed {
  background: var(--accent-green);
}

/* Card Body */
.card-body {
  padding: 28px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
}

.country-code-addon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.country-code-addon img {
  width: 18px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrapper .form-control {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(15 23 42 / 0.08);
}

.form-control::placeholder {
  color: var(--text-subtle);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background: #f8fafc;
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-success {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-success:hover {
  background: #047857;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* OTP Digits Input */
.otp-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}

.otp-box {
  width: 54px;
  height: 60px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s ease;
}

.otp-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(15 23 42 / 0.1);
}

/* Timers & Countdown */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.timer-badge.urgent {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

/* QR Code Section */
.qr-card {
  text-align: center;
  padding: 16px 0;
}

.qr-box {
  display: inline-block;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.qr-box img {
  display: block;
  width: 200px;
  height: 200px;
}

/* App Switcher Buttons */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.app-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.app-btn:hover {
  background: #ffffff;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.app-btn svg, .app-btn img {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
}

/* UTR Submission Box */
.utr-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

/* Card Footer */
.card-footer {
  padding: 16px 28px;
  background: #fafbfc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.card-footer a {
  color: var(--text-main);
  text-decoration: underline;
  cursor: pointer;
}

/* Offline Banner */
.offline-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #b91c1c;
  color: #ffffff;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
}

/* Success Card */
.success-card {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-green-bg);
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent-green);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
}
