/* Pharm.uz app redirect — colors follow the portal's Tailwind theme */
:root {
  --primary: #3871f0;
  --primary-dark: #1549bd;
  --primary-light: #4d83fb;
  --accent: #0d6efd;
  --accent-soft: #92beff;
  --bg: #f2f5fd;
  --card: #ffffff;
  --text: #04070d;
  --text-muted: #5b6886;
  --border: #d4d8e2;
  --radius: 20px;
  --font: 'Inter', 'Helvetica Neue', Helvetica, Arial, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(146, 190, 255, 0.45), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(13, 110, 253, 0.18), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 40px 28px 32px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px rgba(4, 7, 13, 0.04),
    0 20px 48px -16px rgba(21, 73, 189, 0.25);
  animation: rise 0.45s ease-out both;
}

.logo {
  display: block;
  width: 172px;
  height: auto;
  margin: 0 auto 28px;
}

.title {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Redirect status */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-dark);
  background: #e2edfd;
  border-radius: 12px;
}

.status[hidden],
.store[hidden] {
  display: none;
}

.spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Store buttons */
.stores {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.store {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  text-align: left;
  background: #04070d;
  border-radius: 14px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.store:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(4, 7, 13, 0.5);
}

.store:active {
  transform: translateY(0);
}

.store:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

/* Highlight the store that matches the visitor's device */
.store.is-primary {
  background: linear-gradient(to right, var(--primary-light), var(--primary-dark));
  box-shadow: 0 12px 28px -12px rgba(21, 73, 189, 0.6);
}

.store__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store__text small {
  font-size: 12px;
  opacity: 0.8;
}

.store__text strong {
  font-size: 19px;
  font-weight: 600;
}

.hint {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.site-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.site-link:hover {
  text-decoration: underline;
}

.footer {
  max-width: 440px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (min-width: 520px) {
  .card {
    padding: 48px 40px 36px;
  }

  .title {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .spinner {
    animation: none;
  }

  .store {
    transition: none;
  }
}
