/* ---------------------------------------------------------------------------
 * member-shell-03: iOS "Add to Home Screen" walkthrough animation.
 * Scoped to the .twa-guide dialog; every colour comes from the tenant's brand
 * variables so a member sees their own gym. One 12s loop, five 20% segments.
 * ------------------------------------------------------------------------- */

.twa-guide .twa-stage {
  display: flex;
  justify-content: center;
}

.twa-guide .twa-phone {
  position: relative;
  width: 168px;
  height: 300px;
  border-radius: 24px;
  border: 3px solid var(--brand-border, #e2e8f0);
  background: var(--brand-bg, #ffffff);
  overflow: hidden;
}

.twa-guide .twa-screen {
  position: absolute;
  inset: 8px 8px 46px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.twa-guide .twa-qr-tile {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--brand-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.twa-guide .twa-qr {
  width: 64px;
  height: 64px;
  background-image:
    linear-gradient(45deg, #0f172a 25%, transparent 25%, transparent 75%, #0f172a 75%),
    linear-gradient(45deg, #0f172a 25%, transparent 25%, transparent 75%, #0f172a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.twa-guide .twa-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.twa-guide .twa-app-name {
  font-size: 10px;
  line-height: 1.2;
  color: var(--brand-text-muted, #475569);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twa-guide .twa-omnibox {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 26px;
  border-radius: 13px;
  background: var(--brand-surface, #f8fafc);
  border: 1px solid var(--brand-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  font-size: 9px;
  color: var(--brand-text-muted, #475569);
}

.twa-guide .twa-omnibox-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twa-guide .twa-seg {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation-duration: 12s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1, end);
}

.twa-guide .twa-seg-1 { animation-name: twa-seg-1; }
.twa-guide .twa-seg-2 { animation-name: twa-seg-2; }
.twa-guide .twa-seg-3 { animation-name: twa-seg-3; }
.twa-guide .twa-seg-4 { animation-name: twa-seg-4; }
.twa-guide .twa-seg-5 { animation-name: twa-seg-5; }

@keyframes twa-seg-1 { 0% { opacity: 1 } 20%, 100% { opacity: 0 } }
@keyframes twa-seg-2 { 0% { opacity: 0 } 20% { opacity: 1 } 40%, 100% { opacity: 0 } }
@keyframes twa-seg-3 { 0% { opacity: 0 } 40% { opacity: 1 } 60%, 100% { opacity: 0 } }
@keyframes twa-seg-4 { 0% { opacity: 0 } 60% { opacity: 1 } 80%, 100% { opacity: 0 } }
@keyframes twa-seg-5 { 0% { opacity: 0 } 80% { opacity: 1 } 100% { opacity: 1 } }

.twa-guide .twa-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 9999px;
  border: 2px solid var(--brand-primary, #0f172a);
  animation: twa-tap 1.6s ease-out infinite;
}

.twa-guide .twa-ring-more { left: 148px; top: 254px; }
.twa-guide .twa-ring-share { left: 84px; top: 96px; }
.twa-guide .twa-ring-sheet { left: 84px; top: 210px; }
.twa-guide .twa-ring-add { left: 84px; top: 186px; }

@keyframes twa-tap {
  0% { transform: scale(0.6); opacity: 0.2 }
  40% { transform: scale(1); opacity: 1 }
  100% { transform: scale(1.5); opacity: 0 }
}

.twa-guide .twa-pill {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
  border-radius: 9999px;
  background: var(--brand-primary, #0f172a);
  color: var(--brand-primary-on, #ffffff);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
}

.twa-guide .twa-menu,
.twa-guide .twa-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  border-radius: 12px;
  background: var(--brand-surface, #f8fafc);
  border: 1px solid var(--brand-border, #e2e8f0);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.twa-guide .twa-menu { top: 70px; }
.twa-guide .twa-sheet { bottom: 44px; }

.twa-guide .twa-row {
  font-size: 10px;
  line-height: 1.4;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--brand-text, #0f172a);
  text-align: left;
}

.twa-guide .twa-row-active {
  background: var(--brand-bg, #ffffff);
  font-weight: 600;
  outline: 2px solid var(--brand-primary, #0f172a);
}

.twa-guide .twa-grid {
  position: absolute;
  inset: 40px 18px auto 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.twa-guide .twa-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--brand-surface, #f8fafc);
  border: 1px solid var(--brand-border, #e2e8f0);
}

.twa-guide .twa-tile-app img {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  object-fit: cover;
}

.twa-guide .twa-check {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--brand-primary, #0f172a);
  color: var(--brand-primary-on, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .twa-guide .twa-seg { animation: none; opacity: 0 }
  .twa-guide .twa-seg-4 { opacity: 1 }
  .twa-guide .twa-ring { animation: none; opacity: 1 }
}
