:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --header-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  --secondary: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}

body {
  padding-top: 50px;
}

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

/* Slim Modern Blue Header - Fixed to top always */
.app-header {
  background: var(--header-bg);
  padding: 0 16px;
  height: 50px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 500;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apk-download-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.apk-download-btn {
  text-decoration: none;
  background: #ffffff;
  color: #1e40af;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  border: 1.5px solid #ffffff;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.apk-text-mobile {
  display: none;
}

.apk-text-desktop {
  display: inline;
}

@media (max-width: 600px) {
  .brand-title {
    font-size: 0.86rem !important;
  }
  .brand-logo-img {
    width: 24px !important;
    height: 24px !important;
  }
  .apk-download-btn {
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
    border-radius: 14px !important;
    gap: 3px !important;
  }
  .apk-text-desktop {
    display: none !important;
  }
  .apk-text-mobile {
    display: inline !important;
  }
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.brand-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.1px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: #bfdbfe;
  font-weight: 500;
  margin-top: 2px;
}

.header-status-badge {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
}

/* Container */
.container {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

/* Form Card */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.card-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.card-title-group {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Sleek Compact Scan Button */
.btn-compact-scan {
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  border-radius: 10px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-compact-scan:active {
  background: #dbeafe;
  transform: scale(0.97);
}

/* Inputs */
.input-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #475569;
  text-transform: uppercase;
}

.input-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  font-size: 16px;
  pointer-events: none;
}

.input-field {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 38px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  transition: all 0.2s;
  font-family: monospace, sans-serif;
  letter-spacing: 0.5px;
}

.input-field:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  display: none;
}

.input-field:not(:placeholder-shown) + .clear-btn {
  display: block;
}

/* Captcha Blocks - Mobile Responsive (Never Overflows) */
.captcha-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 12px;
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.captcha-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
}

.auto-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

.captcha-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.captcha-img-holder {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  height: 40px;
  flex: 1.2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}

.captcha-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.refresh-captcha-btn {
  background: #e2e8f0;
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  font-size: 16px;
}

.captcha-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: center;
  outline: none;
  text-transform: lowercase;
}

.captcha-input:focus {
  border-color: var(--primary);
}

/* Primary Action Button */
.btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  margin-top: 4px;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled,
.btn-primary.is-loading {
  background: linear-gradient(135deg, #1e40af, #2563eb) !important;
  opacity: 0.92;
  cursor: wait !important;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
  transform: none !important;
}

/* Status Error Box */
.status-error-box {
  display: none;
  background: #fef2f2;
  border: 1.5px solid #f87171;
  border-radius: 12px;
  padding: 13px 15px;
  margin-top: 14px;
  color: #991b1b;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

.status-error-box span {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Results Display */
.result-section {
  display: none;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

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

.result-card-container {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid #cbd5e1;
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.result-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #f97316;
  padding-bottom: 12px;
  margin-bottom: 14px;
  padding-right: 44px;
  gap: 8px;
}

.result-site-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}

.site-badge-globe {
  font-size: 0.85rem;
}

.site-badge-url {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: 0.3px;
}

.result-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-badge-icon {
  background: #e6f7ec;
  color: #10b981;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.result-brand-title {
  font-size: 1.08rem;
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: -0.3px;
}

.result-brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: #059669;
}

.status-badge-live {
  background: #d1fae5;
  color: #065f46;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checked-time {
  font-size: 0.65rem;
  color: #64748b;
  text-align: right;
  margin-top: 3px;
}

/* Applicant Info Strip */
.applicant-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.info-item-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 3px;
  letter-spacing: 0.4px;
}

.info-item-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.val-blue { color: #2563eb; }
.val-purple { color: #7c3aed; }
.val-green { color: #059669; }

/* Status Cards Grid */
.status-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-status-card {
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 70%);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.12);
  transition: all 0.3s ease;
}

.portal-status-card.theme-success {
  border-color: #10b981;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 70%);
}

.portal-status-card.theme-pending {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 70%);
}

.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.portal-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  color: #15803d;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #16a34a;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.status-main-msg {
  font-size: 1.25rem;
  font-weight: 900;
  color: #15803d;
  line-height: 1.35;
  margin: 8px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.status-msg-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-left: 5px solid #16a34a;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.06);
}

