/* ================================================================
   app.css — Global application styles
   All values use Momento design tokens from tokens.css
   ================================================================ */

html,
body {
  font-family: var(--font-body);
}

a,
.btn-link {
  color: var(--color-brand-primary);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--color-surface-default),
              0 0 0 0.25rem var(--color-brand-primary);
}

h1:focus {
  outline: none;
}

/* ── Validation states ──────────────────────────────────────── */
.valid.modified:not([type="checkbox"]) {
  outline: 1px solid var(--color-success);
}

.invalid {
  outline: 1px solid var(--color-error);
}

.validation-message {
  color: var(--color-error);
}

/* ── Error boundary ─────────────────────────────────────────── */
.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=)
      no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: var(--color-surface-default);
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
  border-color: var(--color-text-disabled);
}

/* ── Primary action button ──────────────────────────────────── */
.mudbutton-ui {
  display: flex;
  height: 56px;
  min-width: 104px;
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  align-self: stretch;
  border-radius: var(--radius-full);
  background: var(--color-brand-accent);
  color: var(--color-surface-default);
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-action-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  letter-spacing: 0.2px;
  text-transform: none;
  border: none;
}
.mudbutton-ui:hover {
  background: var(--color-brand-accent);
  color: var(--color-surface-default);
}

/* ── Disabled / grey button ─────────────────────────────────── */
.mudbutton-grey {
  display: flex;
  height: 56px;
  min-height: 56px;
  padding: var(--space-2) var(--space-3);
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  align-self: stretch;
  border-radius: var(--radius-full);
  background: var(--color-text-disabled);
  color: var(--color-surface-default);
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-action-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-action-md-lh);
  letter-spacing: 0.2px;
  text-transform: none;
}
.mudbutton-grey:hover {
  background: var(--color-text-disabled);
  color: var(--color-surface-default);
}

/* ── Biometric / outlined button ────────────────────────────── */
.bio-button {
  position: relative;
  width: 100%;
  height: 56px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-brand-accent);
  background-color: var(--color-surface-default);
  color: var(--color-brand-accent);
  font-family: var(--font-body);
  font-size: var(--text-action-md-size);
  font-weight: var(--fw-bold);
  text-transform: none;
  overflow: hidden;
  margin-top: var(--space-1);
}
.bio-button:hover {
  background: var(--color-surface-default);
  color: var(--color-brand-accent);
}

.bio-button-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
}

.bio-button-text {
  flex: 1;
  text-align: center;
}

.bio-button .mud-icon {
  position: absolute;
  right: var(--space-2);
  color: var(--color-text-primary) !important;
}

/* ── Bottom drawer (shared base) ────────────────────────────── */
.custom-bottom-drawer {
  position: fixed !important;
  background-color: var(--color-drawer-bg);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  overflow: auto;
  overscroll-behavior: contain;
  transition: height 0.3s ease, transform 0.3s ease;
  z-index: 1300;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  right: 0;
  height: auto;
  max-height: 90vh;
  max-height: 90dvh;
  min-width: 320px;
  gap: var(--space-2);
  padding: var(--space-3);
}

/* Pin the action buttons to the bottom of the drawer and bleed past the
   drawer's left/right/bottom padding so the bar's background fills the
   full width edge-to-edge. The matching inner padding keeps the buttons
   positioned the same as if they were inside the drawer's padding box. */
.custom-bottom-drawer #drawer-actions {
  position: sticky;
  bottom: calc(0 * var(--space-3));
  background: var(--color-drawer-bg);
  margin: var(--space-2) calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
  padding: var(--space-2) var(--space-3) var(--space-3);
  box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

@media (max-width: 744px) {
  .custom-bottom-drawer {
    left: 0 !important;
  }
  .custom-bottom-drawer.drawer-open {
    padding: var(--space-3);
  }
}

@media (min-width: 745px) {
  .custom-bottom-drawer {
    left: calc(50% - 359px) !important;
  }
  .custom-bottom-drawer.drawer-open {
    position: fixed !important;
    right: auto !important;
    width: 718px !important;
    overflow: auto !important;
    padding: var(--space-3) var(--space-4);
  }
  /* Desktop drawer has wider horizontal padding (--space-4), so the
     action bar must bleed by that amount on left/right to match. */
  .custom-bottom-drawer.drawer-open #drawer-actions {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ── Content padding ─────────────────────────────────────────── */
.overall-padding {
  padding-left: var(--space-2) !important;
  padding-right: var(--space-2) !important;
}

@media (min-width: 403px) and (max-width: 744px) {
  .overall-padding {
    padding-left: var(--space-2) !important;
    padding-right: var(--space-2) !important;
  }
}

@media (min-width: 745px) {
  .overall-padding {
    max-width: 1280px !important;
    margin: 0 auto;
  }
}

/* ── Font size utility ──────────────────────────────────────── */
@media (min-width: 403px) and (max-width: 744px) {
  .font_size_cls {
    font-size: 13px;
  }
}

/* ── Scrollbar utilities ─────────────────────────────────────── */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ── Safe area (iOS) ─────────────────────────────────────────── */
.status-bar-safe-area {
  display: none;
}

@supports (-webkit-touch-callout: none) {
  .status-bar-safe-area {
    display: flex;
    position: sticky;
    top: 0;
    height: env(safe-area-inset-top);
    background-color: var(--color-surface-subtle);
    width: 100%;
    z-index: 1;
  }

  .flex-column,
  .navbar-brand {
    padding-left: env(safe-area-inset-left);
  }
}

/* ── Inline validation error (Topbar search) ─────────────────── */
.search-validation-error {
  color: var(--color-error);
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  margin-top: 4px;
}
