@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;600;700&display=swap');

:root {
  --app-bg: #f6f5f3;
  --card-bg: #ffffff;
  --primary: #5f259e;
  --primary-dark: #441a71;
  --accent: #f4a261;
  --danger: #e76f51;
  --text-main: #1f2933;
  --text-muted: #9ca3af;
  --shadow-soft: 0 8px 18px rgba(57, 18, 103, 0.16);
}

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

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--app-bg);
  color: var(--text-main);
}

.app-shell {
  max-width: 480px;
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  position: relative;
}

/* Top bar */
.top-bar {
  height: 64px;
  background: linear-gradient(135deg, #5f259e, #8a42d1);
  padding-top: env(safe-area-inset-top);
  padding-bottom: 8px;
  box-shadow: 0 4px 12px rgba(52, 16, 96, 0.3);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.profile-initial {
  color: #ffffff;
  font-weight: 600;
  font-size: 18px;
}

.tiny-text {
  font-size: 11px;
}

.wallet-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-btn i {
  color: #ffffff;
  font-size: 18px;
}

/* Content area */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 72px;
}

/* Hero slider */
.hero-section {
  padding-top: 10px;
}

.hero-slider {
  position: relative;
  height: 140px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
}

.hero-card {
  height: 100%;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-img-card {
  background: #ffffff;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-title {
  font-size: 17px;
  font-weight: 600;
}

.hero-subtitle {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

.hero-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(95, 37, 158, 0.2);
}

.hero-dot.active {
  width: 16px;
  background: rgba(95, 37, 158, 0.9);
}

/* Sections */
.section-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 12px 12px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
}

/* Tiles */
.action-tile {
  width: 100%;
  border: none;
  padding: 6px 4px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(95, 37, 158, 0.25);
}

.tile-icon i {
  display: inline-block;
}

.tile-icon-inner {
  letter-spacing: 0.5px;
}

/* icon color variants */
.bg-icon-1 {
  background: linear-gradient(135deg, #5f259e, #8a42d1);
}

.bg-icon-2 {
  background: linear-gradient(135deg, #5f259e, #2c7a7b);
}

.bg-icon-3 {
  background: linear-gradient(135deg, #f4a261, #e76f51);
}

.bg-icon-4 {
  background: linear-gradient(135deg, #5f259e, #1890ff);
}

.bg-icon-5 {
  background: linear-gradient(135deg, #ffb703, #fb8500);
}

.bg-icon-6 {
  background: linear-gradient(135deg, #e63946, #f3722c);
}

.bg-icon-7 {
  background: linear-gradient(135deg, #8e44ad, #c06c84);
}

.tile-label {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-main);
}

.small-label {
  font-size: 10px;
}

/* QR result box */
.qr-result {
  min-height: 34px;
  font-size: 11px;
}

/* Footer nav */
.footer-nav {
  height: 60px;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 -4px 12px rgba(15, 24, 38, 0.08);
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.footer-btn {
  border: none;
  background: transparent;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 10px;
}

.footer-btn.active {
  color: var(--primary);
}

.footer-label {
  margin-top: 2px;
}

/* Footer icons */
.footer-icon {
  font-size: 18px;
}

/* QR button */
.qr-circle {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5f259e, #8a42d1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(95, 37, 158, 0.45);
  margin-bottom: 18px;
  color: #ffffff;
}

/* History icon */
.history-icon span {
  display: none;
}

/* QR overlay */
.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.qr-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.qr-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #0b2530;
  border-radius: 16px 16px 0 0;
  padding: 10px 14px 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.qr-overlay-header {
  color: #ffffff;
}

.qr-reader {
  width: 100%;
  height: 260px;
  background: #000000;
  border-radius: 12px;
  overflow: hidden;
}

/* Hide html5-qrcode default borders */
#qrReader > div {
  border-radius: 12px !important;
}

/* utility */
.d-none {
  display: none !important;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 29, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 999;
}

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

.feedback-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  width: min(360px, 100%);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
  text-align: center;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.feedback-modal.show .feedback-card {
  transform: translateY(0);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: #9aa6c2;
  cursor: pointer;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.checkmark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: block;
  stroke-width: 4;
  stroke: #00cb75;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #00cb75;
  animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 4;
  stroke-miterlimit: 10;
  stroke: #00cb75;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes fill {
  100% {
    box-shadow: inset 0px 0px 0px 30px rgba(0, 203, 117, 0.1);
  }
}

.error-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #ff5c5c;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.error-icon::before,
.error-icon::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 3px;
  background: #ff5c5c;
  border-radius: 999px;
}

.error-icon::before {
  transform: rotate(45deg);
}

.error-icon::after {
  transform: rotate(-45deg);
}

.feedback-card h3 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1d2d44;
}

.feedback-card p {
  color: #4b5b7a;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.feedback-card ul {
  text-align: left;
  color: #ff5c5c;
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.feedback-card button.cta {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0066ff, #00cb75);
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  width: 100%;
}

@media (max-height: 700px) {
  .hero-section {
    display: none;
  }
  .app-content {
    padding-top: 6px;
  }
}