.status-sub-msg {
  font-size: 0.98rem;
  font-weight: 600;
  color: #14532d;
  line-height: 1.6;
  margin: 0;
}

.ivac-tracker-card {
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.ivac-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #1e3a8a;
}

/* Delivery Progress */
.progress-header-row {
  background: #f1f5f9;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
}

.progress-bar-track {
  width: 100%;
  height: 9px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 5px;
  transition: width 0.6s ease;
}

/* Steps Table */
.steps-table {
  width: 100%;
  border-collapse: collapse;
}

.steps-table th {
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
  padding: 9px 10px;
  letter-spacing: 0.4px;
}

.steps-table td {
  padding: 10px 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.badge-done {
  background: #a7f3d0;
  color: #065f46;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.badge-pending {
  background: #e2e8f0;
  color: #64748b;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.result-footer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.btn-secondary {
  flex: none;
  width: auto;
  min-width: 120px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  border-radius: 10px;
  padding: 6px 20px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* Scanner Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

/* Result Modal Overlay: Crisp, clear without black blur so side rails stay visible */
#result-modal.modal-overlay {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 8px 6px;
}

.result-modal-card {
  position: relative;
  max-width: 480px;
  width: 98%;
  padding: 32px 10px 14px 10px;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;
}

.result-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  transform: scale(1.08);
}

/* Card 1: Visa Portal Status Card */
#result-modal .portal-status-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #dc2626;
  border-radius: 14px;
  padding: 14px 12px;
  margin-bottom: 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
#result-modal .portal-status-card.theme-success {
  border-left-color: #10b981;
}
#result-modal .portal-status-card.theme-pending,
#result-modal .portal-status-card.theme-danger {
  border-left-color: #dc2626;
}
#result-modal .portal-status-card.theme-warning {
  border-left-color: #f59e0b;
}
#result-modal .portal-status-card.theme-info {
  border-left-color: #3b82f6;
}

.portal-status-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
}

.portal-status-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.portal-status-circle.theme-success {
  background: #10b981;
}
.portal-status-circle.theme-danger {
  background: #dc2626;
}
.portal-status-circle.theme-warning {
  background: #f59e0b;
}
.portal-status-circle.theme-info {
  background: #3b82f6;
}

.portal-status-label {
  font-size: 1rem;
  font-weight: 800;
  color: #b91c1c;
}
.theme-success .portal-status-label {
  color: #047857;
}
.theme-warning .portal-status-label {
  color: #b45309;
}
.theme-info .portal-status-label {
  color: #1d4ed8;
}

#result-modal .portal-status-main {
  font-size: 1.22rem;
  font-weight: 800;
  color: #dc2626;
  line-height: 1.35;
  margin: 6px 0 8px 0;
  text-align: center;
}
/* The theme class sits on the card itself, so it has to be matched after #result-modal.
   With the old order the heading stayed red even on a green "Visa Processed & Granted" card. */
#result-modal .theme-success .portal-status-main {
  color: #059669;
}
#result-modal .theme-warning .portal-status-main {
  color: #d97706;
}
#result-modal .theme-info .portal-status-main {
  color: #2563eb;
}

#result-modal .portal-status-sub {
  font-size: 0.88rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* Card 2: IVAC Delivery Tracker Card */
#result-modal .ivac-tracker-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #10b981;
  border-radius: 14px;
  padding: 12px 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ivac-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}
.tracker-truck-icon {
  font-size: 1.25rem;
}
.tracker-title-text {
  font-size: 1rem;
  font-weight: 800;
  color: #047857;
  letter-spacing: -0.2px;
}

.tracker-info-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.tracker-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  line-height: 1.35;
}

