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

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

:root {
  --primary: #1B2B7E;
  --primary-dark: #131F5A;
  --primary-light: #2D3EA6;
  --accent: #00BFFF;
  --accent-dark: #009ED4;
  --purple: #8B5CF6;
  --purple-dark: #7C3AED;
  --gradient: linear-gradient(135deg, #1B2B7E 0%, #8B5CF6 100%);
  --gradient-r: linear-gradient(135deg, #8B5CF6 0%, #1B2B7E 100%);
  --gradient-blue: linear-gradient(135deg, #1B2B7E 0%, #00BFFF 100%);
  --gradient-teal: linear-gradient(135deg, #0D9488 0%, #0EA5E9 100%);
  --gradient-warm: linear-gradient(135deg, #B45309 0%, #DC2626 100%);
  --gradient-rose: linear-gradient(135deg, #9D174D 0%, #EC4899 100%);
  --gradient-midnight: linear-gradient(135deg, #111827 0%, #374151 100%);
  --bg: #F4F6FF;
  --surface: #FFFFFF;
  --surface-2: #F9FAFF;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --border: #E4E7F0;
  --border-light: #F0F2FB;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --shadow-xs: 0 1px 2px rgba(27,43,126,0.06);
  --shadow-sm: 0 2px 8px rgba(27,43,126,0.08);
  --shadow: 0 4px 16px rgba(27,43,126,0.12);
  --shadow-md: 0 8px 24px rgba(27,43,126,0.14);
  --shadow-lg: 0 16px 48px rgba(27,43,126,0.18);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --nav-height: 72px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
}

html, body { height: 100%; font-family: var(--font); -webkit-font-smoothing: antialiased; }

body { background: #0D1033; overflow: hidden; }

.phone-frame {
  max-width: 390px;
  width: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0D1033 0%, #1B0640 100%);
  }
  .phone-frame {
    height: 844px;
    border-radius: 48px;
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.08),
      0 40px 80px rgba(0,0,0,0.7),
      inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
  }
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.status-bar .time { font-size: 15px; font-weight: 600; }
.status-bar .icons { display: flex; gap: 5px; align-items: center; }
.status-bar.dark .time, .status-bar.dark .icons { color: white; }
.status-bar.light .time, .status-bar.light .icons { color: var(--text-primary); }

/* Screen */
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen-inner { padding: 0 0 20px; }

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.header-left, .header-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.primary { background: var(--gradient); border-color: transparent; color: white; }

/* Bottom Nav */
.bottom-nav {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  height: var(--nav-height);
  flex-shrink: 0;
  box-shadow: 0 -4px 20px rgba(27,43,126,0.06);
  position: relative;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: none;
  transition: var(--transition);
}
.nav-item svg { color: #BCC3D9; transition: var(--transition); }
.nav-item .nav-label { font-size: 10px; font-weight: 500; color: #BCC3D9; transition: var(--transition); }
.nav-item.active svg { color: var(--primary); }
.nav-item.active .nav-label { color: var(--primary); font-weight: 700; }
.nav-scan {
  width: 56px; height: 56px;
  background: var(--gradient);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-top: -16px;
  box-shadow: 0 4px 16px rgba(27,43,126,0.4);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-scan svg { color: white; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 16px rgba(27,43,126,0.35); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(27,43,126,0.45); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-danger { background: var(--error); color: white; }
.btn-white { background: white; color: var(--primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn-xs { padding: 6px 14px; font-size: 12px; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--radius-sm); }

/* Inputs */
.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon-left { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,43,126,0.08); }
.input.icon-l { padding-left: 44px; }
.input::placeholder { color: var(--text-muted); }
.input-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.input-error { font-size: 12px; color: var(--error); margin-top: 5px; }

textarea.input { resize: none; min-height: 90px; line-height: 1.5; }

/* OTP */
.otp-group { display: flex; gap: 10px; justify-content: center; }
.otp-input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 22px; font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: var(--transition);
  font-family: var(--font);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,43,126,0.08); }
.otp-input.filled { border-color: var(--primary); background: rgba(27,43,126,0.04); }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* vCard Component */
.vcard-chip {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 170px;
  box-shadow: var(--shadow-md);
}
.vcard-chip::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.vcard-chip::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.vcard-chip .vc-content { position: relative; z-index: 1; }
.vcard-chip .vc-logo {
  font-size: 18px; font-weight: 800; letter-spacing: 0.08em;
  opacity: 0.85; margin-bottom: 20px; display: block;
}
.vcard-chip .vc-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.vcard-chip .vc-title { font-size: 13px; opacity: 0.8; margin-top: 3px; }
.vcard-chip .vc-company { font-size: 13px; opacity: 0.7; margin-top: 1px; }
.vcard-chip .vc-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px;
}
.vcard-chip .vc-phone { font-size: 12px; opacity: 0.75; }
.vcard-chip .vc-qr {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.vc-royal { background: var(--gradient); }
.vc-ocean { background: var(--gradient-blue); }
.vc-teal { background: var(--gradient-teal); }
.vc-warm { background: var(--gradient-warm); }
.vc-rose { background: var(--gradient-rose); }
.vc-midnight { background: var(--gradient-midnight); }

/* Avatar */
.avatar {
  border-radius: var(--radius-full);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
  flex-shrink: 0; object-fit: cover;
  font-family: var(--font);
}
.av-xs { width: 28px; height: 28px; font-size: 11px; }
.av-sm { width: 38px; height: 38px; font-size: 14px; }
.av-md { width: 48px; height: 48px; font-size: 18px; }
.av-lg { width: 64px; height: 64px; font-size: 24px; }
.av-xl { width: 80px; height: 80px; font-size: 30px; }
.av-2xl { width: 96px; height: 96px; font-size: 36px; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-primary { background: rgba(27,43,126,0.1); color: var(--primary); }
.badge-accent { background: rgba(0,191,255,0.12); color: #007CAE; }
.badge-success { background: var(--success-bg); color: #059669; }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-error { background: var(--error-bg); color: #DC2626; }
.badge-purple { background: rgba(139,92,246,0.1); color: #7C3AED; }
.badge-gray { background: #F3F4F6; color: #6B7280; }

/* Stat card */
.stat-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.stat-tile .st-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-tile .st-val { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-tile .st-lbl { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-tile .st-chg { font-size: 11px; font-weight: 600; margin-top: 4px; }
.st-up { color: var(--success); }
.st-down { color: var(--error); }

/* Section */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.section-link { font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: none; }

/* Tabs */
.tabs-pill {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 2px;
}
.tab-pill {
  flex: 1; padding: 9px 10px;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  text-align: center; border: none;
  background: transparent; transition: var(--transition);
  font-family: var(--font);
}
.tab-pill.active {
  background: var(--surface);
  color: var(--primary); font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* Divider with text */
.divider-text {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.divider-text span { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }

/* Social login btn */
.social-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface); transition: var(--transition);
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  font-family: var(--font);
}
.social-btn:hover { border-color: var(--primary); background: var(--surface-2); }

/* Progress Steps */
.steps-bar { display: flex; align-items: center; gap: 0; }
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  transition: var(--transition);
}
.step-circle.done { background: var(--success); color: white; }
.step-circle.active { background: var(--gradient); color: white; box-shadow: 0 3px 10px rgba(27,43,126,0.3); }
.step-circle.pending { background: var(--border); color: var(--text-muted); }
.step-line { flex: 1; height: 2px; background: var(--border); transition: var(--transition); }
.step-line.done { background: var(--success); }

/* List row */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-light);
}
.list-row:last-child { border-bottom: none; }
.lr-info { flex: 1; min-width: 0; }
.lr-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Settings row */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer;
  transition: var(--transition);
}
.settings-row:hover { background: var(--surface-2); }
.sr-left { display: flex; align-items: center; gap: 12px; }
.sr-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.sr-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.sr-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.sr-right { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }

/* Toggle switch */
.toggle {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer; position: relative; transition: var(--transition);
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { left: 23px; }

/* Share option */
.share-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; text-decoration: none;
}
.share-opt-icon {
  width: 58px; height: 58px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.share-opt:hover .share-opt-icon { transform: translateY(-2px); }
.share-opt span { font-size: 11px; font-weight: 500; color: var(--text-secondary); }

/* Bar chart */
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.chart-bar {
  flex: 1; border-radius: 4px 4px 0 0;
  background: rgba(27,43,126,0.15);
  position: relative; transition: var(--transition);
  cursor: pointer;
}
.chart-bar.active { background: var(--gradient); }
.chart-bar:hover { opacity: 0.85; }
.chart-lbl { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* Notification dot */
.notif-dot {
  width: 8px; height: 8px;
  background: var(--error);
  border-radius: 50%;
  position: absolute; top: -2px; right: -2px;
  border: 2px solid white;
}

/* Utility */
.p-20 { padding: 20px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.pt-16 { padding-top: 16px; }
.pb-20 { padding-bottom: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-white { color: white; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.anim-fadeUp { animation: fadeUp 0.4s ease both; }
.anim-fadeUp-2 { animation: fadeUp 0.4s 0.1s ease both; }
.anim-fadeUp-3 { animation: fadeUp 0.4s 0.2s ease both; }
.anim-fadeIn { animation: fadeIn 0.3s ease both; }
