/* Shared "Get the app" CTA — used by the landing and rates pages via templates/shared/get_app.html.
 *
 * The pill itself is styled by the including page (it passes its own class in). This file owns the
 * desktop card that the pill morphs into: it sits over the pill, anchored to its top-right corner,
 * starts out at the pill's exact size, and grows — still orange — into a card with the QR code.
 * Relies on the semantic tokens from tokens.css. */

.get-app {
  --get-app-pill-width: 120px; /* overwritten by the script with the pill's measured width */
  --get-app-copy-width: 192px;
  --get-app-qr-size: 136px;
  --get-app-pad: var(--treo-space-l); /* one value for all four sides and the column gap */
  --get-app-open-width: calc(var(--get-app-copy-width) + var(--get-app-qr-size) + 3 * var(--get-app-pad));
  --get-app-open-height: calc(var(--get-app-qr-size) + 2 * var(--get-app-pad));
  --get-app-ease: cubic-bezier(0.65, 0, 0.35, 1); /* easeInOutCubic — resizes go both ways (§6.2) */
  position: relative;
  z-index: 5; /* the open card overlays whatever the page puts below the header */
  display: inline-flex;
  pointer-events: auto; /* the landing nav disables pointer events on itself and re-enables per control */
}

.get-app-card {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--get-app-copy-width) var(--get-app-qr-size);
  column-gap: var(--get-app-pad);
  align-items: center;
  box-sizing: border-box;
  width: var(--get-app-pill-width);
  height: 44px;
  padding: var(--get-app-pad);
  border-radius: var(--treo-radius-full);
  background: var(--treo-surface-accent);
  overflow: hidden;
  visibility: hidden;
  transition:
    width var(--treo-motion-standard) var(--get-app-ease),
    height var(--treo-motion-standard) var(--get-app-ease),
    border-radius var(--treo-motion-standard) var(--get-app-ease),
    box-shadow var(--treo-motion-standard) var(--get-app-ease),
    visibility 0s linear var(--treo-motion-standard); /* stays visible until the collapse has finished */
}

.get-app.is-open .get-app-card {
  width: var(--get-app-open-width);
  height: var(--get-app-open-height);
  border-radius: var(--treo-radius-lg);
  box-shadow: var(--treo-shadow-floating);
  visibility: visible;
  transition-delay: 0s;
}

/* Contents fade in once the card has most of its shape, and drop out first on the way back */
.get-app-card > * {
  opacity: 0;
  transition: opacity var(--treo-motion-instant) ease-in;
}

.get-app.is-open .get-app-card > * {
  opacity: 1;
  transition: opacity var(--treo-motion-quick) ease-out 140ms;
}

.get-app-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.get-app-title {
  margin: 0;
  font-family: var(--treo-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 2rem;
  color: var(--treo-content-primary); /* 7.46:1 on accent (§7.2) */
}

.get-app-qr {
  display: block;
  width: var(--get-app-qr-size);
  height: var(--get-app-qr-size);
  border-radius: var(--treo-radius-md);
}

/* Reduced motion: no resize choreography, just a cross-fade at motion.quick (§6.4) */
@media (prefers-reduced-motion: reduce) {
  .get-app-card,
  .get-app-card > *,
  .get-app.is-open .get-app-card > * {
    transition: opacity var(--treo-motion-quick) ease, visibility 0s linear var(--treo-motion-quick);
  }

  .get-app-card {
    opacity: 0;
    width: var(--get-app-open-width);
    height: var(--get-app-open-height);
    border-radius: var(--treo-radius-lg);
  }

  .get-app.is-open .get-app-card {
    opacity: 1;
    transition-delay: 0s;
  }
}
