/* Adhesion and contact forms */
.cer-form { margin-top: 36px; max-width: 760px; }
.cer-form.simple { margin-top: 0; }
.cer-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cer-form legend { padding: 0; font: 600 24px/1.2 "DM Sans", sans-serif; color: var(--navy); margin-bottom: 18px; }
.cer-form legend.mt { margin-top: 34px; }
.cer-form .sub { font: 600 17px "Inter", sans-serif; color: var(--green); margin: 28px 0 12px; }
.cer-form .sub.first { margin-top: 0; }
.cer-form .hint { font-size: 14px; color: #6b7a81; margin: 4px 0 16px; }
.cer-form .hint a { color: var(--green); }

/* progress */
.progress ol { display: flex; justify-content: space-between; list-style: none; padding: 0; margin: 0 0 10px; counter-reset: s; }
.progress li { counter-increment: s; font-size: 13px; color: #8a979d; display: flex; align-items: center; gap: 6px; }
.progress li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid #9aa8ae; font-size: 13px; color: #55646b; background: #fff;
}
.progress li.done::before { content: "✓"; background: var(--green-2); border-color: var(--green-2); color: #fff; }
.progress li.now { color: var(--navy); font-weight: 600; }
.progress li.now::before { border-color: var(--yellow); color: #b07c00; }
.progress-bar { height: 4px; background: #e5edf0; border-radius: 4px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--green-2); transition: width .3s ease; }
.progress-text { display: none; font-size: 14px; color: var(--navy); font-weight: 600; margin: 10px 0 0; }
.progress + .progress-text { margin-bottom: 26px; }

/* fields */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid .wide { grid-column: 1 / -1; }
.grid:has(> .small) { grid-template-columns: 1fr 1fr 150px; }
.grid:has(> .small) > .f:not(.grow):not(.small):not(.wide) { grid-column: span 1; }
.grid .grow { grid-column: span 2; }
.f label { display: block; font-size: 14px; font-weight: 500; color: #33444c; margin-bottom: 6px; }
.f label i { font-style: normal; font-weight: 400; color: #7a8a91; }
.f input, .f textarea, .f select {
  width: 100%; min-height: 50px; padding: 12px 14px; font: 400 16px/1.3 "Inter", sans-serif; color: #1f2a30;
  background: #fff; border: 1px solid #a9bfc9; border-radius: 10px; appearance: none;
}
.f textarea { min-height: 120px; resize: vertical; }
.f input::placeholder { color: #a3b0b6; }
.f input:focus, .f textarea:focus { outline: 3px solid rgba(0,166,81,.25); border-color: var(--green-2); }
.f.bad input, .f.bad textarea { border-color: var(--red); }
.f .msg { display: block; font-size: 13px; color: var(--red); margin-top: 5px; }
.err { color: var(--red); font-size: 14px; margin: 8px 0 0; min-height: 0; }
.err:empty { display: none; }

/* big choice cards */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 16px 16px 46px; position: relative;
  border: 1.5px solid #c3d3da; border-radius: 12px; background: #fff; transition: border-color .15s, background .15s;
}
.choice span::before {
  content: ""; position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #9aa8ae; background: #fff;
}
.choice b { color: var(--navy); font-size: 16px; }
.choice small { color: #6b7a81; font-size: 13px; }
.choice input:checked + span { border-color: var(--green-2); background: #f1faf4; }
.choice input:checked + span::before { border: 6px solid var(--green-2); }
.choice input:focus-visible + span { outline: 3px solid rgba(0,166,81,.3); }

/* uploads */
.upload { margin-bottom: 14px; }
.upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload label {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 16px 58px; position: relative; cursor: pointer;
  border: 1.5px dashed #8aa7b4; border-radius: 12px; background: #fff;
}
.upload label::before {
  content: "+"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--green-2); color: #fff;
  display: grid; place-items: center; font: 600 20px/1 "Inter";
}
.upload label b { color: var(--navy); }
.upload label span { font-size: 13px; color: #6b7a81; }
.upload input:focus-visible + label { outline: 3px solid rgba(0,166,81,.3); }
.upload.has-files label { border-style: solid; border-color: var(--green-2); background: #f1faf4; }
.files { list-style: none; padding: 0; margin: 8px 0 0; }
.files li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; padding: 6px 4px; border-bottom: 1px solid #edf1f3; }
.files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files button { border: 0; background: none; color: var(--red); font-size: 13px; cursor: pointer; padding: 4px; }

/* declarations */
.check-all {
  width: 100%; margin: 0 0 12px; padding: 13px 14px; border: 1.5px dashed var(--green-2); border-radius: 10px;
  background: #fff; color: var(--green); font: 600 15px "Inter", sans-serif; cursor: pointer;
}
.check { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  border: 1px solid #d5e2e8; border-radius: 10px; background: #fff; font-size: 15px; line-height: 1.45; color: #33444c; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green-2); }
.check:has(input:checked) { border-color: var(--green-2); background: #f1faf4; }
.check a { color: var(--green); }
.check.plain { border: 0; padding: 4px 0; background: none; }
.check.plain:has(input:checked) { background: none; }
.check.gdpr { margin-top: 18px; }

/* recap + signature */
.recap { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 24px; padding: 16px 18px; background: #f6f9fa; border-radius: 12px; font-size: 14px; }
.recap dt { color: #6b7a81; }
.recap dd { margin: 0; color: #1f2a30; overflow-wrap: anywhere; }
.recap .edit { grid-column: 1 / -1; text-align: right; }
.recap .edit button { border: 0; background: none; color: var(--green); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }
.sign-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--navy); }
.sign-clear { border: 1px solid #c3d3da; background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.sign-pad { overscroll-behavior: contain; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; display: block; width: 100%; height: 200px; border: 1.5px solid #a9bfc9; border-radius: 12px; background: #f6f6f6; touch-action: none; cursor: crosshair; }
.sign.bad .sign-pad { border-color: var(--red); }
.recaptcha-note { font-size: 12px; color: #7a8a91; margin-top: 18px; }
.recaptcha-note a { color: inherit; }
.grecaptcha-badge { visibility: hidden; }

/* nav buttons */
.form-nav { display: flex; gap: 12px; margin-top: 28px; }
.form-nav .btn { flex: 1; min-height: 58px; font-size: 18px; border-radius: 10px; }
.form-nav .back { flex: 0 0 auto; background: #fff; color: var(--navy); border: 1.5px solid #c3d3da; padding-inline: 22px; }
.form-nav .btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.simple .send { width: 100%; min-height: 50px; margin-top: 8px; border-radius: 4px; }
.simple .f { margin-bottom: 16px; }
.form-msg:empty { display: none; }
.form-msg { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 15px; background: #fdecea; color: #8a1f0c; }
.form-msg.ok { background: #e9f7ef; color: #155c34; }
.form-done { margin-top: 36px; padding: 28px; border-radius: 14px; background: #e9f7ef; max-width: 760px; }
.form-done h4 { font: 600 24px "DM Sans", sans-serif; color: var(--green); margin-bottom: 10px; }
.form-done .btn { margin-top: 8px; }

@media (max-width: 700px) {
  .progress ol { display: none; }
  .progress-text { display: block; }
  .grid, .grid.three, .grid:has(> .small) { grid-template-columns: 1fr; }
  .grid .grow { grid-column: auto; }
  .grid .small { max-width: 50%; }
  .choices, .choices.three { grid-template-columns: 1fr; }
  .recap { grid-template-columns: 1fr; gap: 2px; }
  .recap dd { margin-bottom: 8px; }
  .form-nav { position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%); padding: 18px 0 12px; margin-top: 12px; z-index: 5; }
}


/* desktop: the adhesion form uses the full step column, like the FAQ above it */
@media (min-width: 701px) {
  #adesione, #adesione ~ .form-done { max-width: none; }
  #adesione .progress { margin-bottom: 40px; }
  #adesione .progress ol { margin-bottom: 14px; }
  #adesione .progress li { font-size: 15px; gap: 8px; }
  #adesione .progress li::before { width: 32px; height: 32px; font-size: 14px; }
  #adesione .progress-bar { height: 6px; }
  .choice span { padding: 22px 22px 22px 56px; gap: 6px; }
  .choice span::before { left: 22px; top: 24px; width: 20px; height: 20px; }
  .choice b { font-size: 18px; }
  .choice small { font-size: 14px; }
  #adesione .form-nav { justify-content: flex-end; }
  #adesione .form-nav .back { margin-right: auto; }
  #adesione .form-nav .btn:not(.back) { flex: 0 1 340px; }
}

/* hover on choice cards and checkbox rows (mouse only; checked state stays stronger) */
@media (hover: hover) {
  .choice:hover input:not(:checked) + span { border-color: #7fcf9f; background: #f7fcf9; box-shadow: 0 4px 14px rgba(0,114,62,.08); }
  .choice:hover input:not(:checked) + span::before { border-color: var(--green-2); }
  .check:not(.plain):hover:not(:has(input:checked)) { border-color: #7fcf9f; background: #f7fcf9; }
  .check-all:hover { background: #f1faf4; }
}
.choice span { transition: border-color .15s, background .15s, box-shadow .15s; }

/* conversational screens: one question, one line of context */
.cer-form .fstep > legend { font-size: 28px; margin-bottom: 8px; }
.cer-form .lead { font-size: 16px; color: #55646b; margin: 0 0 22px; max-width: 640px; }
.cer-form .fstep > legend + .choices, .cer-form .fstep > legend + .grid, .cer-form .fstep > legend + .grid.three { margin-top: 22px; }
.fstep.enter { animation: fstep-in .28s ease-out; }
@keyframes fstep-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fstep.enter { animation: none; } }
@media (max-width: 700px) { .cer-form .fstep > legend { font-size: 24px; } }