.tracker-info-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tracker-info-label {
  font-weight: 700;
  color: #2563eb;
}

.tracker-info-val {
  font-weight: 700;
  color: #0f172a;
}

.tracker-val-bold {
  font-weight: 800;
}

.tracker-val-blue {
  color: #2563eb;
  font-weight: 800;
}

.tracker-val-purple {
  color: #7c3aed;
  font-weight: 800;
}

.tracker-info-right {
  display: flex;
  align-items: center;
}

/* Row icons as coloured chips (calendar / eye / ID / passport) */
.tracker-row-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.tracker-row-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Two classes deep so the chip colour beats `.row-hide-toggle { background: none }` */
.tracker-row-icon.chip-delivery {
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
}

.tracker-row-icon.chip-name {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  border-radius: 50%;
}

.tracker-row-icon.chip-appid {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.tracker-row-icon.chip-passport {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

/* Row privacy toggles: tap the 👁 / 🆔 / 🛂 icon to hide or show that value */
.row-hide-toggle {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.row-hide-toggle:active {
  transform: scale(0.9);
}

.row-hide-toggle.is-active {
  opacity: 0.4;
}

.tracker-info-val.is-masked {
  color: #94a3b8 !important;
  letter-spacing: 2px;
}

/* Progress Box */
#result-modal .progress-header-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.progress-title-caps {
  font-size: 0.74rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.progress-sub-text {
  flex: 1 1 auto;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  text-align: center;
}

.progress-percent-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #f97316;
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #f97316;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Steps Table */
#result-modal .steps-table {
  width: 100%;
  border-collapse: collapse;
}

#result-modal .steps-table th {
  background: #f0f7ff;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  padding: 7px 8px;
  letter-spacing: 0.4px;
}

#result-modal .steps-table td {
  padding: 7px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

#result-modal .badge-done {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
  font-weight: 800;
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  display: inline-block;
}

#result-modal .badge-pending {
  background: #ffffff;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 8px;
  display: inline-block;
}

/* Regular completed rows */
#result-modal .steps-table tr.row-done td,
.steps-table tr.row-done td {
  background: #ffffff;
}

/* Highlight ONLY the last completed step (Current Status) */
#result-modal .steps-table tr.row-highlight td,
.steps-table tr.row-highlight td {
  background: #dcfce7 !important;
}
#result-modal .steps-table tr.row-highlight td:first-child,
.steps-table tr.row-highlight td:first-child {
  border-left: 4px solid #10b981 !important;
}
#result-modal .steps-table tr.row-highlight td:nth-child(2),
.steps-table tr.row-highlight td:nth-child(2) {
  color: #047857 !important;
  font-weight: 800 !important;
}
#result-modal .steps-table tr.row-highlight .badge-done,
.steps-table tr.row-highlight .badge-done {
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1.5px solid #059669 !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4) !important;
}

/* Website Pill: WWW.INVISA.LIVE */
.result-site-pill {
  background: #dbeafe;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}
.site-pill-icon {
  font-size: 1.15rem;
}
.site-pill-text {
  font-size: 1.02rem;
  font-weight: 800;
  color: #1e40af;
  letter-spacing: 0.5px;
  text-transform: lowercase;
}

/* Save Button */
#result-modal .result-footer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-save-status {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
  transition: all 0.2s ease;
}
.btn-save-status:hover {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}
.save-btn-icon {
  font-size: 1.15rem;
}



.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.modal-icon-badge {
  font-size: 1.1rem;
}

.modal-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
  font-weight: 500;
}

