/* Stessa palette Soft UI dell'app sul Mac (src/renderer/src/tokens). */
@font-face {
  font-family: 'Space Grotesk';
  src: url('SpaceGrotesk-variable.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('PlusJakartaSans-variable.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --expense: #d03b3b;
  --income: #199e70;
  --accent: #2a78d6;
  --accent-soft: #e4eefb;
  --daniele: #6d5ce8;
  --marianna: #d6428f;
  --page: #f3f2fa;
  --surface: #ffffff;
  --sunken: #f1f0f9;
  --border: #e7e5f2;
  --text: #181a2a;
  --text-2: #5b5e76;
  --muted: #9497ac;
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 32px);
}

h1, h2 { font-family: 'Space Grotesk', system-ui, sans-serif; margin: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }

.testata { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.sopratitolo { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 600; }

.chip-persona {
  border: 0; border-radius: 999px; padding: 7px 12px;
  font: inherit; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text-2);
  box-shadow: 0 1px 2px rgba(24, 26, 42, 0.06);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(24, 26, 42, 0.04), 0 8px 24px rgba(24, 26, 42, 0.05);
  margin-bottom: 14px;
}
.card p { margin: 0 0 8px; color: var(--text-2); line-height: 1.45; }

.piccolo { font-size: 13px; color: var(--muted); }
.centrato { text-align: center; }

.segmentato {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  background: var(--sunken); border-radius: 14px; padding: 4px; margin: 8px 0;
}
.segmentato button {
  border: 0; background: transparent; border-radius: 11px; padding: 10px 8px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text-2);
}
.segmentato button.attivo { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(24, 26, 42, 0.12); }
.segmentato.grande { margin: 0 0 14px; }

.campo-importo {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  margin: 6px 0 18px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}
.campo-importo span { font-size: 32px; font-weight: 600; color: var(--muted); }
.campo-importo input {
  width: 5.5ch; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 52px; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  text-align: left;
}
.campo-importo input::placeholder { color: #cfcde0; }

.campo { display: block; margin-bottom: 12px; }
.campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.campo input, .campo select {
  width: 100%; min-height: 46px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.campo select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
.campo input:focus, .campo select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

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

.spunta { display: flex; align-items: center; gap: 10px; padding: 6px 0 2px; margin-bottom: 12px; font-size: 15px; color: var(--text); }
.spunta input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }

.invia {
  width: 100%; border: 0; border-radius: 16px; padding: 16px;
  background: var(--accent); color: #fff;
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 18px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(42, 120, 214, 0.3);
}
.invia:disabled { opacity: 0.5; box-shadow: none; }

.titolo-sezione { font-size: 15px; color: var(--text-2); margin: 24px 4px 8px; }
#elenco-inviate { list-style: none; margin: 0; padding: 0; }
#elenco-inviate li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--surface); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
#elenco-inviate .descr { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#elenco-inviate .sotto { font-size: 12px; color: var(--muted); }
#elenco-inviate .cifra { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600; white-space: nowrap; }
#elenco-inviate .in-attesa { color: var(--expense); }

#avviso {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; border-radius: 14px; padding: 12px 16px;
  font-size: 15px; font-weight: 600; transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100% - 32px);
}
#avviso.visibile { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
