/* Onboarding lokalizacyjny, promocja aplikacji i natywny ekran startowy. */

body.location-open,
body.app-install-open {
  overflow: hidden;
}

.location-layer,
.app-install-layer {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 24px;
}

.location-layer[hidden],
.app-install-layer[hidden] {
  display: none !important;
}

.location-backdrop,
.app-install-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(7, 19, 36, 0.64);
  backdrop-filter: blur(5px);
}

.location-panel,
.app-install-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: min(88dvh, 780px);
  overflow: auto;
  padding: 34px;
  border: 1px solid rgba(219, 225, 232, 0.9);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 19, 36, 0.22);
}

.location-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy);
  background: var(--accent);
}

.location-mark svg,
.location-close svg {
  width: 19px;
  height: 19px;
}

.location-close,
.app-install-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--slate);
  background: #fff;
  cursor: pointer;
}

.location-kicker,
.app-install-kicker {
  margin: 0 0 8px;
  color: var(--slate-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.location-panel h2,
.app-install-panel h2 {
  max-width: 490px;
  margin: 0;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: clamp(25px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.location-copy,
.app-install-copy {
  margin: 16px 0 0;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.65;
}

.location-primary,
.location-submit {
  min-height: 44px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.location-primary {
  width: 100%;
  margin-top: 24px;
  padding: 0 18px;
}

.location-expansion {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.location-expansion h3 {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.location-expansion > p {
  margin: 7px 0 18px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.55;
}

.location-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

.location-form-row label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.location-form-row input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font: 500 13px var(--font-b);
}

.location-form-row input:focus-visible,
.location-consent input:focus-visible,
.location-primary:focus-visible,
.location-submit:focus-visible,
.location-close:focus-visible,
.app-install-close:focus-visible,
.app-store-action:focus-visible {
  outline: 3px solid rgba(136, 173, 216, 0.48);
  outline-offset: 2px;
}

.location-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  margin: 14px 0;
  color: var(--slate);
  font-size: 11px;
  line-height: 1.5;
}

.location-consent input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--navy);
}

.location-submit {
  padding: 0 20px;
}

.location-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.location-form-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.app-store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-store-action {
  display: inline-grid;
  min-height: 45px;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  text-align: left;
  cursor: pointer;
}

.app-store-action svg {
  width: 22px;
  height: 22px;
}

.app-store-action span {
  display: grid;
  gap: 1px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.app-store-action small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-store-action.is-coming-soon {
  border-color: var(--line);
  color: var(--slate);
  background: #fff;
  cursor: default;
}

.app-store-action.is-coming-soon small {
  color: var(--slate-2);
}

.app-install-panel {
  width: min(100%, 520px);
}

.app-install-wordmark {
  display: block;
  width: 126px;
  height: 38px;
  margin-bottom: 28px;
  background: url('/brand/sponty-wordmark-navy.png') left center / contain no-repeat;
}

.app-install-panel .app-store-actions {
  margin-top: 25px;
}

.app-install-panel .app-store-action {
  flex: 1 1 190px;
}

.app-install-later {
  display: block;
  margin: 20px auto 0;
  border: 0;
  color: var(--slate);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.capacitor-native.product-mobile .app-install-layer {
  display: none !important;
}

.capacitor-native.native-auth-required .board,
.capacitor-native.native-auth-required [data-product-footer] {
  visibility: hidden;
  pointer-events: none;
}

.capacitor-native.native-auth-required .auth-layer [data-auth-close] {
  display: none !important;
}

@media (max-width: 720px) {
  .location-layer,
  .app-install-layer {
    align-items: end;
    padding: 0;
  }

  .location-panel,
  .app-install-panel {
    width: 100%;
    max-height: 92dvh;
    padding: 26px 20px max(24px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .location-panel h2,
  .app-install-panel h2 {
    max-width: calc(100% - 28px);
    font-size: 27px;
  }

  .location-form-row {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: no-preference) {
  .location-panel,
  .app-install-panel {
    animation: experience-enter 180ms ease-out both;
  }
}

@keyframes experience-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
