html {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  font-variant-numeric: tabular-nums lining-nums;
}

canvas {
  touch-action: pan-y !important;
}

/* Consistent Typography Scale Fallbacks Across Mobile & Offline Cordova */
.font-headline-lg-mobile {
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.font-numeric-display-mobile {
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.font-headline-sm {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.font-headline-md {
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}

@media (min-width: 1024px) {
  .lg\:font-headline-lg {
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .lg\:font-headline-xl {
    font-size: 34px;
    line-height: 42px;
    font-weight: 700;
    letter-spacing: -0.025em;
  }
  .lg\:font-numeric-display {
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
}

main > :first-child {
  margin-top: 0 !important;
}

main > :last-child {
  margin-bottom: 0 !important;
}

.pb-safe {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.pt-safe {
  padding-top: max(0.25rem, env(safe-area-inset-top, 0px));
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabular-nums {
  font-variant-numeric: tabular-nums lining-nums;
}

.icon-filled {
  font-variation-settings: 'FILL' 1;
}

/* Modal Animations */
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-modal-in {
  animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Inline Field Validation Error Styles */
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.input-invalid {
  box-shadow: 0 0 0 2px #dc2626 !important;
  background-color: #fef2f2 !important;
  animation: fieldShake 0.28s ease-in-out;
}

.field-error-text {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.35rem;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: #dc2626;
  animation: fadeDown 0.16s ease-out forwards;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top-Right Toast Stack & Color Variants */
#duitku-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: min(23rem, calc(100vw - 2rem));
  pointer-events: none;
}

.duitku-toast-item {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  box-shadow: 0 12px 28px -6px rgba(11, 31, 25, 0.16), 0 4px 10px -4px rgba(11, 31, 25, 0.08);
  border-width: 1px;
  border-style: solid;
  border-left-width: 4px;
  backdrop-filter: blur(12px);
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  animation: toastSlideInRight 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.duitku-toast-item.toast-leaving {
  opacity: 0;
  transform: translateX(24px) scale(0.97);
}

@keyframes toastSlideInRight {
  from {
    opacity: 0;
    transform: translateX(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Green - Success */
.duitku-toast-success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  border-left-color: #10b981;
  color: #065f46;
}
.duitku-toast-success .toast-icon { color: #059669; }
.duitku-toast-success .toast-progress { background-color: #10b981; }

/* Red - Error */
.duitku-toast-error {
  background-color: #fef2f2;
  border-color: #fecaca;
  border-left-color: #ef4444;
  color: #991b1b;
}
.duitku-toast-error .toast-icon { color: #dc2626; }
.duitku-toast-error .toast-progress { background-color: #ef4444; }

/* Yellow / Amber - Warning */
.duitku-toast-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  border-left-color: #f59e0b;
  color: #92400e;
}
.duitku-toast-warning .toast-icon { color: #d97706; }
.duitku-toast-warning .toast-progress { background-color: #f59e0b; }

/* Blue - Info */
.duitku-toast-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
  color: #1e40af;
}
.duitku-toast-info .toast-icon { color: #2563eb; }
.duitku-toast-info .toast-progress { background-color: #3b82f6; }

.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: toastCountdown linear forwards;
}

@keyframes toastCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Spinner utility for interactive submit buttons */
@keyframes spinAnim {
  to { transform: rotate(360deg); }
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  display: inline-block;
  animation: spinAnim 0.65s linear infinite;
}

/* 6-Digit OTP Input Boxes */
.otp-digit-box {
  width: 100%;
  height: 3.35rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  border-radius: 0.75rem;
  background-color: #e1f9ef;
  color: #00271d;
  border: 2px solid transparent;
  outline: none;
  transition: all 0.16s ease;
}

.otp-digit-box:focus {
  background-color: #ffffff;
  border-color: #30694b;
  box-shadow: 0 0 0 3px rgba(179, 240, 202, 0.55);
}

.otp-digit-box.otp-filled {
  background-color: #ffffff;
  border-color: #98d4af;
}

