/* Global styles shared across pages (no Vite required) */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f6f7fb;
  padding-bottom: 100px;
}

/* Auth pages */
.dg-auth {
  background: radial-gradient(900px 420px at 20% 0%, rgba(13, 110, 253, 0.18), rgba(13, 110, 253, 0) 60%),
    radial-gradient(700px 380px at 85% 20%, rgba(32, 201, 151, 0.18), rgba(32, 201, 151, 0) 62%),
    #f6f7fb;
  /* Auth pages don't use the fixed bottom nav, so remove the global padding
     that otherwise creates an "always visible" vertical scrollbar. */
  padding-bottom: 0 !important;
  overflow-x: hidden;
}

.dg-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 14px;
}

.dg-auth-panel {
  width: 100%;
  max-width: 420px;
}

.dg-auth-logo__mark {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(13, 110, 253, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.dg-auth-logo__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dg-auth-logo__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 24px;
  color: rgba(0, 0, 0, 0.82);
}

.dg-auth-logo__subtitle {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}

/* Reusable selectable buttons (used for language/category choices) */
.dg-choice-btn {
  border-radius: 14px;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid rgba(0, 0, 0, 0.35) !important;
  padding: 10px 8px;
  font-weight: 600;
}

.dg-choice-btn.is-selected,
.dg-choice-btn:active {
  background: #0b2a5b !important;
  border-color: #0b2a5b !important;
  color: #fff !important;
}

/* Give pages room for fixed bottom nav */
.dg-page-pad {
  /* Extra space so content never hides behind the fixed bottom capsule nav */
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

/* Bottom capsule nav */
.dg-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  z-index: 99997;
  pointer-events: none;
  /* capsule handles clicks */
}

/* Keep Bootstrap modals above the fixed bottom nav and app overlays. */
.modal-backdrop {
  z-index: 100000 !important;
}

.modal {
  z-index: 100001 !important;
}

.dg-bottomnav__capsule {
  pointer-events: auto;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 2px;
  padding: 8px;
}

.dg-bottomnav__item {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.62);
  background: transparent;
  border: 0;
  font: inherit;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 18px;
  transition: background 140ms ease-out, color 140ms ease-out, transform 140ms ease-out;
}

.dg-bottomnav__item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.78);
}

.dg-bottomnav__item.is-active {
  background: rgba(13, 110, 253, 0.12);
  color: rgba(13, 110, 253, 1);
}

.dg-bottomnav__icon {
  line-height: 1;
}

.dg-bottomnav__label {
  font-size: 11px;
  line-height: 1;
}

/* App-like toaster (SweetAlert-ish, but no dependency) */
.dg-toast {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 99999;
  min-width: 260px;
  max-width: calc(100vw - 24px);
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  color: #111;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: none;
}

.dg-toast.dg-toast--show {
  display: block;
  animation: dgToastIn 160ms ease-out;
}

.dg-toast__title {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 4px 0;
}

.dg-toast__body {
  font-size: 13px;
  margin: 0;
  opacity: 0.9;
}

.dg-toast--success {
  border-left: 6px solid #16a34a;
}

.dg-toast--error {
  border-left: 6px solid #dc2626;
}

.dg-toast--info {
  border-left: 6px solid #2563eb;
}

@keyframes dgToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* App-like loading overlay */
.dg-loading {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.25);
  backdrop-filter: blur(2px);
}

.dg-loading.dg-loading--show {
  display: flex;
}

.dg-loading__card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 220px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.dg-loading__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dg-loading__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.65);
  animation: dgSpin 700ms linear infinite;
}

.dg-loading__text {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.75);
}

@keyframes dgSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
