/* Avenix Bank — PWA UI (install banners, toasts, offline bar) */
/* Colors from web/assets/css/main.css */

.pwa-ios-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 9999;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
  padding-right: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(120%);
  animation: pwa-ios-slide-up 0.35s ease-out forwards;
}

/* Sit above floating bottom nav when browsing in Safari */
html.sp-page-has-bottom-nav .pwa-ios-banner {
  bottom: calc(
    var(--sp-nav-dock-space, 88px) + var(--sp-browser-bottom-offset, 0px) + 12px
  );
}

@keyframes pwa-ios-slide-up {
  to {
    transform: translateY(0);
  }
}

.pwa-ios-banner__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.pwa-ios-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pwa-ios-banner__text strong {
  font-size: 14px;
  font-weight: 700;
  color: #0d2e6e;
  line-height: 1.3;
}

.pwa-ios-banner__text span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pwa-ios-banner__text svg {
  vertical-align: middle;
  flex-shrink: 0;
}

.pwa-ios-banner__install {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: #00c896;
  color: #0d2e6e;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  min-height: 40px;
}

.pwa-ios-banner {
  padding-right: 16px;
}

.pwa-ios-banner__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-ios-banner__arrow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #ffffff;
  pointer-events: none;
}

/* Android install banner */
.pwa-android-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  animation: pwa-android-slide-up 0.3s ease-out forwards;
}

@keyframes pwa-android-slide-up {
  to {
    transform: translateY(0);
  }
}

.pwa-android-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-android-banner__text strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.pwa-android-banner__text span {
  font-size: 12px;
  color: #94a3b8;
  display: block;
  line-height: 1.35;
}

.pwa-android-banner__install {
  background: #0d2e6e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.pwa-android-banner__close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* Update toast */
.pwa-update-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #0d2e6e;
  color: #ffffff;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transform: translateY(-100%);
  animation: pwa-update-slide-down 0.3s ease-out forwards;
}

@keyframes pwa-update-slide-down {
  to {
    transform: translateY(0);
  }
}

.pwa-update-toast span {
  flex: 1;
  line-height: 1.35;
}

.pwa-update-toast__now {
  background: #00c896;
  color: #0d2e6e;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.pwa-update-toast__later {
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  opacity: 0.7;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

/* Offline banner */
.pwa-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #1a1a1a;
  color: #ffffff;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  transform: translateY(-100%);
  animation: pwa-offline-slide-down 0.2s ease-out forwards;
}

.pwa-offline-banner::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #d97706;
  vertical-align: middle;
  animation: pwa-pulse 1.5s infinite;
}

@keyframes pwa-offline-slide-down {
  to {
    transform: translateY(0);
  }
}

@keyframes pwa-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Toast */
.pwa-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 320px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9998;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

.pwa-toast--visible {
  opacity: 1;
}

.pwa-toast--success {
  background: #00c896;
  color: #0d2e6e;
}

.pwa-toast--error {
  background: #e53e3e;
  color: #ffffff;
}

.pwa-toast--info {
  background: #1e293b;
  color: #ffffff;
}

/* iOS install guide (full-screen helper — Safari has no one-tap install API) */
.pwa-ios-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 0;
  animation: pwa-ios-sheet-fade 0.25s ease;
}

@keyframes pwa-ios-sheet-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pwa-ios-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0));
  animation: pwa-ios-sheet-up 0.35s ease;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes pwa-ios-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.pwa-ios-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pwa-ios-sheet__head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0d2e6e;
  line-height: 1.3;
}

.pwa-ios-sheet__head p {
  margin: 6px 0 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.pwa-ios-sheet__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pwa-ios-sheet__steps {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.pwa-ios-sheet__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
  color: #334155;
  line-height: 1.5;
}

.pwa-ios-sheet__step:last-child {
  border-bottom: none;
}

.pwa-ios-sheet__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d2e6e;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-ios-sheet__share-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin: 0 2px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  color: #007aff;
}

.pwa-ios-sheet__highlight {
  font-weight: 700;
  color: #0d2e6e;
}

.pwa-ios-sheet__safari-bar {
  margin-top: 8px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pwa-ios-sheet__safari-bar span {
  font-size: 13px;
  color: #64748b;
}

.pwa-ios-sheet__safari-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #007aff;
  font-size: 10px;
  font-weight: 600;
}

.pwa-ios-sheet__arrow {
  text-align: center;
  font-size: 28px;
  color: #007aff;
  line-height: 1;
  margin: 4px 0;
  animation: pwa-ios-bounce 1.2s ease infinite;
}

@keyframes pwa-ios-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

.pwa-ios-sheet__note {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.pwa-ios-sheet__btn {
  display: block;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: #00c896;
  color: #0d2e6e;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.pwa-ios-sheet__btn--secondary {
  margin-top: 10px;
  background: #f1f5f9;
  color: #0d2e6e;
}
