/*
  Schermate dimostrative di Ryd, dentro il telefono.

  Stessi token, stessi font e stessa struttura dell'app (src/index.css,
  Dashboard, Movimenti, Patrimonio, Spese condivise, Importa, blocco).
  Tutti i dati sono inventati.

  Le variabili --cat-* sono generate da costruisci-vetrina.mjs a partire da
  src/lib/palette.ts: la tavolozza ha una sola sorgente.
*/

.app {
  color-scheme: dark;
  --a-bg: #0d0d0d;
  --a-fg: #f4ebdd;
  --a-card: #161513;
  --a-card-2: #121110;
  --a-tenue: #9a8f7c;
  --a-bordo: #2a251d;
  --a-primario: #e1a857;
  --a-ok: #8fbf9a;
  --a-no: #e3867a;
  --a-sec: #1c1a17;
  --a-notte-1: #1d1a15;
  --a-notte-2: #0f0e0c;

  position: relative;
  width: 390px;
  height: 844px;
  overflow: hidden;
  border-radius: 48px;
  background: var(--a-bg);
  color: var(--a-fg);
  font-family: "InterVar", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  user-select: none;
}



.app *,
.app *::before,
.app *::after {
  box-sizing: border-box;
}

.app svg.i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.app .a-em {
  font-family: "Jost", sans-serif;
  font-style: italic;
  font-weight: 400;
  color: var(--a-primario);
  padding-right: 0.04em;
}

.app .a-nota {
  font-family: "Jost", sans-serif;
  font-style: italic;
  color: var(--a-tenue);
}

.app .n {
  font-variant-numeric: tabular-nums;
  font-family: "InterVar", sans-serif;
}

/* ---------- barra di stato ---------- */

.a-stato {
  position: absolute;
  inset: 0 0 auto 0;
  height: 54px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 34px 0 38px;
  font-weight: 600;
  font-size: 15px;
  pointer-events: none;
}

/* Il contenuto passa sotto la barra di stato e sfuma, come nell'app. */
.a-stato::before {
  content: "";
  position: absolute;
  inset: 0 0 -16px 0;
  z-index: -1;
  background: linear-gradient(to bottom, var(--a-bg) 0, var(--a-bg) 54px, transparent 100%);
}

.a-stato .isola {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 118px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #000;
}

.a-stato .icone {
  display: flex;
  gap: 5px;
  align-items: center;
}

