/* The page a browser tab gets instead of the app: how to add it to the home
   screen. Colours and font are the app's own (lib/core/constants/app_colors.dart). */

@font-face {
  font-family: 'IRANYekanXFaNum';
  src: url('assets/assets/fonts/IRANYekanXFaNum-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IRANYekanXFaNum';
  src: url('assets/assets/fonts/IRANYekanXFaNum-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

.install {
  --primary: #1e3a8a;
  --brand: #0b6efd;
  --accent: #1e3a8a;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --tint: rgba(11, 110, 253, 0.1);
  --warning: #f59e0b;
  --warning-tint: rgba(245, 158, 11, 0.12);

  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--text);
  font-family: 'IRANYekanXFaNum', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  .install {
    --accent: #3b82f6;
    --bg: #121212;
    --surface: #1e1e1e;
    --text: #ffffff;
    --muted: #b0b0b0;
    --border: #333333;
    --tint: rgba(59, 130, 246, 0.16);
    --warning: #fbbf24;
    --warning-tint: rgba(251, 191, 36, 0.14);
  }
}

.install *,
.install *::before,
.install *::after {
  box-sizing: border-box;
}

.install[hidden],
.install [hidden] {
  display: none !important;
}

.install__hero {
  padding: calc(env(safe-area-inset-top, 0px) + 36px) 24px 76px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--brand) 100%);
  border-radius: 0 0 32px 32px;
  color: #ffffff;
  text-align: center;
}

.install__logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.install__name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.install__role {
  margin: 2px 0 0;
  font-size: 14px;
  opacity: 0.85;
}

.install__body {
  max-width: 460px;
  margin: -52px auto 0;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 96px);
}

.install__card {
  padding: 22px 18px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.install__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.install__lead {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.install__notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--warning-tint);
  border: 1px solid var(--warning);
  border-radius: 14px;
  font-size: 14px;
}

.install__notice strong {
  font-weight: 700;
}

.install__button {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.install__button:active {
  opacity: 0.85;
}

.install__button--quiet {
  min-height: 44px;
  background: transparent;
  border: 1.5px solid var(--warning);
  color: var(--text);
}

.install__or {
  margin: 16px 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.install__steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.install__step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
}

/* The line that ties one number to the next. */
.install__step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 46px;
  bottom: -14px;
  inset-inline-start: 15px;
  width: 2px;
  background: var(--border);
}

.install__num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
}

.install__text {
  flex: 1;
  min-width: 0;
}

.install__text h3 {
  margin: 2px 0 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}

.install__text p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.install__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--accent);
}

.install__icon svg {
  width: 24px;
  height: 24px;
}

.install__icon img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* A name as the phone shows it, kept left-to-right inside the Persian line. */
.install__en {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.install__foot {
  margin: 16px 8px 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* Points at Safari's toolbar, where the first step begins. */
.install__pointer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 36px 0 calc(env(safe-area-inset-bottom, 0px) + 10px);
  /* The steps scroll under it, so they fade out instead of showing through. */
  background: linear-gradient(to bottom, transparent, var(--bg) 45%);
  pointer-events: none;
}

.install__pointer span {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.install__pointer svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  animation: install-bounce 1.4s ease-in-out infinite;
}

@keyframes install-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .install__pointer svg {
    animation: none;
  }
}
