/* ReceTap — stile Aurora Glass (condiviso da pannello e dashboard) */

@font-face { font-family: Inter; src: url(/assets/fonts/inter-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/fonts/inter-500.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/fonts/inter-600.woff) format("woff"); font-weight: 600; font-display: swap; }

:root {
  --bg: #08081A;
  --viola: #7C5CFF;
  --ciano: #22D3EE;
  --magenta: #FF4FD8;
  --testo: #FFFFFF;
  --testo-2: rgba(255, 255, 255, 0.8);
  --testo-3: rgba(255, 255, 255, 0.72);
  --vetro: rgba(255, 255, 255, 0.08);
  --vetro-forte: rgba(255, 255, 255, 0.14);
  --bordo: rgba(255, 255, 255, 0.2);
  --bordo-forte: rgba(255, 255, 255, 0.3);
  --campo: rgba(8, 8, 26, 0.5);
  --ok: #4ADE80;
  --ok-testo: #86EFAC;
  --warn: #FCD34D;
  --err: #FCA5A5;
  --link: #A5F3FC;
  --raggio: 24px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--testo);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); }
a:hover { color: #fff; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Aurora di sfondo */
.aurora { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(120px); will-change: transform; }
.aurora i:nth-child(1) { left: -180px; top: -160px; width: 560px; height: 560px; background: var(--viola); opacity: 0.45; animation: au-1 20s ease-in-out infinite; }
.aurora i:nth-child(2) { right: -220px; top: 30%; width: 520px; height: 520px; background: var(--ciano); opacity: 0.28; animation: au-2 24s ease-in-out infinite; }
.aurora i:nth-child(3) { left: 20%; bottom: -280px; width: 520px; height: 520px; background: var(--magenta); opacity: 0.2; animation: au-1 28s ease-in-out infinite reverse; }
@keyframes au-1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(120px, 80px) scale(1.12); } }
@keyframes au-2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-120px, 60px); } }

.pagina { position: relative; z-index: 1; }

/* Vetro */
.vetro {
  background: var(--vetro);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

/* Modalità leggera per telefoni lenti: niente sfocature pesanti */
.lite .aurora i { filter: blur(70px); animation: none; }
.lite .vetro, .lite .modale-box, .lite .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28, 26, 58, 0.92); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Testi */
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.muto { color: var(--testo-3); }
.mono { font-family: var(--mono); }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--bordo-forte); background: var(--vetro);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .2s ease, opacity .2s ease;
}
.btn:hover { background: var(--vetro-forte); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primario { background: #fff; color: var(--bg); border-color: #fff; }
.btn-primario:hover { background: #eceafd; color: var(--bg); }
.btn-accento { background: var(--viola); border-color: var(--viola); }
.btn-accento:hover { background: #8d71ff; }
.btn-whatsapp { background: #25D366; border-color: #25D366; color: #052e16; }
.btn-whatsapp:hover { background: #3ee07a; color: #052e16; }
.btn-tratteggiato { border-style: dashed; border-color: rgba(255, 255, 255, 0.4); background: transparent; font-weight: 500; }
.btn-piccolo { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-largo { width: 100%; }
.btn-icona { width: 44px; padding: 0; }

/* Campi */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; color: var(--testo-2); }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: var(--campo); color: #fff; font-size: 16px; outline: none;
}
.campo textarea { padding: 12px 14px; min-height: 92px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.campo input:focus, .campo textarea:focus, .campo select:focus { border-color: rgba(165, 140, 255, 0.9); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.3); }
.campo .aiuto { font-size: 12px; color: var(--testo-3); }
.campo select option { background: #15142e; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge-ok { color: var(--ok-testo); background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.4); }
.badge-warn { color: var(--warn); background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.45); }
.badge-info { color: var(--link); background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.4); }
.badge-err { color: var(--err); background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); }
.badge-neutro { color: var(--testo-2); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--bordo); }

/* Avvisi */
.avviso { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.avviso p { margin: 0; }
.avviso-warn { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.45); }
.avviso-info { background: rgba(124, 92, 255, 0.18); border: 1px solid rgba(165, 140, 255, 0.45); }
.avviso-err { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.45); }
.avviso-ok { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.4); }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 16px; background: rgba(30, 28, 64, 0.85); border: 1px solid var(--bordo-forte); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 14px; font-weight: 500; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); animation: toast-in .3s ease-out both; }
.toast-err { border-color: rgba(248, 113, 113, 0.6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Modale */
.modale { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(4, 4, 14, 0.6); animation: fade .2s ease-out both; }
@media (min-width: 640px) { .modale { align-items: center; } }
.modale-box { width: min(100%, 440px); border-radius: 26px; padding: 22px; background: rgba(28, 26, 58, 0.85); border: 1px solid var(--bordo-forte); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); display: flex; flex-direction: column; gap: 14px; animation: toast-in .25s ease-out both; }
.modale-box h2 { font-size: 19px; }
.modale-box p { margin: 0; color: var(--testo-2); line-height: 1.5; }
.modale-azioni { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Scheletri di caricamento */
.scheletro { background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
