/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple-600: #7C3AED;
  --purple-500: #8B5CF6;
  --purple-400: #A78BFA;
  --cyan-500: #06B6D4;
  --cyan-400: #22D3EE;
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-100: #F1F5F9;
  --white: #FFFFFF;
  --gradient: linear-gradient(135deg, var(--purple-600) 0%, var(--cyan-500) 100%);
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --input-bg: rgba(255,255,255,0.06);
  --input-border: rgba(255,255,255,0.12);
  --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.25), 0 0 120px rgba(6,182,212,0.10);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--slate-900);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ─── Animated Background Orbs ─────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #7C3AED, transparent 70%);
  top: -150px; left: -150px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06B6D4, transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: 3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #8B5CF6, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 6s;
}

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

/* ─── Page Wrapper ──────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
}

/* ─── Header ────────────────────────────────────────────────── */
.header {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 4px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 6px;
}
.logo-icon svg { width: 100%; height: 100%; }

.logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--purple-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Payment Card ──────────────────────────────────────────── */
.payment-card {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow), 0 25px 50px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: slideUp 0.5s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Card Header ───────────────────────────────────────────── */
.card-header {
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(6,182,212,0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.telebirr-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telebirr-icon { flex-shrink: 0; }
.telebirr-icon svg { width: 44px; height: 44px; }

.brand-name {
  display: block;
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-size: 12px;
  color: var(--slate-400);
  font-weight: 400;
  margin-top: 2px;
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #34D399;
  font-weight: 600;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 5px 10px;
  border-radius: 20px;
}
.lock-icon { width: 13px; height: 13px; }

/* ─── Card Divider ──────────────────────────────────────────── */
.card-divider {
  height: 1px;
  background: var(--card-border);
  margin: 0;
}

/* ─── Payment Form ──────────────────────────────────────────── */
.payment-form {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-300);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.03em;
}
.label-icon { width: 15px; height: 15px; color: var(--purple-400); flex-shrink: 0; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-400);
  pointer-events: none;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--white);
  transition: var(--transition);
  outline: none;
  appearance: none;
  -moz-appearance: textfield;
}
.form-input::placeholder { color: var(--slate-600); font-weight: 400; }
.form-input:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
  background: rgba(255,255,255,0.08);
}
.form-input:read-only {
  color: var(--slate-400);
  cursor: default;
}
.form-input[type="number"] { padding-left: 50px; }

/* Remove number arrows */
.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

.refresh-btn {
  position: absolute;
  right: 10px;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 7px;
  padding: 6px;
  cursor: pointer;
  color: var(--purple-400);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.refresh-btn:hover {
  background: rgba(124,58,237,0.35);
  color: var(--purple-300);
  transform: rotate(180deg);
}
.refresh-btn svg { width: 14px; height: 14px; }

/* ─── Summary Box ───────────────────────────────────────────── */
.summary-box {
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-label { font-size: 13px; color: var(--slate-400); font-weight: 400; }
.summary-value { font-size: 14px; color: var(--white); font-weight: 600; }

.telebirr-tag {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-divider {
  height: 1px;
  background: rgba(124,58,237,0.2);
}

.total-row .summary-label {
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
}
.total-value {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Alert ──────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #FCA5A5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Pay Button ─────────────────────────────────────────────── */
.pay-button {
  width: 100%;
  padding: 16px;
  background: var(--gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124,58,237,0.4);
  letter-spacing: 0.02em;
}

.pay-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.pay-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.55);
}
.pay-button:hover::before { opacity: 1; }

.pay-button:active { transform: translateY(0); }
.pay-button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.btn-content, .btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-icon { width: 20px; height: 20px; }

/* Spinner */
.spinner { width: 20px; height: 20px; animation: spin 1s linear infinite; }
.spinner-track { opacity: 0.25; }
.spinner-head { transform-origin: center; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── Form Footer ────────────────────────────────────────────── */
.form-footer {
  font-size: 12px;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.6;
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(30,41,59,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,58,237,0.2);
  animation: toastIn 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 100;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-icon { font-size: 22px; }
.toast-text { display: flex; flex-direction: column; gap: 2px; }
.toast-text strong { font-size: 14px; color: var(--white); }
.toast-text span { font-size: 12px; color: var(--slate-400); }

/* ─── Main & Footer ──────────────────────────────────────────── */
.main-content { flex: 1; width: 100%; max-width: 480px; }

.footer {
  text-align: center;
  padding: 32px 16px 20px;
  color: var(--slate-600);
  font-size: 12px;
  line-height: 1.8;
}
.footer-note { color: var(--slate-700); margin-top: 2px; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
  .card-header { padding: 18px 20px 16px; }
  .payment-form { padding: 20px; gap: 16px; }
  .header-badge { display: none; }
}
