/* --------------------------------------------------------------------------
   Barra superiore
   -------------------------------------------------------------------------- */

.floating-toolbar {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  width: min(680px, calc(100% - 32px));
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px 8px 12px;
  border-radius: 22px;
  transform: translateX(-50%);
}

.toolbar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.toolbar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.toolbar-actions {
  display: flex;
  gap: 7px;
}

.toolbar-actions svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* --------------------------------------------------------------------------
   Contenuto pubblico
   -------------------------------------------------------------------------- */

.public-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  padding: 132px 22px 48px;
}

.loading-state {
  display: flex;
  min-height: 55vh;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.loading-state p {
  margin: 0;
}

.error-state {
  width: min(100%, 420px);
  margin: 18vh auto 0;
  padding: 28px;
  border-radius: 24px;
  text-align: center;
}

.error-state strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.error-state p {
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.error-state button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.cookie-settings-button {
  position: fixed;
  z-index: 45;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 14px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(16, 8, 27, 0.68);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
}

.cookie-settings-button:hover {
  color: white;
  border-color: color-mix(in srgb, var(--primary) 48%, white);
}

.cookie-banner {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  width: min(760px, calc(100% - 32px));
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-radius: 18px;
  transform: translateX(-50%);
  animation: cookie-banner-in 300ms ease-out both;
}

.cookie-banner__copy {
  min-width: 0;
}

.cookie-banner__copy strong {
  display: block;
  font-size: 0.72rem;
}

.cookie-banner__copy p {
  max-width: 520px;
  margin: 4px 0 5px;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.45;
}

.cookie-banner__copy a {
  color: color-mix(in srgb, var(--secondary) 62%, white);
  font-size: 0.61rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.cookie-banner__actions button {
  min-height: 38px;
  padding-inline: 13px;
  white-space: nowrap;
  font-size: 0.65rem;
}

@keyframes cookie-banner-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
}

@media (max-width: 600px) {
  .floating-toolbar {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100% - 24px);
    min-height: 54px;
    border-radius: 19px;
  }

  .toolbar-brand span {
    font-size: 0.7rem;
  }

  .round-button {
    width: 37px;
    height: 37px;
  }

  .public-page {
    padding: 108px 15px 34px;
  }

  .avatar-frame {
    width: 98px;
    height: 98px;
    margin-bottom: 20px;
    border-radius: 30px;
  }

  .avatar-frame::before {
    border-radius: 29px;
  }

  .avatar-frame img {
    border-radius: 25px;
  }

  .profile-header h1 {
    font-size: 2.35rem;
  }

  .profile-bio {
    max-width: 350px;
    font-size: 0.8rem;
  }

  .profile-items {
    gap: 10px;
    margin-top: 30px;
  }

  .profile-card {
    border-radius: 20px;
  }

  a.profile-card {
    grid-template-columns: 48px minmax(0, 1fr) 34px;
    gap: 11px;
    min-height: 72px;
    padding: 10px 11px;
  }

  .profile-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.1rem;
  }

  .profile-card__copy strong {
    font-size: 0.82rem;
  }

  .profile-card__copy small {
    font-size: 0.64rem;
  }

  .profile-card__arrow {
    width: 32px;
    height: 32px;
  }

  .profile-card--text {
    padding: 18px;
  }

  .toast {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    text-align: center;
  }

  .cookie-settings-button {
    bottom: max(9px, env(safe-area-inset-bottom));
    left: 9px;
  }

  .cookie-banner {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100% - 20px);
    flex-direction: column;
    gap: 11px;
    align-items: stretch;
    padding: 12px;
    border-radius: 16px;
  }

  .cookie-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cookie-banner__actions button {
    width: 100%;
    padding-inline: 8px;
    white-space: normal;
  }
}
