/* Initial document only; Flutter owns the application after its first frame. */
html[data-facil-app="empresas"] {
  --facil-splash-background: #007D87;
  --facil-splash-foreground: #FFFAF5;
}

html[data-facil-app="clientes"] {
  --facil-splash-background: #FF850A;
  --facil-splash-foreground: #12343D;
}

html[data-facil-app],
html[data-facil-app] > body {
  margin: 0;
  background: var(--facil-splash-background);
}

.facil-splash,
.facil-startup-failure {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: var(--facil-splash-background);
  color: var(--facil-splash-foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.facil-splash,
.facil-startup-failure {
  z-index: 2147483645;
}

.facil-splash__content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.facil-splash__mark {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: contain;
}

.facil-splash__name {
  margin: -24px 0 0;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -1.2px;
}

.facil-splash__product {
  margin: 12px 0 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 3.5px;
  text-indent: 3.5px;
}

.facil-splash__progress {
  position: relative;
  width: 120px;
  height: 3px;
  margin-top: 40px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, currentColor 20%, transparent);
}

.facil-splash__progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: currentColor;
  animation: facil-splash-progress 1.6s ease-in-out infinite;
}

@keyframes facil-splash-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(360%); }
}

.facil-startup-failure[hidden] {
  display: none;
}

.facil-startup-failure__content {
  max-width: 360px;
  line-height: 1.6;
}

.facil-startup-failure__title {
  font-size: 22px;
  line-height: 1.35;
}

.facil-startup-failure button {
  margin-top: 16px;
  padding: 12px 20px;
  border: 1px solid currentColor;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.facil-startup-failure button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

/* Flutter debug inserts this direct child; our branded progress replaces it.
   Scope the rule so other indicators and Flutter's own cleanup stay intact. */
html[data-facil-app] > body > .flutter-loader {
  display: none !important;
}

@media (max-width: 600px) {
  .facil-splash__mark {
    width: 200px;
    height: 200px;
  }

  .facil-splash__name {
    margin-top: -20px;
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .facil-splash__progress::after {
    animation: none;
    left: 30%;
  }
}