.btn-close-modal {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

/* Much Bigger, Immersive Viewfinder */
.viewfinder-box {
  position: relative;
  width: 100%;
  height: 380px;
  min-height: 320px;
  background: #090d16;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.7), 0 4px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .viewfinder-box {
    height: 48vh;
    min-height: 300px;
    max-height: 420px;
  }
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-target-frame {
  position: absolute;
  width: 88%;
  height: 84%;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 0 0 4000px rgba(9, 13, 22, 0.55);
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

/* High-Tech HUD Corners */
.corner-tl {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 24px;
  height: 24px;
  border-top: 3.5px solid #38bdf8;
  border-left: 3.5px solid #38bdf8;
  border-top-left-radius: 14px;
}

.corner-tr {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-top: 3.5px solid #38bdf8;
  border-right: 3.5px solid #38bdf8;
  border-top-right-radius: 14px;
}

.corner-bl {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 24px;
  height: 24px;
  border-bottom: 3.5px solid #38bdf8;
  border-left: 3.5px solid #38bdf8;
  border-bottom-left-radius: 14px;
}

.corner-br {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-bottom: 3.5px solid #38bdf8;
  border-right: 3.5px solid #38bdf8;
  border-bottom-right-radius: 14px;
}

.frame-guide-badge {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.74rem;
  color: #bae6fd;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.scan-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8 25%, #60a5fa 50%, #38bdf8 75%, transparent);
  box-shadow: 0 0 16px #38bdf8, 0 0 30px #0284c7;
  animation: scanLaser 2.4s infinite alternate ease-in-out;
}

@keyframes scanLaser {
  0% { top: 8px; }
  100% { top: calc(100% - 12px); }
}

.scanner-hint-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.78rem;
  color: #0369a1;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
  font-weight: 600;
}

.hint-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: #0ea5e9;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-capture {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: 12px;
  height: 48px;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
}

.btn-capture:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-capture:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-capture:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-camera-switch {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 11px;
  height: 42px;
  color: #334155;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-camera-switch:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px dashed #94a3b8;
  border-radius: 11px;
  height: 42px;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-upload-label:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* Auto-fill flash animation for input fields */
@keyframes fieldAutoFilled {
  0% {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35);
    background-color: #f0fdf4;
  }
  50% {
    border-color: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.25);
    background-color: #f0fdf4;
  }
  100% {
    border-color: #cbd5e1;
    box-shadow: none;
    background-color: #ffffff;
  }
}

.field-autofill-flash {
  animation: fieldAutoFilled 2.2s ease-out;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: white;
  padding: 10px 16px;
  border-radius: 25px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  pointer-events: none;
}

.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.75s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
  flex-shrink: 0;
}

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

/* 3-Column Desktop Layout for Left & Right Ads */
.page-layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 10px;
}

.ad-sidebar {
  display: none;
}

@media (min-width: 980px) {
  .ad-sidebar {
    display: block;
    width: 160px;
    flex-shrink: 0;
    margin-top: 16px;
  }
  .ad-sticky-box {
    position: sticky;
    top: 65px;
    width: 160px;
    min-height: 600px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
  }
  .ad-badge-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
  }
}

@media (min-width: 1220px) {
  .ad-sidebar {
    width: 180px;
  }
  .ad-sticky-box {
    width: 180px;
  }
}

/* Site Footer & Compliance */
.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: #64748b;
  font-size: 0.78rem;
  max-width: 600px;
  margin: 20px auto 0;
  line-height: 1.6;
}

.site-footer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

/* Middle Guide & FAQ Card in Bengali */
.info-guide-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.info-guide-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #f1f5f9;
}

.info-guide-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a8a;
}

.guide-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.guide-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: #eff6ff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 2px;
}

.step-content h4 {
  margin: 0 0 3px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.step-content p {
  margin: 0;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
}

.why-use-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
}

