/* Base layout */
body {
  font-family: 'Open Sans', sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100;
  background: #f7f7f7;
  margin: 0;
  padding: 0;
  color: #333;
}
.container {
  max-width: 900px;
  margin: 28px auto;
  background: #fff;
  padding: 28px 28px;
  border-radius: 12px;
  box-shadow: 0 6px 26px rgba(0,0,0,0.08);
}
@media(max-width:1024px){
  .container{ margin:0 auto; }
}
h1 {
  margin-top: 0;
  color: #222;
}
.razionale {
  background: #fbfcfd;
  border: 1px solid #eef3f6;
  padding: 16px 18px;
  border-radius: 10px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
}

.info-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: #eaf7ee; /* light green */
  color: #1b6b3a; /* darker green for the symbol */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 6px 5px rgba(26, 115, 69, 0.06);
  position: absolute;
  top: -30px;
  left: 0;
}

.razionale-content {
  margin-top: 30px;
}

.intro { margin: 4px 0 18px 0; color: #555; font-style: italic; }
hr { border: none; border-top: 1px solid #eee; margin: 24px 0; }

/* Legend / Scale */
.legend {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.scale-item {
  background: #fbfcfd;
  border: 1px solid #eef3f6;
  padding: 12px;
  border-radius: 8px;
}
.scale-head {
  display:flex;
  align-items:baseline;
  gap:10px;
}
.scale-number {
  display:inline-block;
  min-width:36px;
  height:36px;
  line-height:36px;
  text-align:center;
  border-radius:8px;
  font-weight:700;
  color:#fff;
  background:#2980b9;
  box-shadow: 0 2px 6px rgba(41,128,185,0.12);
  font-size: 14px;
}
.scale-title { font-weight:700; color:#222; font-size:13px }
.scale-desc { margin-top:6px; color:#444; font-size:12px; line-height:1.4 }

/* color variants */
.scale-number.red { background:#e74c3c }
.scale-number.orange { background:#f39c12 }
.scale-number.green { background:#27ae60 }

@media(min-width:768px){
  /* Show legend as 3 columns on wider screens */
  .legend { grid-template-columns: repeat(3, 1fr); }
}

/* Form */
label { font-weight:700; display:block; margin:0 0 6px 0; color:#333 }
.form-grid { display:flex; flex-direction:column; gap:24px 14px}
.field { display:flex; flex-direction:column }

input[type="text"], input[type="email"], input[type="tel"], select {
  width:100%;
  padding:10px 12px;
  border:1px solid #d0d7de;
  border-radius:8px;
  background:#fafafa;
  font-size:15px;
  box-sizing:border-box;
}
input:focus, select:focus { outline:none; border-color:#2980b9; box-shadow:0 0 0 4px rgba(41,128,185,0.06) }

@media(min-width:768px){
  .form-grid{ flex-direction:row; flex-wrap:wrap }
  .field{ flex:1 1 48%; min-width:220px }
  /* button[type="submit"]{ width:auto } */
}

/* Questions */
.questions{ margin-top:26px }
.question-block{ margin-bottom:22px; padding:12px; border-radius:10px; background:#fbfcfd; border:1px solid #f0f3f6 }
.question-title{ margin:0 0 6px 0; font-size:16px; color:#222 }
.question-text{ margin:0 0 20px 0; color:#444 }

.answers{ display:flex; gap:8px }
.answer-box{
  flex:1 1 0; min-width:34px; height:44px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-weight:700; font-size:15px; border:2px solid transparent; transition:border .18s, transform .12s, color .18s, box-shadow .18s; user-select:none; box-sizing:border-box;
}
.answer-box.red{ background:#e74c3c; color:#fff }
.answer-box.orange{ background:#f39c12; color:#fff }
.answer-box.green{ background:#27ae60; color:#fff }
.answer-box.selected{
  border:4px solid rgba(0,0,0,0.28);
  transform:translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  /* make the number visually grayer */
  color: #333;
}

/* Small tweaks */
@media(max-width:480px){ .container{ padding:20px } .answers{ gap:6px } }

/* Form-level transient message shown above submit */
.form-message{
  display:none;
  background: #fdecea; /* light red */
  border: 1px solid #f5c2c0;
  color: #6b1616;
  padding: 10px 12px 10px 44px; /* space for icon */
  border-radius:8px;
  margin-top:12px;
  font-size:14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
}
.form-message::before{
  content: '⚠';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #b71c1c; /* warning red */
  font-size:18px;
  line-height:1;
}
.form-message.visible{ display:block; }

button[type="submit"] {
  width: 100%;
  padding: 12px 32px;
  background: rgb(0, 125, 87);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.18s, transform 0.12s;
}
button[type="submit"]:hover {
  background: rgb(0, 80, 56);
}

button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: grayscale(6%);
  transform: translateY(0);
  background: rgb(140, 184, 164);
}

/* Simple spinner for buttons */
.btn-spinner{
  display:inline-block;
  width:18px;
  height:18px;
  border:2px solid rgba(255,255,255,0.4);
  border-top-color: #ffffff;
  border-radius:50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin{ to { transform: rotate(360deg); } }