:root {
  color-scheme: light;
  --navy: #102648;
  --ink: #172941;
  --muted: #4B5E76;
  --blue: #005795;
  --border: #D4DFEA;
  --page: #EEF3F8;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

p, h1, h2, ol { margin: 0; }
.muted { color: var(--muted); font-size: .9375rem; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.masthead { background: white; }
.branding { display: flex; align-items: center; gap: .875rem; padding-block: .875rem; }
.branding img { object-fit: contain; flex: none; }
.brand-name { font-weight: 750; color: var(--navy); font-size: 1.075rem; }
.brand-unit { color: var(--muted); font-size: .9375rem; }

.intro {
  background: radial-gradient(ellipse at 93% 20%, #245082, transparent 62%), var(--navy);
  color: white;
  border-bottom: 4px solid #4295CF;
}

.intro-content { padding-block: 2rem 2.2rem; }

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -.042em;
}

.intro p { color: #E5F0FA; font-size: clamp(1rem, 1.6vw, 1.1875rem); margin-top: .65rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.96fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding-block: 1.4rem 2.75rem;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 5px 16px #11284008;
  padding: clamp(1rem, 2.5vw, 1.75rem);
}

h2 { color: var(--navy); font-size: 1.375rem; line-height: 1.25; letter-spacing: -.02em; }
.hint-top { margin-top: .3rem; margin-bottom: 1.1rem; }
.fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .85rem .75rem; }
.field { display: grid; align-content: start; gap: .27rem; min-width: 0; }
.field label { color: var(--ink); font-size: .9375rem; font-weight: 650; }
.field label span { color: var(--blue); }
.full { grid-column: 1 / -1; }
.half { grid-column: span 6; }
.luogo { grid-column: span 5; }
.provincia { grid-column: span 3; }
.data-nascita { grid-column: span 4; }

.field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.875rem;
  font: inherit;
  border: 1px solid #9DACBE;
  border-radius: .5rem;
  background-color: #F7FAFD;
  color: var(--ink);
  padding: .56rem .72rem;
}

.field input::placeholder { color: #576B82; }
small { font-size: .8125rem; color: var(--muted); }
:focus-visible { outline: 3px solid #217EBB; outline-offset: 3px; }

details {
  border: 1px solid var(--border);
  border-radius: .55rem;
  margin-top: .7rem;
}

.fields + details { margin-top: 1.15rem; }
summary { padding: .72rem .8rem; color: var(--navy); cursor: pointer; font-weight: 650; font-size: .9375rem; }
summary:hover { background-color: #F1F6FA; border-radius: .55rem; }
.details-body { padding: .2rem .85rem .85rem; }
.choices { display: grid; gap: .65rem; font-size: .9375rem; }
.choices label { display: flex; align-items: flex-start; gap: .55rem; }
.choices input { flex: none; margin: .25rem 0 0; width: 1rem; height: 1rem; accent-color: var(--blue); }
.choices fieldset { margin: 0; padding: .3rem .6rem .55rem; border: 1px solid var(--border); border-radius: .45rem; }
.choices legend { padding-inline: .2rem; font-weight: 650; }
.channels { display: flex; flex-wrap: wrap; gap: .4rem .8rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; margin-top: 1.1rem; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  min-height: 3rem;
  padding: .65rem .95rem;
  background: var(--blue);
  border: 1px solid transparent;
  border-radius: .55rem;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:not(:disabled):hover { background: #004572; }
button:disabled { opacity: .7; cursor: default; }
.error, .success { padding: .8rem .9rem; margin-top: 1rem; border: 1px solid; border-radius: .55rem; }
.error { background: #FFF4F4; color: #831818; border-color: #E3B0B0; }
.success { background: #EFF8F3; color: #18492F; border-color: #A7CCB7; }
.success a { display: inline-block; margin-top: .3rem; color: inherit; font-weight: 650; }

.document {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1.35rem;
  padding: .8rem .9rem;
  border: 1px solid #DBE8F4;
  border-radius: .7rem;
  color: var(--navy);
  background: #EDF5FC;
}

.document svg { flex: none; color: var(--blue); }
.document .muted { font-size: .875rem; }
.instructions ol { margin-top: .85rem; padding-left: 1.25rem; }
.instructions li { color: var(--muted); padding-left: .18rem; margin-top: .65rem; font-size: .9375rem; }
.instructions li strong { color: var(--ink); }
.instructions li::marker { color: var(--blue); font-weight: 750; }

@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: .9rem; }
  .wrap { width: min(100% - 36px, 1120px); }
  .luogo { grid-column: span 8; }
  .provincia { grid-column: span 4; }
  .data-nascita { grid-column: 1 / -1; }
}

@media (max-width: 670px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .intro-content { padding-block: 1.6rem; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 24px); }
  .branding img { width: 48px; height: 48px; }
  .half { grid-column: 1 / -1; }
  .actions button { width: 100%; }
}
