/* App Download widget */

.app-dl {
  --app-dl-navy: #162B48;
  --app-dl-surface: #F5F8FB;
  --app-dl-text-2: #444C60;
  --app-dl-label: #005D5D;
  --app-dl-fluo: #00FFBA;
  --app-dl-active: #0A8E79;
  --app-dl-gradient: var(--gradient-ipzs-blue-light-to-dark, linear-gradient(90deg, #40578D 0%, #202c47 100%));
  --app-dl-radius: 24px;
  --app-dl-shadow: 0 4px 6px rgba(0, 0, 0, .1);

  font-family: Poppins, sans-serif;
  color: var(--app-dl-navy);
  background: #fff;
  border-radius: var(--app-dl-radius);
  box-shadow: var(--app-dl-shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}
.app-dl *, .app-dl *::before, .app-dl *::after { box-sizing: inherit; }

.app-dl__info { display: flex; flex-direction: column; gap: 20px; flex: 1; justify-content: center; }
.app-dl__head { display: flex; gap: 16px; align-items: center; }
.app-dl__icon {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 18px; box-shadow: var(--app-dl-shadow);
  object-fit: cover;
}
.app-dl__titles { display: flex; flex-direction: column; gap: 6px; }
.app-dl__label { font-size: .75rem; font-weight: 600; color: var(--app-dl-label); margin: 0; }
.app-dl__title {
  margin: 0; font-size: 1.5rem; line-height: 1.2; font-weight: 700; letter-spacing: 0;
}
.app-dl__title::after {
  content: ""; display: block; width: 48px; height: 4px; margin-top: 8px;
  border-radius: 2px; background: var(--app-dl-gradient);
}
.app-dl__desc { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--app-dl-text-2); }
.app-dl__meta { margin: 0; font-size: .8125rem; color: var(--app-dl-text-2); }

.app-dl__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
/* Il link è trasparente e grande quanto il badge ufficiale, in ogni stato e variante */
.app-dl__btn,
.app-dl__btn:hover,
.app-dl__btn:active {
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  line-height: 0;
  text-decoration: none;
}
.app-dl__badge { display: block; width: auto; height: 48px; max-width: none; }
/* !important necessario: la regola globale a:focus-visible (mixin fluo-focus) usa !important
   e il suo outline fluo non raggiunge 3:1 sulla card bianca */
.app-dl a:focus-visible {
  outline: 3px solid var(--app-dl-navy) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 1px #fff !important;
  background-color: transparent !important;
  border-radius: 8px;
}
.app-dl .app-dl__qr a:focus-visible {
  outline-color: #fff !important;
  box-shadow: 0 0 0 1px var(--app-dl-navy) !important;
}

.app-dl__qr {
  display: none;
  flex-direction: column; align-items: center; gap: 16px;
  background: var(--app-dl-navy); color: #fff;
  border-radius: var(--app-dl-radius);
  padding: 0 32px 32px; overflow: hidden;
  text-align: center;
}
.app-dl__qr::before {
  content: ""; align-self: stretch; height: 6px; margin: 0 -32px 16px;
  background: var(--app-dl-gradient);
}
.app-dl__qr-code { background: #fff; padding: 24px; border-radius: 16px; line-height: 0; }
.app-dl__qr-code svg, .app-dl__qr-code img { width: 184px; height: 184px; display: block; }
.app-dl__qr-title { margin: 8px 0 0; font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
.app-dl__qr-hint { margin: 0; font-size: .875rem; line-height: 1.5; }
/* Batte lo stile globale dei p (colore testo navy, uguale al fondo del pannello) */
.app-dl .app-dl__qr p { color: #fff; }
.app-dl .app-dl__qr .app-dl__qr-hint { color: rgba(255,255,255,.85); }
.app-dl__qr-url { font-size: .875rem; font-weight: 500; color: var(--app-dl-fluo); }
.app-dl__qr-url:hover { color: #fff; }
.app-dl__empty { padding: 16px; border: 1px dashed #A1A5AF; border-radius: 8px; font: .875rem Poppins, sans-serif; color: #444C60; }
.app-dl__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 768px) {
  .app-dl { flex-direction: row; gap: 56px; padding: 48px; }
  .app-dl__icon { width: 104px; height: 104px; border-radius: 24px; }
  .app-dl__head { gap: 24px; }
  .app-dl__title { font-size: 2.25rem; line-height: 1.15; }
  .app-dl__title::after { width: 64px; }
  .app-dl__desc { font-size: 1.125rem; }
  .app-dl__qr { width: 340px; flex-shrink: 0; }
}
/* QR solo su desktop con mouse: vale anche senza JS, se l'HTML in cache è stato generato per desktop */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .app-dl[data-platform="desktop"] .app-dl__qr { display: flex; }
}

/* Mobile: prima e più grande il badge dello store del dispositivo, poi l'altro */
.app-dl[data-platform="ios"] .app-dl__btn--ios,
.app-dl[data-platform="android"] .app-dl__btn--android { order: -1; }
.app-dl[data-platform="ios"] .app-dl__btn--ios .app-dl__badge,
.app-dl[data-platform="android"] .app-dl__btn--android .app-dl__badge { height: 56px; }
.app-dl[data-platform="ios"] .app-dl__btn--android .app-dl__badge,
.app-dl[data-platform="android"] .app-dl__btn--ios .app-dl__badge { height: 40px; }

.app-dl__installed {
  display: none; gap: 10px; align-items: center;
  padding: 12px 16px; border-radius: 8px;
  background: #E6F1F1; color: #004646; font-size: .875rem; margin: 0;
}
.app-dl[data-installed="true"] .app-dl__installed { display: flex; }

@media (prefers-reduced-motion: reduce) {
  .app-dl__btn { transition: none; }
}