/**
 * ios-install.css — Growth loop card (WS7)
 *
 * Placement: secondary band below primary "Open in Apple Maps" CTA on success states.
 * Responsive: QR hidden <768px (App Store badge shown instead).
 * Dark-mode: QR always renders dark-on-white (forced), regardless of system theme.
 * A11y: QR is decorative (alt="" aria-hidden), short URL is the keyboard path.
 *
 * See cloudflare/pages/i18n-source/partials/ios-install-card.html for the markup.
 */

.ios-install-card {
  /* Secondary visual band — muted vs primary CTA. Uses the site's
     dark-theme tokens so the card blends with the rest of the page. */
  margin: 2rem 0 0;
  padding: 1.25rem;
  border-radius: var(--radius-md, 16px);
  background: var(--bg-elevated, #111111);
  color: var(--text-primary, #f5f5f7);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  position: relative;
  animation: ios-install-card-fade-in 240ms ease-out 300ms both;
}

@keyframes ios-install-card-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ios-install-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.35));
  margin: 0 0 0.75rem;
}

.ios-install-card__body {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* QR — desktop + tablet (>=768px). Forced white plate regardless of dark mode. */
.ios-install-card__qr {
  flex-shrink: 0;
  background: #ffffff !important; /* Defeat dark mode for QR contrast */
  padding: 8px;
  border-radius: 8px;
  line-height: 0; /* Prevent inline-image gap */
}

.ios-install-card__qr img {
  display: block;
  width: 120px;
  height: 120px;
  background: #ffffff !important; /* Belt and suspenders on dark mode */
  pointer-events: none;
}

/* App Store badge — mobile only (<768px). QR hidden on mobile since phone = camera. */
.ios-install-card__app-store-badge {
  display: none; /* default: hidden on desktop/tablet */
}

.ios-install-card__badge-link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: #000000;
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 500;
  font-size: 1rem;
  min-height: 44px; /* touch target */
  min-width: 44px;
}

.ios-install-card__badge-link:hover {
  background: #1d1d1f;
}

.ios-install-card__copy {
  flex: 1 1 260px;
  min-width: 0; /* allow text truncation */
}

.ios-install-card__tagline {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text-primary, #f5f5f7);
  line-height: 1.3;
}

.ios-install-card__subtitle {
  font-size: 0.9375rem;
  margin: 0 0 0.5rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.55));
  line-height: 1.4;
}

.ios-install-card__short-url {
  font-size: 0.8125rem;
  color: var(--accent, #0A84FF);
  text-decoration: none;
  font-family: ui-monospace, 'SF Mono', monospace;
}

.ios-install-card__short-url:hover {
  text-decoration: underline;
}

/* Dismiss button — small X in top-right */
.ios-install-card__dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.35));
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ios-install-card__dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f5f5f7);
}

.ios-install-card__dismiss:focus-visible {
  outline: 2px solid var(--accent, #0A84FF);
  outline-offset: 2px;
}

/* Fallback variant — notify-me form for non-core locales */
.ios-install-card--fallback .ios-install-card__notify-prompt {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary, rgba(255, 255, 255, 0.55));
  line-height: 1.4;
}

.ios-install-card__notify-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.ios-install-card__notify-label {
  flex: 1 1 200px;
  display: block;
}

.ios-install-card__notify-label input[type="email"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--bg-card, #0d0d0d);
  color: var(--text-primary, #f5f5f7);
  min-height: 44px;
}

.ios-install-card__notify-label input[type="email"]:focus {
  outline: 2px solid var(--accent, #0A84FF);
  outline-offset: -1px;
  border-color: transparent;
}

.ios-install-card__notify-submit {
  padding: 0.625rem 1.25rem;
  background: var(--accent, #0A84FF);
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.ios-install-card__notify-submit:hover {
  background: #1a8cff;
}

.ios-install-card__notify-submit:focus-visible {
  outline: 2px solid #0060c9;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet (768-1023): QR at 92×92 */
@media (min-width: 768px) and (max-width: 1023px) {
  .ios-install-card__qr img {
    width: 92px;
    height: 92px;
  }
}

/* Mobile (<768px): hide QR, show App Store badge */
@media (max-width: 767px) {
  .ios-install-card__qr {
    display: none;
  }
  .ios-install-card__app-store-badge {
    display: block;
  }
  .ios-install-card__tagline {
    font-size: 1rem;
  }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ios-install-card {
    animation: none;
  }
}
