/* Reset CSS */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

ul, ol {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Imposta il colore di sfondo per tutto il documento */
html {
  background-color: #f3f7fb;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  scroll-behavior: smooth;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: #f3f7fb;
  width: 100%;
  margin: 0;
  box-shadow: none;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  overflow-x: hidden; /* Prevent horizontal scrolling / Previeni lo scroll orizzontale */
}

/* Container per desktop - Container for desktop */
@media (min-width: 1200px) {
  body {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Remove list styles on ul, ol elements */
ul,
ol {
  list-style: none;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
textarea,
select {
  outline: none;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
}

/* Mobile optimizations / Ottimizzazioni mobile */
@media (max-width: 768px) {
  body {
    padding-left: 10px;  /* Reduce padding on mobile devices / Riduci padding sui dispositivi mobile */
    padding-right: 10px;
  }
  
  /* Prevent zoom on input focus / Previeni zoom al focus degli input */
  /* iOS Safari fa zoom automatico se font-size < 16px */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  body {
    padding-left: 5px;   /* Minimal padding on very small devices / Padding minimale sui dispositivi molto piccoli */
    padding-right: 5px;
  }
  
  /* Prevent zoom on input focus / Previeni zoom al focus degli input */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }
}


/* Links */
a:hover {
  text-decoration: underline;
}

/* Form elements */
input,
textarea,
select {
  outline: none;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
} 