.a-stato .icone .i {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

/* ---------- viste ---------- */

.a-vista {
  position: absolute;
  inset: 0;
  padding-top: 54px;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.985);
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app[data-vista="home"] .v-home,
.app[data-vista="movimenti"] .v-movimenti,
.app[data-vista="patrimonio"] .v-patrimonio,
.app[data-vista="investimenti"] .v-investimenti,
.app[data-vista="bilancio"] .v-bilancio,
.app[data-vista="privacy"] .v-privacy,
.app[data-vista="condivise"] .v-condivise,
.app[data-vista="importa"] .v-importa,
.app[data-vista="blocco"] .v-blocco {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.a-scroll {
  padding: 8px 12px 130px;
  display: grid;
  gap: 14px;
  transition: transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Home scorre fino alla scheda Budget quando la sezione lo chiede. */
.app[data-scorri="budget"] .v-home .a-scroll {
  transform: translate3d(0, -232px, 0);
}

.a-pagina {
  padding: 8px 14px 130px;
  display: grid;
  gap: 14px;
}

.a-titolo {
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 6px 0 0;
}

/* ---------- Home ---------- */

.a-testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.a-glifo {
  height: 44px;
  width: auto;
}

.a-tondi {
  display: flex;
  gap: 8px;
}

.a-tondo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--a-bordo);
  background: var(--a-bg);
  color: var(--a-fg);
}

.a-bilancio {
  text-align: center;
  padding: 14px 0 6px;
}

.a-periodo {
  font-family: "Jost", sans-serif;
  font-size: 14px;
  color: var(--a-tenue);
  margin: 0 0 4px;
}

.a-importo {
  margin: 0;
  font-family: "InterVar", sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ok {
  color: var(--a-ok);
}
.no {
  color: var(--a-no);
}

.a-due {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.a-casella {
  border-radius: 16px;
  padding: 12px;
  background: color-mix(in srgb, var(--a-fg) 4%, transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.a-casella .tondino {
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 999px;
}
.a-casella .tondino.ok {
  background: color-mix(in srgb, var(--a-ok) 12%, transparent);
}
.a-casella .tondino.no {
  background: color-mix(in srgb, var(--a-no) 12%, transparent);
}

.a-casella small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a-tenue);
}

.a-casella b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.a-card {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, var(--a-card), var(--a-card-2));
  border: 1px solid var(--a-bordo);
  display: grid;
  gap: 12px;
}

.a-card h3 {
  margin: 0;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.a-riga-testa {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

/* ---------- bolle del budget ----------
   Dimensione = budget. Riempimento = speso, fermo al 100%. */

.a-bolle {
  position: relative;
  height: 226px;
}

.a-bolla {
  position: absolute;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  border: 1.5px solid var(--c);
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--c) 40%, transparent) var(--p),
    color-mix(in srgb, var(--c) 7%, transparent) var(--p)
  );
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.15;
}

.a-bolla b {
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 11px;
}

.a-bolla span {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.a-bolla.fuori span {
  color: var(--a-no);
  font-weight: 600;
}

.a-piede {
  font-size: 12px;
  color: var(--a-tenue);
  display: flex;
  justify-content: space-between;
}

.a-grande {
  font-family: "InterVar", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Movimenti ---------- */

.a-mese {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.a-pillola {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--a-sec);
  font-size: 13px;
  font-weight: 500;
}

.a-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--a-bordo);
  font-size: 13px;
  color: var(--a-tenue);
  white-space: nowrap;
}

.a-chip.sel {
  color: #0d0d0d;
  border-color: transparent;
  background-image: linear-gradient(160deg, #f6d89c, #e1a857 55%, #b8853d);
  font-weight: 600;
}

.a-chips {
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.a-giorno {
  font-family: "Jost", sans-serif;
  font-size: 13px;
  color: var(--a-tenue);
  margin: 6px 0 0;
}

.a-lista {
  display: grid;
  gap: 2px;
}

.a-mov {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
}

.a-mov .cerchio {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.a-mov b {
  display: block;
  font-size: 15px;
  font-weight: 500;
}

.a-mov small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-mov .cifra {
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Patrimonio ---------- */

.a-notte {
  border-radius: 22px;
  padding: 20px;
  color: #f4ebdd;
  background: radial-gradient(120% 90% at 100% 0%, rgb(225 168 87 / 0.22), transparent 55%),
    linear-gradient(160deg, var(--a-notte-1), var(--a-notte-2));
  border: 1px solid rgb(225 168 87 / 0.18);
  display: grid;
  gap: 6px;
}

.a-notte small {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(244 235 221 / 0.6);
}

.a-notte .a-grande {
  font-size: 34px;
}

.a-notte .ok {
  color: #8fbf9a;
}

.a-ciambella {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 2px auto 6px;
  border-radius: 50%;
  background: conic-gradient(var(--spicchi));
  display: grid;
  place-items: center;
}

.a-ciambella::before {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--a-card);
}

.a-ciambella div {
  position: relative;
  text-align: center;
}

.a-ciambella small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-classe {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
}

.a-classe i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.a-classe .pc {
  color: var(--a-tenue);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.a-classe .eu {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 82px;
  text-align: right;
}

/* ---------- Spese condivise ---------- */

.a-gruppo {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
}

.a-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.a-gruppo b,
.a-debito b {
  font-size: 15px;
  font-weight: 500;
}

.a-gruppo small,
.a-debito small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-debito {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.a-debito .a-avatar {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.a-tasto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: #0d0d0d;
  background-image: linear-gradient(160deg, #f6d89c, #e1a857 55%, #b8853d);
  box-shadow: 0 8px 20px -10px rgb(225 168 87 / 0.8);
}

/* ---------- Importa da file ---------- */

.a-barra {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 0;
}

.a-file {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
}

.a-file .cerchio {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--a-sec);
}

.a-esito {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--a-ok);
  background: color-mix(in srgb, var(--a-ok) 12%, transparent);
}

.a-esito .i {
  width: 14px;
  height: 14px;
}

.a-voce {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
}

.a-spunta {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--a-bordo);
}

.a-spunta.on {
  border-color: transparent;
  color: #0d0d0d;
  background-image: linear-gradient(160deg, #f6d89c, #e1a857 55%, #b8853d);
}

.a-spunta .i {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.a-voce b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
}

.a-voce small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-voce.spenta {
  opacity: 0.55;
}

.a-fisso {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 28px;
}

/* ---------- blocco ---------- */

.v-blocco {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  padding-top: 0;
  background: var(--a-bg);
}

.v-blocco .a-glifo {
  height: 120px;
}

.v-blocco p {
  margin: 0;
  color: var(--a-tenue);
}

.a-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--a-bordo);
  font-weight: 500;
  font-size: 15px;
}

/* ---------- barra delle schede ---------- */

.a-nav {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 26px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-card) 92%, transparent);
  border: 1px solid var(--a-bordo);
  box-shadow: 0 14px 30px -18px rgb(0 0 0 / 0.55);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.app[data-vista="importa"] .a-nav,
.app[data-vista="privacy"] .a-nav,
.app[data-vista="blocco"] .a-nav {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  pointer-events: none;
}

.a-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-width: 44px;
  border-radius: 999px;
  color: var(--a-tenue);
  background: color-mix(in srgb, var(--a-sec) 70%, transparent);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.3s ease, padding 0.3s ease;
}

.a-tab span {
  display: none;
}

.app[data-vista="home"] .t-home,
.app[data-vista="movimenti"] .t-movimenti,
.app[data-vista="condivise"] .t-condivise,
.app[data-vista="patrimonio"] .t-patrimonio,
.app[data-vista="investimenti"] .t-patrimonio,
.app[data-vista="bilancio"] .t-patrimonio {
  padding: 0 20px;
  color: #0d0d0d;
  background-image: linear-gradient(160deg, #f6d89c, #e1a857 55%, #b8853d);
}

.app[data-vista="home"] .t-home span,
.app[data-vista="movimenti"] .t-movimenti span,
.app[data-vista="condivise"] .t-condivise span,
.app[data-vista="patrimonio"] .t-patrimonio span,
.app[data-vista="investimenti"] .t-patrimonio span,
.app[data-vista="bilancio"] .t-patrimonio span {
  display: inline;
}

/* ---------- conti e posizioni ---------- */

.a-conto,
.a-pos {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}

.a-pos {
  grid-template-columns: 1fr auto;
}

.a-conto .cerchio {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

.a-conto .cerchio .i {
  width: 16px;
  height: 16px;
}

.a-conto b,
.a-pos b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
}

.a-conto small,
.a-pos small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-conto > b,
.a-due-valute b {
  font-weight: 600;
}

.a-due-valute {
  text-align: right;
}

.a-due-valute small.ok {
  color: var(--a-ok);
}

/* ---------- bilancio ---------- */

.a-sez {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a-tenue);
}

.a-sez.fuori {
  margin: 4px 4px -6px;
}

.a-voce-bil {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.a-voce-bil b {
  font-weight: 600;
}

.a-voce-bil.tot {
  padding-top: 8px;
  border-top: 1px solid var(--a-bordo);
  font-weight: 600;
}

.a-partita {
  border-color: rgb(225 168 87 / 0.35);
}

.a-insight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  color: var(--a-fg);
  background: color-mix(in srgb, var(--a-primario) 12%, transparent);
}

.a-insight .i {
  color: var(--a-primario);
}

/* ---------- spese condivise: promemoria ---------- */

.a-due-tasti {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.a-ghost.piccolo {
  justify-content: center;
  padding: 0 12px;
  height: 46px;
  font-size: 14px;
}

/* ---------- privacy ---------- */

.a-sicuro {
  grid-template-columns: 24px 1fr;
  display: grid;
  align-items: center;
  gap: 12px;
}

.a-sicuro .i {
  color: var(--a-ok);
  width: 22px;
  height: 22px;
}

.a-sicuro b,
.a-interr b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
}

.a-sicuro small,
.a-interr small {
  display: block;
  font-size: 12px;
  color: var(--a-tenue);
}

.a-interr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.a-interr i {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--a-sec);
}

