/*
======================================================
TRIPLE STAR
PAGINA INSTALLAZIONE APP
======================================================
*/

:root {
  --install-bg: #020711;
  --install-panel: #071321;
  --install-panel-light: #0c1d31;
  --install-border: #d6a300;
  --install-gold: #ffc400;
  --install-gold-light: #ffe47a;
  --install-text: #ffffff;
  --install-muted: #b9c6d8;
  --install-green: #19b31d;
  --install-green-dark: #0d7710;
  --install-blue: #147bd1;
  --install-blue-dark: #0b4b83;
  --install-danger: #ffcf40;
  --install-shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--install-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at top,
      rgba(19, 54, 91, 0.68),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      #06101d 0%,
      #020711 48%,
      #00040a 100%
    );
  color: var(--install-text);
  font-family:
    Arial,
    Helvetica,
    sans-serif;
}

/*
======================================================
HEADER
======================================================
*/

.install-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 90px;
  padding: 14px clamp(18px, 4vw, 60px);
  border-bottom: 3px solid var(--install-border);
  background:
    linear-gradient(
      180deg,
      rgba(4, 13, 25, 0.98),
      rgba(1, 7, 15, 0.98)
    );
  box-shadow: 0 8px 30px var(--install-shadow);
}

.install-header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.install-header-title img {
  width: 62px;
  height: 62px;
  border: 2px solid var(--install-gold);
  border-radius: 16px;
  object-fit: cover;
  box-shadow:
    0 0 18px rgba(255, 196, 0, 0.35);
}

.install-header-title h1 {
  margin: 0;
  color: var(--install-gold);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 2px;
}

.install-header-title p {
  margin: 5px 0 0;
  color: var(--install-muted);
  font-size: 14px;
}

.back-button,
.bottom-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--install-border);
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      #16243a,
      #07111f
    );
  color: var(--install-gold);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.back-button:hover,
.bottom-back-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow:
    0 0 18px rgba(255, 196, 0, 0.28);
}

/*
======================================================
CONTENUTO GENERALE
======================================================
*/

.install-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.install-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  border: 3px solid var(--install-border);
  border-radius: 26px;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 196, 0, 0.15),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      rgba(12, 33, 57, 0.98),
      rgba(4, 13, 25, 0.98)
    );
  text-align: center;
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.48),
    inset 0 0 30px rgba(255, 196, 0, 0.05);
}

.install-hero::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(255, 196, 0, 0.35);
  border-radius: 18px;
}

.install-hero-icon {
  margin-bottom: 12px;
  font-size: clamp(52px, 8vw, 82px);
}

.install-hero h2 {
  position: relative;
  margin: 0;
  color: var(--install-gold);
  font-size: clamp(25px, 4vw, 44px);
  letter-spacing: 1px;
}

.install-hero p {
  position: relative;
  max-width: 780px;
  margin: 20px auto 0;
  color: #e7edf5;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

/*
======================================================
CARD DISPOSITIVI
======================================================
*/

.device-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 32px;
}

.device-card {
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border: 2px solid var(--install-border);
  border-radius: 24px;
  background:
    linear-gradient(
      160deg,
      rgba(12, 29, 49, 0.98),
      rgba(4, 13, 24, 0.98)
    );
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.42);
}

.android-card {
  border-top: 6px solid var(--install-green);
}

.apple-card {
  border-top: 6px solid #dce7f5;
}

.device-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid
    rgba(255, 255, 255, 0.12);
}

.device-icon {
  display: grid;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px solid var(--install-border);
  border-radius: 18px;
  background: #06101d;
  font-size: 38px;
}

.device-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--install-gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
}

.device-card h2 {
  margin: 0;
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.15;
}

.device-description {
  min-height: 78px;
  margin: 22px 0;
  color: var(--install-muted);
  font-size: 16px;
  line-height: 1.6;
}

/*
======================================================
PULSANTI DOWNLOAD
======================================================
*/

.download-apk-button,
.open-webapp-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  color: #ffffff;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.5px;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease;
}

.download-apk-button {
  background:
    linear-gradient(
      180deg,
      #22c527,
      var(--install-green-dark)
    );
}

.open-webapp-button {
  background:
    linear-gradient(
      180deg,
      #2396ed,
      var(--install-blue-dark)
    );
}

.download-apk-button:hover,
.open-webapp-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.46);
}

