/* Interruttore del tema dell'anteprima (non fa parte dell'app). */
.anteprima-tema {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 3px 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(127, 127, 127, 0.3));
  background: color-mix(in oklab, var(--popover, #111) 78%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--muted-foreground, #999);
  font: 500 11px/1 var(--font-sans, system-ui), system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.anteprima-tema button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--foreground, currentColor);
  cursor: pointer;
  transition:
    background-color 150ms ease-out,
    transform 150ms ease-out;
}
.anteprima-tema button:hover {
  background: var(--accent, rgba(127, 127, 127, 0.15));
}
.anteprima-tema button:active {
  transform: scale(0.94);
}
.anteprima-tema button:focus-visible {
  outline: 2px solid var(--ring, currentColor);
  outline-offset: 2px;
}
.dark .anteprima-luna,
html:not(.dark) .anteprima-sole {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .anteprima-tema button {
    transition: none;
  }
}

/* Fascia fissa: dice chiaro che la pagina e' solo un'anteprima grafica. */
:root {
  --anteprima-fascia: 40px;
}
@media (max-width: 640px) {
  :root {
    --anteprima-fascia: 56px;
  }
}
.anteprima-fascia {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483000;
  box-sizing: border-box;
  height: var(--anteprima-fascia);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  text-wrap: balance;
  font: 600 13px/1.35 var(--font-sans, system-ui), system-ui, sans-serif;
  color: var(--yx-amber, #7f5600);
  /* Velo ambra del tema sopra il fondo pieno della pagina: opaco, leggibile nei due temi. */
  background:
    linear-gradient(var(--yx-amber-bg, rgba(200, 140, 20, 0.16)), var(--yx-amber-bg, rgba(200, 140, 20, 0.16))),
    var(--color-background, var(--yx-bg, #fdfdfc));
  border-bottom: 1px solid color-mix(in oklab, var(--yx-amber, #7f5600) 40%, transparent);
  animation: anteprima-fascia-in 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes anteprima-fascia-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Lo spazio della fascia e' riservato da subito: il contenuto non finisce sotto. */
body {
  padding-top: var(--anteprima-fascia);
}
/* Altezza minima invece di fissa: se lo schermo e' basso la pagina scorre, la card non si schiaccia. */
body > [data-slot="auth-page"] {
  height: auto;
  min-height: calc(100dvh - var(--anteprima-fascia));
}
.anteprima-tema {
  top: calc(var(--anteprima-fascia) + 12px);
}
/* Telefono: pillola piu' compatta e una striscia riservata, cosi' non tocca il logo. */
@media (max-width: 640px) {
  .anteprima-tema {
    top: calc(var(--anteprima-fascia) + 8px);
    padding: 2px 2px 2px 9px;
  }
  .anteprima-tema button {
    width: 24px;
    height: 24px;
  }
  body > [data-slot="auth-page"] {
    padding-top: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .anteprima-fascia {
    animation: none;
  }
}
