/* FabriSiteGPRS — PWA, safe areas e responsividade extra */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body.fs-landing {
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.fs-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.fs-brand img#logo,
.fs-brand .fs-brand-mark {
  max-width: min(100%, 300px);
}

body.fs-landing.fs-auth-page .fs-auth-wrap {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.fs-marketing img,
.fs-tile img {
  max-width: 100%;
  height: auto;
}

/* Evita zoom automático no foco de campos no iOS */
@media (max-width: 480px) {
  .fs-form .input100 {
    font-size: 16px;
  }
}

.fs-form .login100-form-btn,
.fs-faq summary,
.fs-skip:focus {
  min-height: 44px;
  touch-action: manipulation;
}

/* Grade marketing: altura flexível em telas baixas */
@media (max-width: 960px) {
  .fs-marketing {
    min-height: auto;
  }

  .fs-tile {
    min-height: 0;
  }

  .fs-tile--hero {
    min-height: 180px;
  }
}

/* Rodapé: créditos em linha quebrável */
.fs-footer__credit {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #94a3b8;
  text-align: center;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.fs-footer__credit a {
  color: #cbd5e1;
  font-weight: 600;
  text-decoration: none;
}

.fs-footer__credit a:hover,
.fs-footer__credit a:focus-visible {
  text-decoration: underline;
  color: #fff;
}

/* Modal “Instalar app” (PWA) — desktop (Chromium) e iOS (Safari) */
.fs-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0));
  box-sizing: border-box;
}

.fs-pwa-modal[hidden] {
  display: none !important;
}

.fs-pwa-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

.fs-pwa-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 24rem;
  max-height: min(82vh, 30rem);
  padding: 0.85rem 1rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(165deg, #0f172a 0%, #111827 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.fs-pwa-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.fs-pwa-modal__header .fs-pwa-modal__title {
  flex: 1;
  min-width: 0;
}

.fs-pwa-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -0.2rem -0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.fs-pwa-modal__close:hover,
.fs-pwa-modal__close:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  outline: none;
}

.fs-pwa-modal__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.fs-pwa-modal__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f8fafc;
}

.fs-pwa-modal__text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.fs-pwa-modal__text:last-child {
  margin-bottom: 0;
}

.fs-pwa-modal__ios .fs-pwa-modal__text {
  margin-bottom: 0.65rem;
}

.fs-pwa-modal__steps {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.fs-pwa-modal__steps li {
  margin-bottom: 0.4rem;
}

.fs-pwa-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
}

.fs-pwa-modal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  flex-shrink: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.fs-pwa-modal__btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 1.1rem;
  touch-action: manipulation;
  border: none;
}

.fs-pwa-modal__btn--primary {
  background: #C9A227;
  color: #fff;
}

.fs-pwa-modal__btn--primary:hover {
  background: #8B6914;
}

.fs-pwa-modal__btn--ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.fs-pwa-modal__btn--ghost:hover {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.65);
}

body.fs-landing.fs-pwa-modal-open {
  overflow: hidden;
}

/* Celular: cartão compacto — não ocupa a tela inteira; conteúdo rola dentro do cartão */
@media (max-width: 540px) {
  .fs-pwa-modal {
    padding: 0.65rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0));
    align-items: center;
  }

  .fs-pwa-modal__panel {
    max-width: min(100%, 20.5rem);
    max-height: min(58vh, 21.5rem);
    padding: 0.65rem 0.75rem 0.55rem;
    border-radius: 12px;
  }

  .fs-pwa-modal__title {
    font-size: 0.98rem;
  }

  .fs-pwa-modal__text {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
  }

  .fs-pwa-modal__steps {
    font-size: 0.75rem;
    margin-bottom: 0.65rem;
  }

  .fs-pwa-modal__hint {
    font-size: 0.6875rem;
    margin-bottom: 0.35rem;
  }

  .fs-pwa-modal__actions {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
  }

  .fs-pwa-modal__btn {
    font-size: 0.8125rem;
    min-height: 42px;
    padding: 0 0.85rem;
  }
}