.download-apk-button:active,
.open-webapp-button:active {
  transform: translateY(0);
}

.download-note {
  margin: 10px 0 0;
  color: var(--install-muted);
  font-size: 12px;
  text-align: center;
}

/*
======================================================
SEZIONI APRI E CHIUDI
======================================================
*/

.instructions-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.instructions-list details {
  overflow: hidden;
  border: 1px solid
    rgba(255, 196, 0, 0.45);
  border-radius: 14px;
  background: rgba(2, 8, 16, 0.72);
}

.instructions-list summary {
  position: relative;
  padding: 18px 48px 18px 18px;
  color: var(--install-gold-light);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.instructions-list summary::-webkit-details-marker {
  display: none;
}

.instructions-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  color: var(--install-gold);
  font-size: 27px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
}

.instructions-list details[open] summary::after {
  content: "−";
}

.instructions-list details[open] summary {
  border-bottom: 1px solid
    rgba(255, 196, 0, 0.28);
  background: rgba(255, 196, 0, 0.07);
}

.instruction-content {
  padding: 18px;
  color: #e5ebf3;
  font-size: 15px;
  line-height: 1.65;
}

.instruction-content p {
  margin: 0 0 15px;
}

.instruction-content p:last-child {
  margin-bottom: 0;
}

.instruction-content ol {
  margin: 0;
  padding-left: 24px;
}

.instruction-content li {
  margin-bottom: 12px;
  padding-left: 5px;
}

.instruction-content li:last-child {
  margin-bottom: 0;
}

.instruction-content strong {
  color: var(--install-gold-light);
}

.security-note {
  margin-top: 18px !important;
  padding: 14px;
  border-left: 4px solid var(--install-danger);
  border-radius: 8px;
  background: rgba(255, 196, 0, 0.09);
  color: #fff0b0;
}

/*
======================================================
ASSISTENZA
======================================================
*/

.support-card {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 32px;
  padding: 25px;
  border: 2px solid rgba(255, 196, 0, 0.55);
  border-radius: 20px;
  background:
    linear-gradient(
      135deg,
      rgba(17, 38, 63, 0.94),
      rgba(5, 15, 28, 0.98)
    );
}

.support-icon {
  display: grid;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 196, 0, 0.12);
  font-size: 34px;
}

.support-card h2 {
  margin: 0 0 8px;
  color: var(--install-gold);
  font-size: 22px;
}

.support-card p {
  margin: 0;
  color: var(--install-muted);
  line-height: 1.55;
}

/*
======================================================
PARTE FINALE
======================================================
*/

.bottom-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.bottom-back-button {
  min-width: 260px;
}

.install-footer {
  padding: 22px 16px;
  border-top: 1px solid
    rgba(255, 196, 0, 0.28);
  background: #01050b;
  color: #8493a7;
  font-size: 13px;
  text-align: center;
}

.install-footer p {
  margin: 0;
}

/*
======================================================
TABLET E MOBILE
======================================================
*/

@media (max-width: 900px) {
  .install-header {
    position: relative;
    flex-direction: column-reverse;
    align-items: stretch;
    padding: 16px;
  }

  .install-header-title {
    justify-content: center;
    text-align: left;
  }

  .back-button {
    width: 100%;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }

  .device-description {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .install-page {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .install-header-title img {
    width: 54px;
    height: 54px;
  }

  .install-header-title h1 {
    font-size: 23px;
  }

  .install-header-title p {
    font-size: 12px;
  }

  .install-hero {
    padding: 30px 18px;
    border-radius: 19px;
  }

  .install-hero::before {
    inset: 7px;
    border-radius: 13px;
  }

  .device-grid {
    gap: 18px;
    margin-top: 18px;
  }

  .device-card {
    padding: 18px;
    border-radius: 18px;
  }

  .device-card-header {
    align-items: flex-start;
  }

  .device-icon {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 29px;
  }

  .device-card h2 {
    font-size: 20px;
  }

  .device-description {
    margin: 18px 0;
    font-size: 15px;
  }

  .instructions-list summary {
    padding:
      16px
      45px
      16px
      15px;
    font-size: 15px;
  }

  .instruction-content {
    padding: 15px;
    font-size: 14px;
  }

  .support-card {
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }

  .support-icon {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  .bottom-back-button {
    width: 100%;
    min-width: 0;
  }
}

/*
======================================================
ACCESSIBILITÀ
======================================================
*/

a:focus-visible,
summary:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