.why-use-section h4 {
  margin: 0 0 10px 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e40af;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-badge {
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.45;
}

/* Result Modal Card */
.result-modal-card {
  max-width: 540px;
  width: 100%;
  padding: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Top Marquee Notice Ticker (Exact Match with Image) */
.top-marquee-ticker {
  background: #fff1f2;
  border-top: 1px solid #fecdd3;
  border-bottom: 1px solid #fecdd3;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  z-index: 90;
}
.ticker-left-badge {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ticker-icon-circle {
  width: 22px;
  height: 22px;
  background: #e11d48;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.3);
}
.ticker-scroll-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.ticker-scroll-area marquee {
  font-size: 0.9rem;
  font-weight: 600;
  color: #be123c;
  line-height: 1.4;
  margin: 0;
}

/* Temporarily hide all ad placeholders and guide card */
.ad-rail,
.app-ad-container,
.ad-card,
.compact-guide-card {
  display: none !important;
}

/* Search History Card */
.history-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin-top: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.history-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-icon {
  font-size: 1.1rem;
}
.history-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e3a8a;
}
.history-badge {
  background: #dbeafe;
  color: #1e40af;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}
.btn-clear-history {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-clear-history:hover {
  background: #fee2e2;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}
.history-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.history-item-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}
.history-item-status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.status-pill-green {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.status-pill-blue {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.status-pill-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.status-pill-gray {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.history-item-details {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #475569;
  flex-wrap: wrap;
}
.history-item-app {
  font-weight: 700;
  color: #2563eb;
}
.history-item-pass {
  font-weight: 600;
  color: #64748b;
}
.history-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}
.history-item-time {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}
.history-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-history-recheck {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
  transition: all 0.15s;
}
.btn-history-recheck:hover {
  background: #1d4ed8;
}
.btn-history-del {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 4px 6px;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s;
}
.btn-history-del:hover {
  color: #dc2626;
  background: #fee2e2;
}




/* =====================================================
   DELIVERY PROGRESS ANIMATIONS
   ===================================================== */
@keyframes stepRowIn {
  from { opacity: 0; transform: translateX(-26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes badgePop {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.22); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes progressGrow {
  from { width: 0; }
  to   { width: var(--w, 100%); }
}
@keyframes progressShine {
  from { left: -45%; }
  to   { left: 110%; }
}
@keyframes currentGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(16, 185, 129, 0)); }
  50%      { filter: drop-shadow(0 0 7px rgba(16, 185, 129, 0.85)); }
}
@keyframes nextBlink {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
@keyframes progressBoxRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

#result-modal .progress-header-row {
  animation: progressBoxRise 0.5s ease both;
}

#result-modal #steps-tbody tr {
  animation: stepRowIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

#result-modal #steps-tbody .badge-done {
  animation:
    badgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    currentGlow 1.8s ease-in-out infinite paused;
  animation-delay: calc(var(--d, 0s) + 0.3s), 0s;
}

/* Only the current (last completed) step keeps a gentle glow */
#result-modal #steps-tbody tr.row-highlight .badge-done {
  animation:
    badgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    currentGlow 1.8s ease-in-out infinite;
  animation-delay: calc(var(--d, 0s) + 0.3s), calc(var(--d, 0s) + 1s);
}

/* Next pending step blinks softly */
#result-modal #steps-tbody tr.row-next .badge-pending {
  animation: nextBlink 1.4s ease-in-out infinite;
  animation-delay: calc(var(--d, 0s) + 0.6s);
}

.progress-bar-fill.progress-animate {
  position: relative;
  overflow: hidden;
  animation: progressGrow 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.progress-bar-fill.progress-animate::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 40%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.65), rgba(255,255,255,0));
  animation: progressShine 1.7s ease-in-out 1.2s infinite;
}

/* Saved image: always show the final state, never a frame in the middle of an animation */
.capturing *,
.capturing *::after {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #result-modal .progress-header-row,
  #result-modal #steps-tbody tr,
  #result-modal #steps-tbody .badge-done,
  #result-modal #steps-tbody .badge-pending,
  .progress-bar-fill.progress-animate,
  .progress-bar-fill.progress-animate::after {
    animation: none !important;
  }
}

/* =====================================================
   DELIVERY TRUCK ON THE PROGRESS BAR + CURRENT-STEP RING
   ===================================================== */
.progress-bar-wrap {
  position: relative;
  padding-top: 16px;
}

.progress-truck {
  position: absolute;
  top: -1px;
  left: clamp(9px, var(--w, 0%), calc(100% - 9px));
  font-size: 16px;
  line-height: 1;
  transform: translateX(-50%) scaleX(-1);
  transform-origin: 50% 100%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.25));
}

