/* Serenity · Cooperativa Sociale Miro — stile condiviso */
@font-face {
  font-family: 'Bricolage'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'Bricolage'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url('/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* I quattro colori del logo Miro + l'inchiostro del marchio */
  --inchiostro: #1B1F5E;
  --inchiostro-2: #2A2F78;
  --arancio: #EE7124;
  --cielo: #3BA3DC;
  --foglia: #7DB83F;
  --sole: #F4C531;
  --carta: #F4F6FA;
  --bianco: #FFFFFF;
  --testo: #1B1F5E;
  --testo-2: #565B86;
  --linea: #DDE1EC;
  --rosso: #D63B30;
  --ok: #3E8E2B;
  --blu-provvisorio: #1F6FD1;
  --raggio: 18px;
  --ombra: 0 1px 2px rgba(27, 31, 94, .06), 0 8px 24px rgba(27, 31, 94, .08);
  --font: 'Bricolage', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--testo); background: var(--carta);
  font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cielo); outline-offset: 2px; border-radius: 8px; }
a { color: var(--inchiostro-2); }
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.nascosto, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--inchiostro); color: #fff; font-weight: 650; font-size: 1rem;
  transition: transform .12s ease, background .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.secondario { background: #fff; color: var(--inchiostro); box-shadow: inset 0 0 0 2px var(--linea); }
.btn.arancio { background: var(--arancio); }
.btn.foglia { background: var(--ok); }
.btn.pericolo { background: var(--rosso); }
.btn.piccolo { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn.pieno { width: 100%; }

/* Campi */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span { font-size: .9rem; font-weight: 600; color: var(--testo-2); }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px;
  border: 2px solid var(--linea); background: #fff; font-size: 1.05rem;
}
.campo textarea { min-height: 96px; resize: vertical; }
.campo input[type=checkbox], .campo input[type=radio] { width: auto; min-height: 0; padding: 0; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--cielo); }
.riga-campi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Avvisi a comparsa */
#avviso {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%);
  background: var(--inchiostro); color: #fff; padding: 14px 20px; border-radius: 16px; max-width: min(92vw, 520px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .3s cubic-bezier(.2,.9,.3,1.2), visibility .3s; z-index: 100; font-weight: 550;
  visibility: hidden;
}
#avviso.visibile { transform: translate(-50%, 0); visibility: visible; }
#avviso.errore { background: var(--rosso); }

/* Splash con il logo */
#splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #fff;
  transition: opacity .45s ease, visibility .45s;
}
#splash.via { opacity: 0; visibility: hidden; }
#splash .marchio { display: grid; justify-items: center; gap: 18px; }
#splash img { width: 168px; height: auto; animation: entra-logo .9s cubic-bezier(.2,.9,.25,1.15) both; }
#splash .nome { font-weight: 750; font-size: 1.6rem; color: var(--inchiostro); animation: sale .6s .35s ease both; }
#splash .servizio { color: var(--testo-2); font-size: 1.05rem; margin-top: -12px; animation: sale .6s .5s ease both; }
#splash .barra { display: flex; gap: 6px; margin-top: 10px; }
#splash .barra i { width: 26px; height: 6px; border-radius: 6px; animation: pulsa 1.2s ease-in-out infinite; }
#splash .barra i:nth-child(1) { background: var(--cielo); }
#splash .barra i:nth-child(2) { background: var(--foglia); animation-delay: .12s; }
#splash .barra i:nth-child(3) { background: var(--sole); animation-delay: .24s; }
#splash .barra i:nth-child(4) { background: var(--arancio); animation-delay: .36s; }
@keyframes entra-logo { from { transform: scale(.4) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sale { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulsa { 0%, 100% { transform: scaleX(.5); opacity: .5; } 50% { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
