/*
 * PWA install chip (App-Modus Inc.1). A compact, dismissible card that slides up from
 * the bottom on installable devices (and as an iOS "Add to Home Screen" hint). Themed
 * with the shared tokens; respects light/dark and reduced motion.
 */

.gtx-pwa {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: .85rem;
  width: min(30rem, calc(100vw - 2rem));
  padding: .8rem .9rem;
  border: 1px solid var(--gtx-border, #262B36);
  border-radius: 16px;
  background: var(--gtx-surface, #171A22);
  color: var(--gtx-text, #E6E8EE);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
}

.gtx-pwa.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.gtx-pwa__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.gtx-pwa__text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.gtx-pwa__text strong {
  font-size: .95rem;
  font-weight: 700;
}

.gtx-pwa__text span {
  font-size: .82rem;
  line-height: 1.35;
  color: var(--gtx-text-dim, #9AA3B2);
}

.gtx-pwa__actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.gtx-pwa__install,
.gtx-pwa__dismiss {
  border: 0;
  border-radius: 9px;
  padding: .45rem .8rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.gtx-pwa__install {
  background: var(--gtx-accent-fill, #6D4EF0);
  color: #fff;
}

.gtx-pwa__install:hover {
  background: var(--gtx-accent, #7C5CFF);
}

.gtx-pwa__dismiss {
  background: transparent;
  color: var(--gtx-text-dim, #9AA3B2);
}

.gtx-pwa__dismiss:hover {
  color: var(--gtx-text, #E6E8EE);
}

@media (max-width: 30rem) {
  .gtx-pwa__actions {
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gtx-pwa {
    transition: opacity .2s ease;
    transform: translate(-50%, 0);
  }
}

/* Toggle switch (used for the push opt-in on the profile page). */
.gtx-switch {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  user-select: none;
}

.gtx-switch__input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 2.6rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--gtx-border, #2A2F3A);
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
}

.gtx-switch__input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 4px);
  height: calc(1.5rem - 4px);
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.gtx-switch__input:checked {
  background: var(--gtx-accent-fill, #6D4EF0);
}

.gtx-switch__input:checked::after {
  transform: translateX(1.1rem);
}

.gtx-switch__input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.gtx-switch__input:focus-visible {
  outline: 2px solid var(--gtx-accent, #7C5CFF);
  outline-offset: 2px;
}

.gtx-switch__label {
  font-size: .95rem;
}
