/* Modern Mini App shell for account and service pages.
   Catalogue and checkout templates intentionally do not opt into this layer. */

:root {
  --ui-accent: #28e4e1;
  --ui-accent-strong: #00fbfb;
  --ui-accent-ink: #002f30;
  --ui-surface: #111314;
  --ui-surface-raised: #1a1d1e;
  --ui-surface-high: #222627;
  --ui-border: rgba(151, 190, 188, 0.16);
  --ui-border-strong: rgba(40, 228, 225, 0.28);
  --ui-text: #f2f6f5;
  --ui-muted: #a8b8b7;
  --ui-page-gutter: clamp(1rem, 4vw, 1.25rem);
  --ui-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.ui-refresh {
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: var(--ui-text);
  background:
    radial-gradient(100% 60% at 100% -8%, rgba(40, 228, 225, 0.08), transparent 58%),
    radial-gradient(80% 48% at -10% 42%, rgba(91, 101, 255, 0.035), transparent 65%),
    var(--ui-surface);
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ui-refresh *,
body.ui-refresh *::before,
body.ui-refresh *::after {
  box-sizing: border-box;
}

.ui-refresh > header {
  width: 100%;
  max-width: 100vw;
  background: rgba(17, 19, 20, 0.88) !important;
  border-bottom: 1px solid rgba(151, 190, 188, 0.12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.ui-refresh > header h1 {
  color: var(--ui-accent) !important;
  font-size: 1.0625rem !important;
  font-style: normal !important;
  letter-spacing: 0.015em !important;
}

.ui-refresh > header button,
.ui-refresh > header a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #bfd0cf;
}

.ui-refresh > header button:hover,
.ui-refresh > header a:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--ui-text);
}

.ui-refresh > main {
  width: 100%;
  max-width: 35rem;
  margin-inline: auto;
  padding-left: var(--ui-page-gutter) !important;
  padding-right: var(--ui-page-gutter) !important;
}

.ui-refresh > nav.fixed.bottom-0 {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  isolation: isolate;
  background: rgba(17, 19, 20, 0.91) !important;
  border-top: 1px solid rgba(151, 190, 188, 0.16) !important;
  border-radius: 1.25rem 1.25rem 0 0 !important;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.38) !important;
}

.ui-refresh main > section {
  scroll-margin-top: calc(5rem + var(--app-safe-top));
}

.ui-refresh .glass-card,
.ui-refresh .order-row,
.ui-refresh .row-link,
.ui-refresh .quick-action,
.ui-refresh .case-card,
.ui-refresh .notif-row,
.ui-refresh .offer-card {
  background-color: rgba(27, 30, 31, 0.9);
  border-color: var(--ui-border) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.ui-refresh .row-link,
.ui-refresh .quick-action,
.ui-refresh .case-card,
.ui-refresh .notif-row,
.ui-refresh .offer-card {
  transition:
    transform 180ms var(--ui-ease),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.ui-refresh .row-link:hover,
.ui-refresh .quick-action:hover,
.ui-refresh .case-card:hover,
.ui-refresh .notif-row:hover,
.ui-refresh .offer-card:hover {
  border-color: var(--ui-border-strong) !important;
  background-color: rgba(31, 36, 37, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.ui-refresh .row-link:active,
.ui-refresh .quick-action:active,
.ui-refresh .case-card:active,
.ui-refresh .notif-row:active,
.ui-refresh .offer-card:active {
  transform: scale(0.985);
}

/* Several templates define Tailwind `primary` as white. Make the primary
   action color consistent with the branded cyan used everywhere else. */
.ui-refresh .bg-primary {
  background-color: var(--ui-accent) !important;
}

.ui-refresh .text-on-primary {
  color: var(--ui-accent-ink) !important;
}

.ui-refresh button,
.ui-refresh a,
.ui-refresh [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ui-refresh button:not(.filter-tab):not(.tx-filter):not(.status-filter),
.ui-refresh a.row-link,
.ui-refresh a.quick-action {
  min-height: 44px;
}

.ui-refresh button:disabled,
.ui-refresh [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.65);
}

.ui-refresh :is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}

.ui-refresh input,
.ui-refresh textarea,
.ui-refresh select {
  min-width: 0;
  font-size: 16px !important;
  color: var(--ui-text) !important;
}

.ui-refresh input::placeholder,
.ui-refresh textarea::placeholder {
  color: rgba(168, 184, 183, 0.58) !important;
}

.ui-refresh .filter-tab,
.ui-refresh .tx-filter,
.ui-refresh .status-filter {
  min-height: 38px;
}

.ui-refresh .filter-tab.active,
.ui-refresh .tx-filter-active {
  background: rgba(40, 228, 225, 0.14) !important;
  color: var(--ui-accent) !important;
  box-shadow: inset 0 0 0 1px rgba(40, 228, 225, 0.16);
}

.ui-refresh #empty-state,
.ui-refresh [data-empty-state] {
  max-width: 26rem;
  margin-inline: auto;
}

.ui-refresh #empty-state a,
.ui-refresh [data-empty-state] a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ui-muted);
  background: rgba(27, 30, 31, 0.72);
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
}

.ui-state__icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  color: var(--ui-accent);
  background: rgba(40, 228, 225, 0.09);
  border: 1px solid rgba(40, 228, 225, 0.15);
}

.ui-retry {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  color: var(--ui-accent-ink);
  background: var(--ui-accent);
  font-size: 0.75rem;
  font-weight: 800;
}

@media (max-width: 370px) {
  :root { --ui-page-gutter: 0.875rem; }

  .ui-refresh main > section.grid.grid-cols-3 {
    gap: 0.5rem !important;
  }

  .ui-refresh main > section.grid.grid-cols-3 > * {
    padding: 0.75rem !important;
  }

  .ui-refresh main h2.text-3xl {
    font-size: 1.65rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-refresh *,
  .ui-refresh *::before,
  .ui-refresh *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
