:root {
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: #17222b;
  background: #357fba;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-width: 280px;
  min-height: 100dvh;
  background: linear-gradient(180deg, rgb(80, 182, 226) 0%, rgb(53, 127, 186) 100%);
}

.page {
  width: min(100%, 500px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: calc(clamp(22px, 6.4vw, 31px) / 1.2);
  font-weight: 900;
  letter-spacing: -1.3px;
  line-height: 1;
  text-shadow: 0 1px 8px rgb(17 84 128 / 16%);
}

.brand__icon { width: 40px; height: 40px; object-fit: contain; }
.brand__name { white-space: nowrap; }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 3vh;
}

.action-card, .app-link {
  width: 100%;
  border-radius: 30px;
  box-shadow: 0 16px 38px rgb(16 74 113 / 22%);
}

.action-card {
  min-height: 330px;
  padding: 42px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #fff;
}

.action-card--resizing {
  transition: height .38s cubic-bezier(.4, 0, .2, 1);
}

.state-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: center;
}

.state-content--out { animation: state-out .18s ease-in both; }
.state-content--in { animation: state-pop .3s ease-in-out both }

h1 { margin: 24px 0 8px; font-size: clamp(24px, 7vw, 32px); line-height: 1.08; letter-spacing: -0.8px; }
p { max-width: 340px; margin: 0; color: #6c7881; font-size: 17px; line-height: 1.4; }

.state-icon { height: 86px; display: grid; place-items: center; font-size: 70px; line-height: 1; }
.state-icon--loader { display: flex; align-items: center; gap: 9px; }
.state-icon--loader span { width: 13px; height: 13px; border-radius: 50%; background: #419fd3; animation: bounce 1s infinite ease-in-out; }
.state-icon--loader span:nth-child(2) { animation-delay: .13s; }
.state-icon--loader span:nth-child(3) { animation-delay: .26s; }
.state-icon--404 { color: #419fd3; font-size: 66px; font-weight: 950; letter-spacing: -5px; }

.qr-code { padding: 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px #e7edf0; }
.qr-code img, .qr-code canvas { display: block; width: min(220px, 55vw) !important; height: min(220px, 55vw) !important; }

.install-button {
  width: 100%;
  margin-top: 26px;
  padding: 16px 22px;
  border-radius: 18px;
  color: #fff;
  background: #419fd3;
  box-shadow: 0 8px 20px rgb(65 159 211 / 28%);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.install-button:hover { background: #348fc2; transform: translateY(-1px); box-shadow: 0 10px 24px rgb(65 159 211 / 34%); }
.install-button:active { transform: scale(.98); }
.install-button:focus-visible { outline: 3px solid #419fd3; outline-offset: 3px; }

.app-link {
  min-height: 84px;
  margin-top: 14px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  background: rgb(29 82 126 / 55%);
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.18;
  transition: transform .18s ease, background .18s ease;
}
.app-link:hover { transform: translateY(-2px); background: rgb(25 72 112 / 70%); }
.app-link:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.app-link__logo { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 17px; background: rgb(255 255 255 / 14%); }
.app-link__logo img { width: 42px; height: 42px; }
.app-link__arrow { margin-left: auto; font-size: 27px; }

@keyframes bounce { 0%, 55%, 100% { transform: translateY(0); opacity: .45; } 28% { transform: translateY(-13px); opacity: 1; } }
@keyframes state-out { to { opacity: 0; transform: scale(.82); } }
@keyframes state-pop {
  0% { opacity: 0; transform: scale(.5); }
  50% { opacity: 1; transform: scale(1.1); }
  70% { opacity: 1; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1.00); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (prefers-color-scheme: dark) {
  :root { color: #f5f8fa; }
  .action-card { background: #15232d; }
  p { color: #aeb9c0; }
  .qr-code { box-shadow: none; }
}

@media (max-height: 660px) {
  .page { padding-top: 18px; }
  .brand__icon { width: 45px; height: 45px; }
  .content { padding-top: 20px; }
  .action-card { min-height: 290px; padding-block: 28px; }
}