.a-interr i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--a-fg);
  transition: transform 0.3s;
}

.a-interr i.on {
  background-image: linear-gradient(160deg, #f6d89c, #e1a857 55%, #b8853d);
}

.a-interr i.on::after {
  transform: translateX(18px);
  background: #0d0d0d;
}

/* ---------- sblocco con Face ID ---------- */

.a-sblocca {
  cursor: pointer;
  background: transparent;
  color: var(--a-fg);
  font: inherit;
  font-weight: 500;
  font-size: 15px;
  transition: opacity 0.3s, transform 0.2s;
}

.a-sblocca:active {
  transform: scale(0.97);
}

/* Suggerimento: un anello d'oro pulsa attorno al bottone. */
.app[data-suggerisci] .a-sblocca {
  border-color: var(--a-primario);
  animation: anello 1.6s ease-out infinite;
}

@keyframes anello {
  0% {
    box-shadow: 0 0 0 0 rgb(225 168 87 / 0.55);
  }
  100% {
    box-shadow: 0 0 0 18px rgb(225 168 87 / 0);
  }
}

.a-faceid {
  position: relative;
  width: 72px;
  height: 72px;
  display: none;
  place-items: center;
}

.a-faceid .i {
  position: absolute;
  inset: 0;
  width: 72px;
  height: 72px;
  stroke-width: 1.4;
}

.a-faceid .scansione {
  color: var(--a-primario);
}

.a-faceid .fatto {
  color: var(--a-ok);
  opacity: 0;
  transform: scale(0.6);
}

.app[data-faceid] .a-sblocca,
.app[data-faceid] .a-stato-blocco {
  display: none;
}

.app[data-faceid] .a-faceid {
  display: grid;
}

.app[data-faceid="scan"] .a-faceid .scansione {
  animation: scansione 0.9s ease-in-out infinite;
}

@keyframes scansione {
  50% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

.app[data-faceid="ok"] .a-faceid .scansione {
  opacity: 0;
  transition: opacity 0.2s;
}

.app[data-faceid="ok"] .a-faceid .fatto {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .app[data-suggerisci] .a-sblocca,
  .app[data-faceid="scan"] .a-faceid .scansione {
    animation: none;
  }
}

/* ---------- registrazioni vere ---------- */

/* Il video copre tutto lo schermo, barra di stato compresa (e' nella
   registrazione). Lo accende scena.js con data-film sulla scena che ne ha uno. */
.a-film {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--a-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.app[data-film] .a-film {
  opacity: 1;
}