.progress-truck.go {
  animation:
    truckDrive 1.2s cubic-bezier(0.22, 1, 0.36, 1) both,
    truckRumble 0.32s ease-in-out infinite alternate;
}

@keyframes truckDrive {
  from { left: 9px; }
  to   { left: clamp(9px, var(--w, 0%), calc(100% - 9px)); }
}
@keyframes truckRumble {
  from { transform: translateX(-50%) scaleX(-1) translateY(0); }
  to   { transform: translateX(-50%) scaleX(-1) translateY(-1.6px) rotate(-2deg); }
}

/* Expanding ring around the current (last completed) step */
#result-modal #steps-tbody tr.row-highlight .badge-done {
  position: relative !important;
}
#result-modal #steps-tbody tr.row-highlight .badge-done::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 11px;
  border: 2px solid rgba(16, 185, 129, 0.65);
  opacity: 0;
  animation: ringPulse 1.9s ease-out infinite;
  animation-delay: calc(var(--d, 0s) + 0.9s);
  pointer-events: none;
}
@keyframes ringPulse {
  0%   { opacity: 0.85; transform: scale(1); }
  100% { opacity: 0;    transform: scale(1.55); }
}

@media (prefers-reduced-motion: reduce) {
  .progress-truck.go,
  #result-modal #steps-tbody tr.row-highlight .badge-done::after {
    animation: none !important;
  }
}

/* =====================================================
   RE-CHECK FROM HISTORY: keep the old card visible while the live check runs
   ===================================================== */
.result-card-container.is-refreshing {
  position: relative;
}
.result-card-container.is-refreshing::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 3px;
  border-radius: 3px;
  background-image: linear-gradient(90deg, rgba(37, 99, 235, 0), #2563eb, rgba(37, 99, 235, 0));
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: refreshSweep 1.1s linear infinite;
  z-index: 5;
}
.result-card-container.is-refreshing::after {
  content: attr(data-refresh-label);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 5;
}
@keyframes refreshSweep {
  from { background-position: -60% 0; }
  to   { background-position: 160% 0; }
}
.capturing.is-refreshing::before,
.capturing.is-refreshing::after {
  display: none !important;
}

/* =====================================================
   STEP CARDS: every step is its own bordered box with its own colour
   ===================================================== */
#result-modal table.steps-table {
  border-collapse: separate !important;
  border-spacing: 0 7px !important;
}

#result-modal #steps-tbody tr.step-card:nth-child(1) { --c:#3b82f6; --cd:#1d4ed8; --cl:#bfdbfe; --bg:#eff6ff; }
#result-modal #steps-tbody tr.step-card:nth-child(2) { --c:#8b5cf6; --cd:#6d28d9; --cl:#ddd6fe; --bg:#f5f3ff; }
#result-modal #steps-tbody tr.step-card:nth-child(3) { --c:#f59e0b; --cd:#b45309; --cl:#fde68a; --bg:#fffbeb; }
#result-modal #steps-tbody tr.step-card:nth-child(4) { --c:#10b981; --cd:#047857; --cl:#a7f3d0; --bg:#ecfdf5; }
#result-modal #steps-tbody tr.step-card:nth-child(n+5) { --c:#06b6d4; --cd:#0e7490; --cl:#a5f3fc; --bg:#ecfeff; }

/* pending step: dashed outline in the step's light colour */
#result-modal #steps-tbody tr.step-card td {
  background: #ffffff !important;
  border-top: 1.5px dashed var(--cl) !important;
  border-bottom: 1.5px dashed var(--cl) !important;
  border-left: none !important;
  border-right: none !important;
  color: #64748b !important;
}
#result-modal #steps-tbody tr.step-card td:first-child {
  border-left: 5px solid var(--cl) !important;
  border-radius: 11px 0 0 11px !important;
}
#result-modal #steps-tbody tr.step-card td:last-child {
  border-right: 1.5px dashed var(--cl) !important;
  border-radius: 0 11px 11px 0 !important;
}

