/* ============= Buttons ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before { width: 300px; height: 300px; }

.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45);
}

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
}

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

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

.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 18px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { padding: 12px; border-radius: 12px; }

/* ============= Cards ============= */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============= Balance Card ============= */
.balance-card {
  background: var(--primary-gradient);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(30, 64, 175, 0.30);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 250px;
  height: 250px;
  background: rgba(255,255,255,0.10);
  border-radius: 50%;
  filter: blur(20px);
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 220px;
  height: 220px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  filter: blur(30px);
}

.balance-card > * { position: relative; z-index: 1; }

.balance-label {
  font-size: 13px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.balance-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.balance-amount .currency {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.85;
}

.balance-eye {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid rgba(255,255,255,0.28);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.balance-eye:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.08);
}

.balance-eye:active {
  transform: scale(0.95);
}

.balance-amount {
  flex-wrap: wrap;
}

.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.20);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.25);
}

/* ============= Quick Actions ============= */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: var(--radius);
  background: var(--white);
  transition: all var(--transition);
  text-align: center;
}

.quick-action:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.quick-action-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 22px;
  transition: all var(--transition);
}

.quick-action:hover .quick-action-icon {
  background: var(--primary-gradient);
  color: var(--white);
  transform: scale(1.1) rotate(-8deg);
}

.quick-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

/* ============= Promo Banner ============= */
.promo-banner {
  background: var(--primary-gradient);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.30);
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.10);
  border-radius: 50%;
  transform: translateY(-50%);
}

.promo-content h3 { color: white; margin-bottom: 4px; font-size: 20px; }
.promo-content p { opacity: 0.9; font-size: 14px; }
.promo-icon {
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.20);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  z-index: 1;
}

/* ============= Grid Services ============= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 12px 4px;
  cursor: pointer;
  transition: transform var(--transition);
}

.service-item:hover { transform: translateY(-4px); }

.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 22px;
  transition: all var(--transition);
}

.service-item:hover .service-icon {
  background: var(--primary);
  color: white;
}

.service-label { font-size: 11px; font-weight: 600; color: var(--text-2); }

/* ============= Bottom Navigation ============= */
.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 20px 50px rgba(30, 64, 175, 0.20);
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--transition);
  flex: 1;
}

.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .icon { font-size: 20px; }

.bottom-nav-fab {
  width: 56px;
  height: 56px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.45);
  transform: translateY(-12px);
  transition: all var(--transition);
}

.bottom-nav-fab:hover { transform: translateY(-16px) scale(1.05); }

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}

/* ============= Header ============= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: transparent;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.greeting-name { font-weight: 700; font-size: 15px; }
.greeting-text { font-size: 12px; color: var(--muted); }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover { background: var(--primary); color: white; transform: scale(1.05); }
.icon-btn .badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

/* ============= Forms ============= */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--white);
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-control::placeholder { color: var(--muted-2); }

.input-group {
  position: relative;
}

.input-group .form-control { padding-left: 46px; }
.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 18px;
}

/* File upload */
.upload-area {
  display: block;
  width: 100%;
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--primary-gradient-soft);
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.18);
}

.upload-area.has-file {
  border-style: solid;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.08);
  padding: 14px;
}

.upload-area .icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 10px;
  display: block;
  line-height: 1;
}
.upload-area .label {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}
.upload-area .hint {
  font-size: 12px;
  color: var(--muted);
  display: block;
}
.upload-area img {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

/* ============= Progress / Steps ============= */
.steps-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.step-dot.active::after,
.step-dot.completed {
  background: var(--primary-gradient);
}

.step-dot.completed {
  height: 6px;
}

.step-dot.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-gradient);
  animation: stepFill 0.6s ease forwards;
}

@keyframes stepFill {
  from { width: 0%; }
  to { width: 100%; }
}

.step-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}

/* ============= Alerts / Toasts ============= */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success { background: rgba(16, 185, 129, 0.10); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.10); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.10); color: var(--warning); }
.alert-info { background: rgba(59, 130, 246, 0.10); color: var(--info); }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 4px solid var(--success); color: var(--success); }
.toast.error { border-left: 4px solid var(--danger); color: var(--danger); }

