/* assets/css/app.css — Variables, reset, global layout */

/* Urbanist self-hosted (scaricato da Google Fonts) */
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/Urbanist-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/Urbanist-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/Urbanist-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/Urbanist-Bold.woff2') format('woff2');
}

:root {
  --color-primary: #6F7CDE;
  --color-primary-light: #8B96E9;
  --color-warm: #FD933E;
  --color-accent: #DC6FDE;
  --color-info: #39BCF9;

  --color-phe-safe: #4ADE80;
  --color-phe-warn: #FBBF24;
  --color-phe-danger: #F87171;

  --color-bg-start: #F0F0FF;
  --color-bg-end: #E8FFF0;
  --color-card: rgba(255, 255, 255, 0.72);
  --color-card-border: rgba(0, 0, 0, 0.06);
  --color-text: #1E293B;
  --color-text-light: #64748B;
  --color-white: #FFFFFF;

  --font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end));
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* View container — solo opacity, nessun transform per non rompere position:fixed dei figli */
.view {
  animation: viewEnter 0.3s ease both;
}

@keyframes viewEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(111, 124, 222, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(111, 124, 222, 0); }
}

/* Staggered children animation */
.stagger > * {
  animation: slideInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }
.stagger > *:nth-child(7) { animation-delay: 0.28s; }
.stagger > *:nth-child(8) { animation-delay: 0.32s; }

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
.text-light { color: var(--color-text-light); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.25rem; }
.text-xl { font-size: 1.5rem; }
.text-2xl { font-size: 2rem; font-weight: 700; }

/* Utility */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }

/* Smooth transitions for interactive elements */
a, button, input, select, textarea {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
