/* Action rail, mobile tab bar, route loader, cards, request pages. */

/* ---------------------------------------------------------------------------
   Route loader
   ------------------------------------------------------------------------ */

.route-loader {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  gap: 1.5rem;
  align-content: center;
  background: rgba(247, 249, 252, .92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.route-loader.is-active { opacity: 1; visibility: visible; }

.route-loader-mark {
  width: 74px;
  height: 74px;
  animation: markPulse 1.5s ease-in-out infinite;
}
.route-loader-mark .brand-logo { width: 100%; height: 100%; }
.route-loader-mark path,
.route-loader-mark circle {
  opacity: 0;
  animation: markDraw 1.5s ease-in-out infinite;
}
.route-loader-mark path:nth-of-type(1) { animation-delay: 0s; }
.route-loader-mark path:nth-of-type(2) { animation-delay: .08s; }
.route-loader-mark path:nth-of-type(3) { animation-delay: .16s; }
.route-loader-mark path:nth-of-type(4) { animation-delay: .24s; }
.route-loader-mark path:nth-of-type(5) { animation-delay: .32s; }
.route-loader-mark path:nth-of-type(6) { animation-delay: .4s; }
.route-loader-mark circle:nth-of-type(1) { animation-delay: .48s; }
.route-loader-mark circle:nth-of-type(2) { animation-delay: .56s; }

@keyframes markDraw {
  0%   { opacity: 0; transform: translateY(6px) scale(.96); }
  35%  { opacity: 1; transform: none; }
  80%  { opacity: 1; }
  100% { opacity: .15; }
}
@keyframes markPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.route-loader-bar {
  display: block;
  width: 168px;
  height: 3px;
  border-radius: 999px;
  background: #dde5f2;
  overflow: hidden;
}
.route-loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #3b82f6);
  animation: barSlide 1.1s ease-in-out infinite;
}
@keyframes barSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ---------------------------------------------------------------------------
   Action rail
   ------------------------------------------------------------------------ */

.action-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: .9rem;
  margin-bottom: 1.25rem;
}
.action {
  display: grid;
  justify-items: center;
  gap: .45rem;
  padding: .7rem .35rem;
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color .18s ease, transform .2s var(--ease-out, ease);
}
.action:hover { background: #f5f8fd; transform: translateY(-2px); }
.action.is-locked { opacity: .5; cursor: not-allowed; }
.action.is-locked:hover { transform: none; background: none; }
.action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  transition: transform .2s var(--ease-spring, ease);
}
.action:hover .action-icon { transform: scale(1.07); }
.action-icon svg { width: 20px; height: 20px; }
.action-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.tile-blue   .action-icon { background: var(--brand-soft); color: var(--brand); }
.tile-teal   .action-icon { background: #ccfbf1; color: #0f766e; }
.tile-green  .action-icon { background: #dcfce7; color: #047857; }
.tile-amber  .action-icon { background: #fef3c7; color: #b45309; }
.tile-violet .action-icon { background: #ede9fe; color: #6d28d9; }
.tile-rose   .action-icon { background: #ffe4e6; color: #be123c; }

/* ---------------------------------------------------------------------------
   Mobile tab bar
   ------------------------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 38;
  display: none;
  align-items: center;
  justify-content: space-around;
  gap: .25rem;
  padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar-item {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: .2rem;
  padding: .4rem .2rem;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  transition: color .18s ease;
}
.tabbar-item svg { width: 21px; height: 21px; }
.tabbar-item.is-active { color: var(--brand); }
.tabbar-item:nth-child(2) { margin-right: 1.9rem; }
.tabbar-item:nth-child(3) { margin-left: 1.9rem; }

.tabbar-fab {
  position: absolute;
  left: 50%;
  bottom: calc(.9rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2b72ee, var(--brand));
  color: #fff;
  box-shadow: 0 8px 22px rgba(29, 78, 216, .42);
  transition: transform .2s var(--ease-spring, ease);
}
.tabbar-fab:hover { transform: translateX(-50%) scale(1.06); }
.tabbar-fab svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------------
   Filters
   ------------------------------------------------------------------------ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: flex-end;
}
.filter-bar .field { margin-bottom: 0; min-width: 11rem; }
.filter-bar .field-grow { flex: 1; min-width: 14rem; }
.filter-actions { display: flex; gap: .5rem; }

.stat-strip-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------------------------------------------------------------------------
   Bank cards
   ------------------------------------------------------------------------ */

.card-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.bank-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 1.25rem;
  color: #fff;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(140deg, #2b72ee, #1636a4);
  box-shadow: 0 12px 28px rgba(16, 42, 119, .3);
}
.bank-card::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -3rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.bank-card > * { position: relative; z-index: 1; }
.level-gold     { background: linear-gradient(140deg, #d9a021, #8a5f08); }
.level-platinum { background: linear-gradient(140deg, #6b7a90, #2d3849); }
.level-black    { background: linear-gradient(140deg, #2b3240, #0b0f16); }

.bank-card-top { display: flex; align-items: center; justify-content: space-between; }
.bank-card-chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f7d878, #d6a521);
}
.bank-card-brand { font-weight: 700; letter-spacing: .04em; font-size: .92rem; }
.bank-card-number {
  font-size: 1.16rem;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  margin: .5rem 0;
}
.bank-card-foot { display: flex; align-items: flex-end; gap: 1rem; }
.bank-card-label {
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .72;
}
.bank-card-value { font-size: .85rem; font-weight: 600; }
.bank-card-status {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}
.status-active { background: rgba(16, 185, 129, .3); }

.banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  margin: -1.35rem -1.35rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, var(--brand), #1636a4);
  color: #fff;
}
.banner-head h2 { font-size: 1.15rem; }
.banner-head p { font-size: .9rem; color: #cfe0fb; margin-top: .25rem; }
.banner-icon { flex: none; opacity: .5; }
.banner-icon svg { width: 46px; height: 46px; }

.type-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.type-grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.level-option { text-align: center; justify-content: center; }

.notice {
  display: flex;
  gap: .8rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid #d5e2fb;
  margin: 1.25rem 0;
}
.notice svg { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: .1rem; }
.notice strong { display: block; font-size: .93rem; }
.notice p { font-size: .87rem; color: var(--ink-muted); margin-top: .2rem; }

/* ---------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .tabbar { display: flex; }
  .shell-main { padding-bottom: 5.5rem; }
  .app-footer { margin-bottom: 1rem; }
}

@media (max-width: 760px) {
  .action-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .banner-head { margin: -1.1rem -1.1rem 1.25rem; padding: 1.1rem; }
  .banner-icon { display: none; }
  .filter-bar .field, .filter-bar .field-grow { min-width: 0; width: 100%; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1; }
  .card-wall { grid-template-columns: 1fr; }
  .route-loader-mark { width: 62px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  .route-loader-mark,
  .route-loader-mark path,
  .route-loader-mark circle,
  .route-loader-bar span { animation: none; opacity: 1; }
  .action:hover, .action:hover .action-icon, .tabbar-fab:hover { transform: none; }
  .tabbar-fab:hover { transform: translateX(-50%); }
}
