/* PWA install — Shark's (Nexus CRM style) */

.install-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.install-btns--compact {
  gap: 6px;
}

.install-btns--compact .install-btn {
  padding: 6px 10px;
  font-size: 0;
}

.install-btns--compact .install-btn .install-label {
  display: none;
}

.install-btns--compact .install-icon {
  width: 16px;
  height: 16px;
}

body.is-standalone .install-btns,
body.is-standalone .auth-install {
  display: none !important;
}

.auth-install {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.auth-install-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.btn-install-auto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(168, 85, 247, 0.12));
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.btn-install-auto:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.2);
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(4, 16, 24, 0.75);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
  white-space: nowrap;
}

.install-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.15);
}

.install-btn.ready {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.2);
}

.install-btn-ios:hover { background: rgba(99, 102, 241, 0.18); }
.install-btn-android:hover { background: rgba(34, 197, 94, 0.12); }

.install-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.92;
}

/* Modal */
.install-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

@media (min-width: 769px) {
  .install-modal {
    align-items: center;
    padding: 20px;
  }
}

.install-modal.hidden { display: none; }

body.install-modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.install-modal:not(.hidden) { touch-action: none; }

.install-modal-scroll { touch-action: pan-y; }

.install-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.install-modal-sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  height: min(88dvh, 640px);
  max-height: min(88dvh, 640px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 20px 20px 16px 16px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: linear-gradient(160deg, rgba(10, 31, 46, 0.98), rgba(4, 16, 24, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(14, 165, 233, 0.1);
  overflow: hidden;
}

@media (min-width: 769px) {
  .install-modal-sheet {
    border-radius: 20px;
    height: auto;
    max-height: min(85vh, 640px);
  }
}

.install-modal-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 28px 24px 12px;
}

.install-app-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.install-app-preview img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}

.install-app-preview strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 1px;
}

.install-app-preview span {
  font-size: 12px;
  color: var(--muted);
}

.install-modal-sheet h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
  padding-right: 28px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.install-modal-lead {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.install-steps {
  margin: 0 0 20px 1.1rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.install-steps li { margin-bottom: 8px; }
.install-steps strong { color: var(--accent2); font-weight: 600; }

.install-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.12);
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.install-modal-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 24px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(14, 165, 233, 0.15);
  background: rgba(4, 16, 24, 0.95);
}

.btn-install-open,
.btn-install-done {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-install-open {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #041018;
}

.btn-install-done {
  background: rgba(125, 211, 252, 0.1);
  color: var(--text);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