/* finished step: solid coloured border + soft tint */
#result-modal #steps-tbody tr.step-card.row-done td {
  background: var(--bg) !important;
  border-top: 1.5px solid var(--c) !important;
  border-bottom: 1.5px solid var(--c) !important;
  color: #1e293b !important;
}
#result-modal #steps-tbody tr.step-card.row-done td:first-child {
  border-left: 5px solid var(--c) !important;
}
#result-modal #steps-tbody tr.step-card.row-done td:last-child {
  border-right: 1.5px solid var(--c) !important;
}

/* current step: thicker border, stronger tint, coloured text */
#result-modal #steps-tbody tr.step-card.row-highlight td {
  background: var(--bg) !important;
  border-top: 2.5px solid var(--c) !important;
  border-bottom: 2.5px solid var(--c) !important;
  color: var(--cd) !important;
  font-weight: 800 !important;
}
#result-modal #steps-tbody tr.step-card.row-highlight td:first-child {
  border-left: 7px solid var(--c) !important;
}
#result-modal #steps-tbody tr.step-card.row-highlight td:last-child {
  border-right: 2.5px solid var(--c) !important;
}

/* badges follow the step colour */
#result-modal #steps-tbody tr.step-card.row-done .badge-done {
  background: #ffffff !important;
  color: var(--cd) !important;
  border: 1.5px solid var(--c) !important;
  box-shadow: none !important;
}
#result-modal #steps-tbody tr.step-card.row-highlight .badge-done {
  background: var(--c) !important;
  color: #ffffff !important;
  border: 1.5px solid var(--c) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25) !important;
}
#result-modal #steps-tbody tr.step-card.row-highlight .badge-done::after {
  border-color: var(--c) !important;
}
#result-modal #steps-tbody tr.step-card .badge-pending {
  border-color: var(--cl) !important;
  color: var(--c) !important;
}

/* =====================================================
   FIREWORKS (visa processed / printed)
   ===================================================== */
.fireworks-canvas {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
}
#result-modal .modal-card.result-modal-card {
  z-index: 2 !important;
}

/* Visa portal status text: slightly smaller so the long "Processed and Printed..." message fits comfortably */
#result-modal .portal-status-card .portal-status-main {
  font-size: 1.02rem !important;
  line-height: 1.42 !important;
}

/* Delivery progress box: slim version (thin bar, compact one-line header) */
#result-modal .progress-header-row {
  padding: 6px 10px 7px !important;
  margin-bottom: 7px !important;
  border-radius: 9px !important;
}
#result-modal .progress-label-row {
  margin-bottom: 2px;
  gap: 6px;
}
#result-modal .progress-title-caps {
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
#result-modal .progress-title-caps br {
  display: none;
}
#result-modal .progress-sub-text {
  font-size: 0.72rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#result-modal .progress-percent-val {
  font-size: 1rem;
  line-height: 1.1;
}
#result-modal .progress-bar-wrap {
  padding-top: 12px;
}
#result-modal .progress-bar-track {
  height: 4px;
  border-radius: 3px;
}
#result-modal .progress-bar-fill {
  border-radius: 3px;
}
#result-modal .progress-truck {
  font-size: 13px;
  top: -2px;
}

/* very narrow phones: keep the title on two lines so the middle text is not cut */
@media (max-width: 430px) {
  #result-modal .progress-title-caps { white-space: normal; }
  #result-modal .progress-title-caps br { display: inline; }
  #result-modal .progress-sub-text { overflow: visible; text-overflow: clip; white-space: normal; }
}

/* Total visitors - centered pill */
.visitor-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 4px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  font-weight: 800;
  color: #475569;
}
.visitor-counter .visitor-icon { font-size: 1.05rem; line-height: 1; }
.visitor-counter .visitor-label { font-size: 0.82rem; }
.visitor-counter .visitor-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}
