/* Stile minimo del template: sostituiscilo con quello del progetto. */

:root {
  --text: #1c2430;
  --muted: #5b6675;
  --bg: #ffffff;
  --surface: #f4f6f8;
  --border: #d5dbe2;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --error: #b3261e;
  --success: #1b6e3c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

h1 {
  line-height: 1.2;
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
}

code {
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

/* Intestazione e piè di pagina */

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Pulsanti */

.button {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.1);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Form */

.form {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.5rem;
  justify-items: start;
}

.field {
  width: 100%;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: var(--bg);
}

input:focus-visible,
textarea:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  margin: 0.3rem 0 0;
  color: var(--error);
  font-size: 0.9rem;
}

.field-error:empty {
  display: none;
}

.form-status {
  margin: 0;
  font-weight: 600;
}

.form-status:empty {
  display: none;
}

.form-status[data-state="success"] {
  color: var(--success);
}

.form-status[data-state="error"] {
  color: var(--error);
}

/* Campo trappola per i bot: fuori schermo, non display:none
   (alcuni bot ignorano i campi con display:none). */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
