/* =========================================================
   css/shell.css - App Shell Styling & Splash Container
   ========================================================= */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  -webkit-tap-highlight-color: transparent;
}

.ios-scroll-container {
  -webkit-overflow-scrolling: touch;
}

/* Dynamic active press response & crisp rasterization */
.action-btn {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.action-btn:active {
  transform: scale(0.98);
}

.home-card-vivid {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.35), 0 6px 14px -3px rgba(15, 23, 42, 0.16), 0 2px 4px -1px rgba(15, 23, 42, 0.08);
}

.home-card-vivid .home-crisp-text {
  text-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.22);
}

.home-card-light {
  box-shadow: inset 0 1px 0 0 #ffffff, 0 4px 12px -2px rgba(30, 41, 59, 0.07), 0 1px 3px 0 rgba(30, 41, 59, 0.04);
}

.home-crisp-svg {
  shape-rendering: geometricPrecision;
  vector-effect: non-scaling-stroke;
}

/* =========================================================
   Home Proportional Responsive System (--u = 1px @ 390x705)
   ========================================================= */
#view-home {
  --u: min(calc(100vw / 390), calc(100dvh / 705));
  container-type: size;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

@supports (width: 1cqw) {
  #view-home { --u: min(calc(100cqw / 390), calc(100cqh / 705)); }
}

.home-stage {
  width: calc(390 * var(--u));
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: max(calc(env(safe-area-inset-top, 0px) + calc(32 * var(--u))), calc(38 * var(--u))) calc(18 * var(--u)) calc(10 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  user-select: none;
}

.home-stage [data-purpose="brand-identity"] { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; text-align: center; width: 100%; }
.home-stage h1 { margin: 0; font-size: inherit; }
.home-stage [data-purpose="app-footer"] { margin-top: auto; }
.home-logo-box { width: calc(50 * var(--u)); height: calc(50 * var(--u)); border-radius: calc(13 * var(--u)); margin-bottom: calc(8 * var(--u)); display: flex; align-items: center; justify-content: center; }
.home-logo-svg { width: calc(25 * var(--u)); height: calc(25 * var(--u)); }
.home-title-main { display: block; font-size: calc(19.5 * var(--u)); line-height: 1.15; letter-spacing: -0.025em; }
.home-title-sub { display: block; font-size: calc(14.5 * var(--u)); line-height: 1.2; margin-top: calc(2.5 * var(--u)); color: #36558f; }
.home-illustration-box { width: calc(354 * var(--u)); height: calc(124 * var(--u)); margin-top: calc(10 * var(--u)); margin-bottom: calc(8 * var(--u)); }
.home-illustration-box img { width: 100%; height: 100%; object-fit: contain; display: block; }

.home-bento-grid {
  width: calc(354 * var(--u));
  margin-top: calc(8 * var(--u));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, calc(114 * var(--u)));
  gap: calc(11 * var(--u));
}

.home-bento-card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; border-radius: calc(13 * var(--u)); padding: calc(14.5 * var(--u)) calc(15 * var(--u)); }
.home-bento-icon-box { width: calc(31 * var(--u)); height: calc(31 * var(--u)); border-radius: calc(8 * var(--u)); display: flex; align-items: center; justify-content: center; }
.home-bento-icon-svg { width: calc(17 * var(--u)); height: calc(17 * var(--u)); }
.home-bento-watermark { position: absolute; width: calc(86 * var(--u)); height: calc(86 * var(--u)); right: calc(-12 * var(--u)); bottom: calc(-14 * var(--u)); }

.home-bento-glow {
  position: absolute;
  width: calc(74 * var(--u));
  height: calc(74 * var(--u));
  top: calc(-24 * var(--u));
  right: calc(-24 * var(--u));
}

.home-bento-title {
  font-size: calc(13.2 * var(--u));
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.home-bento-sub {
  font-size: calc(10.6 * var(--u));
  line-height: 1.2;
  margin-top: calc(2.5 * var(--u));
}

.home-version-text {
  font-size: calc(12 * var(--u));
}

/* =========================================================
   App Root & Splash Screen
   ========================================================= */
.app-root-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.app-card-container,
.app-content-wrapper,
#app-view-outlet {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  flex: 1 1 0%;
  position: relative;
  overflow: hidden;
}

/* =========================================================
   Barra de Progresso Ultra-Fina para Sincronização em Segundo Plano
   ========================================================= */
.bg-sync-bar {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9994;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.28);
}

.bg-sync-bar[hidden] {
  display: none !important;
}

.bg-sync-bar--top {
  top: 0;
}

.bg-sync-bar__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0) 0%, rgba(147, 197, 253, 0.85) 50%, rgba(96, 165, 250, 0) 100%);
  animation: bgSyncBarSlide 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: transform;
}

.bg-sync-bar__label {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

@keyframes bgSyncBarSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}