/* ============= Badges ============= */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-approved, .badge-completed, .badge-active, .badge-verified { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-rejected, .badge-failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* ============= Modal ============= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  padding: 16px;
}

.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-xl);
}

.modal-backdrop.show .modal { transform: scale(1) translateY(0); }

/* ============= Transaction Item ============= */
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.tx-item:hover { background: var(--surface-2); transform: translateX(-4px); }

.tx-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tx-icon.income { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.tx-icon.expense { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.tx-icon.pending { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.tx-info { flex: 1; min-width: 0; }
.tx-title { font-weight: 700; font-size: 14px; }
.tx-date { font-size: 12px; color: var(--muted); }
.tx-amount { font-weight: 800; font-size: 15px; }
.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--danger); }

/* ============= Virtual Card ============= */
.vcard {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1.586 / 1;
  background: var(--primary-gradient);
  border-radius: 20px;
  padding: 22px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(30, 64, 175, 0.35);
  margin: 0 auto;
}

.vcard::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
}

.vcard-chip {
  width: 48px;
  height: 36px;
  border-radius: 7px;
  position: relative;
  z-index: 1;
  background:
    linear-gradient(135deg,
      #d4a437 0%,
      #f5d97e 18%,
      #c69219 35%,
      #f5d97e 55%,
      #b8841a 75%,
      #e8c862 92%,
      #a87410 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 150, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Inner contact pads (the real chip pattern) */
.vcard-chip::before {
  content: '';
  position: absolute;
  inset: 4px 6px;
  border-radius: 3px;
  background:
    linear-gradient(to right, transparent 32%, rgba(0,0,0,0.35) 32%, rgba(0,0,0,0.35) 34%, transparent 34%, transparent 65%, rgba(0,0,0,0.35) 65%, rgba(0,0,0,0.35) 67%, transparent 67%),
    linear-gradient(to bottom, transparent 22%, rgba(0,0,0,0.35) 22%, rgba(0,0,0,0.35) 24%, transparent 24%, transparent 48%, rgba(0,0,0,0.35) 48%, rgba(0,0,0,0.35) 50%, transparent 50%, transparent 74%, rgba(0,0,0,0.35) 74%, rgba(0,0,0,0.35) 76%, transparent 76%);
  background-size: 100% 100%, 100% 100%;
  opacity: 0.85;
}

/* Center contact square */
.vcard-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  background: linear-gradient(135deg, #a87410, #6b4408);
  box-shadow:
    inset 0 1px 1px rgba(255, 220, 130, 0.4),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4);
}

/* Contactless wave (NFC) next to chip */
.vcard-contactless {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-left: 12px;
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  transform: rotate(90deg);
  vertical-align: middle;
}

.vcard-number {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  letter-spacing: 3px;
  margin: 22px 0 14px;
  position: relative;
  z-index: 1;
  font-weight: 600;
}

.vcard-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.vcard-label { font-size: 9px; opacity: 0.75; text-transform: uppercase; letter-spacing: 1px; }
.vcard-value { font-size: 13px; font-weight: 700; margin-top: 2px; }
.vcard-brand { font-size: 22px; font-weight: 800; font-style: italic; }

/* Action buttons under the virtual card */
.vcard-actions {
  display: flex !important;
  gap: 12px !important;
  margin-top: 22px !important;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

button.vcard-action-btn,
.vcard-action-btn {
  flex: 1 1 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 13px 16px !important;
  border-radius: var(--radius) !important;
  background: #FFFFFF !important;
  color: var(--primary) !important;
  border: 2px solid var(--primary-light) !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12) !important;
  outline: none;
}

button.vcard-action-btn:hover,
.vcard-action-btn:hover {
  background: var(--primary-gradient) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35) !important;
}

.vcard-action-btn:active {
  transform: translateY(0);
}

.vcard-action-btn i {
  font-size: 16px;
}

/* ============= Empty State ============= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .icon {
  font-size: 64px;
  color: var(--muted-2);
  margin-bottom: 16px;
}

.empty-state h3 { font-size: 18px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 14px; }

/* ============= Loading ============= */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============= Page Header ============= */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-2);
  transition: all var(--transition);
}

.back-btn:hover { background: var(--primary); color: white; }
.page-title { font-size: 18px; font-weight: 700; flex: 1; }
