/* ── PayVella Checkout — styles.css ──────────────────────────────────────────
   Premium dark theme checkout page. Clean, trust-inspiring, fast.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  --bg:          #0A0A0F;
  --surface:     #13131A;
  --surface-2:   #1C1C26;
  --border:      rgba(255,255,255,0.07);
  --accent:      #6C63FF;
  --accent-2:    #4ECDC4;
  --text:        #F0F0F5;
  --text-muted:  #888899;
  --success:     #4ECDC4;
  --error:       #FF6B6B;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 24px 64px rgba(0,0,0,0.6);
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 80px;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(108,99,255,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(78,205,196,0.08) 0%, transparent 60%);
}

/* ── Screens ─────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  max-width: 460px;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; }

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

/* ── Loading ─────────────────────────────────────────────────────────────── */
#loading-screen {
  justify-content: center;
  min-height: 70vh;
  gap: 20px;
}
.logo-mark { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.85; }
}
.loading-text { color: var(--text-muted); font-size: 14px; }
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card base ───────────────────────────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.checkout-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}
.payvella-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.secure-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 500;
  background: rgba(78,205,196,0.08);
  border: 1px solid rgba(78,205,196,0.2);
  padding: 5px 10px;
  border-radius: 100px;
}

/* ── Invoice Card ────────────────────────────────────────────────────────── */
.invoice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.merchant-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 20px;
}
.merchant-avatar {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.merchant-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.invoice-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 24px;
}
.invoice-details {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.detail-icon {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
.detail-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.detail-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; }

.amount-section {
  padding: 20px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.amount-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.amount-value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Pay Button ──────────────────────────────────────────────────────────── */
.pay-button {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, var(--accent), #8B84FF);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  box-shadow: 0 8px 32px rgba(108,99,255,0.35);
  position: relative;
  overflow: hidden;
}
.pay-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  border-radius: inherit;
}
.pay-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(108,99,255,0.45);
}
.pay-button:active:not(:disabled) { transform: translateY(0); }
.pay-button:disabled { opacity: 0.6; cursor: not-allowed; }
.pay-btn-icon { font-size: 16px; }

.payment-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0 8px;
}

/* ── Banners ─────────────────────────────────────────────────────────────── */
.paid-banner {
  width: 100%;
  background: rgba(78,205,196,0.1);
  border: 1px solid rgba(78,205,196,0.25);
  color: var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* ── Error / Success Cards ───────────────────────────────────────────────── */
.error-card, .success-card {
  margin-top: 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.error-icon {
  width: 56px; height: 56px;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--error);
}
.success-icon { margin-bottom: 4px; }
h2 { font-size: 22px; font-weight: 700; }
p { color: var(--text-muted); font-size: 14px; }
.support-text { font-size: 13px; }
.support-text a { color: var(--accent); text-decoration: none; }
.txn-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: monospace;
  width: 100%;
  text-align: center;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.page-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px;
  background: linear-gradient(transparent, rgba(10,10,15,0.95));
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 16px 12px 80px; }
  .amount-value { font-size: 28px; }
  .card { padding: 24px; }
}
