:root{
  --bmaq-primary:#5196c7;
  --bmaq-text:#716461;
  --bmaq-gray-light:#f1eeed;
  --bmaq-gray-dark:#a6a6a6;
  --bmaq-radius:10px;
}

.bmaq-wrap{
  max-width:1200px;
  margin:0 auto;
  padding:24px 16px 170px;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--bmaq-text);
}

/* Ensure consistent sizing (prevents overflow on inputs inside grids) */
.bmaq-wrap *,
.bmaq-wrap *::before,
.bmaq-wrap *::after{
  box-sizing:border-box;
}

.bmaq-header{margin-bottom:18px}
.bmaq-header-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.bmaq-header-actions{margin-top:2px}
.bmaq-title{margin:0 0 8px;font-size:28px;line-height:1.2}
.bmaq-intro{margin:0 0 12px;color:var(--bmaq-text)}

/* Istruzioni (ex legenda) */
.bmaq-legend{margin:12px 0 14px}
.bmaq-legend-card{
  background:var(--bmaq-gray-light);
  border:1px solid var(--bmaq-gray-dark);
  border-radius:var(--bmaq-radius);
  padding:14px 14px;
}
.bmaq-legend-title{font-weight:800;font-size:14px;margin:0 0 8px}
.bmaq-legend-lead{margin:0 0 10px;font-weight:600}
.bmaq-legend-important{font-weight:900;margin:12px 0 6px}
.bmaq-legend-subtitle{font-weight:800;margin:12px 0 6px}
.bmaq-legend-card p{margin:0 0 8px;line-height:1.45}
.bmaq-legend-list{margin:6px 0 10px 18px}
.bmaq-legend-list li{margin:4px 0;line-height:1.4}
.bmaq-legend-link{font-weight:600;text-decoration:underline}

/* Progress: riempie tutta la larghezza su più righe */
.bmaq-progress{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:14px 0;
}
.bmaq-progress a{
  flex:1 1 220px;
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
  padding:10px 12px;
  border:1px solid var(--bmaq-gray-dark);
  border-radius:999px;
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
  text-decoration:none;
  font-size:14px;
  line-height:1.2;
}

/* Section senza bordo */
.bmaq-section{margin:18px 0}

/* Header sezione: blu, testo bianco, radius 10, icona a sinistra */
.bmaq-section-header{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--bmaq-primary);
  color:#fff;
  padding:12px 14px;
  border-radius:var(--bmaq-radius);
}
.bmaq-section-title{
  margin:0;
  font-size:18px;
  font-weight:700;
  color:#fff;
}

/* Small subtitle under section title (in header) */
.bmaq-section-subtitle{
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  margin-top: 4px;
  line-height: 1.25;
}

.bmaq-subsection{
  margin: 18px 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f3f4f6;
  font-weight: 700;
}

.bmaq-subsection-minor{
  margin: 10px 0 6px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
}

/* NOTE: removed old in-body subtitle/note blocks for the structure section */
.bmaq-note-block{ display:none; }

/* Months selector (max 3) */
.bmaq-months-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bmaq-month-item{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.bmaq-month-item input{margin:0}
.bmaq-month-item input:disabled + span{opacity:.55}
.bmaq-section-icon{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 28px;
}
.bmaq-section-icon img{width:100%;height:100%;display:block}

/* Dati generali: descrizione a sinistra, campo a destra */
.bmaq-field{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid rgba(0,0,0,0.04);
}

/* Percent sub-questions grouped under a single question: no divider except last */
.bmaq-field--grouped{ border-bottom: none; padding-bottom: 8px; }
.bmaq-field--group-last{ border-bottom:1px solid rgba(0,0,0,0.04); padding-bottom:10px; }
@media (max-width:720px){
  .bmaq-field{grid-template-columns:1fr}
}
.bmaq-label{
  font-weight:600;
  color:var(--bmaq-text);
}

/* Error row should not create a third column overflow */
.bmaq-field .bmaq-error{
  grid-column:1 / -1;
}

/* Input e select */
.bmaq-control input[type="text"],
.bmaq-control select{
  width:100%;
  max-width:100%;
  padding:10px 12px;
  border:1px solid var(--bmaq-gray-dark);
  border-radius:8px;
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
  font-size:15px;
}
.bmaq-control input[type="text"]::placeholder{color:var(--bmaq-gray-dark)}
.bmaq-control select:invalid{color:var(--bmaq-gray-dark)}

/* Domande */
.bmaq-question{padding:32px 0;border-bottom:1px solid var(--bmaq-gray-dark)}
.bmaq-question-top{display:flex;justify-content:space-between;gap:12px}
@media (max-width:720px){
  .bmaq-question-top{flex-direction:column}
}
.bmaq-question-text{
  font-weight:600;
  color:var(--bmaq-text);
  font-size:15px;
  line-height:1.35;
}

/* Radio: più grandi, circolari, bordo grigio scuro, sfondo grigio chiaro, allineati */
.bmaq-question-controls{
  display:flex;
  align-items:center;
  gap:10px;
}
.bmaq-question-controls input[type="radio"]{
  -webkit-appearance:none;
  appearance:none;
  width:22px;
  height:22px;
  border:2px solid var(--bmaq-gray-dark);
  border-radius:50%;
  background:var(--bmaq-gray-light);
  display:inline-grid;
  place-content:center;
  vertical-align:middle;
  margin:0;
}
.bmaq-question-controls input[type="radio"]::before{
  content:"";
  width:12px;
  height:12px;
  border-radius:50%;
  transform:scale(0);
  transition:transform .12s ease-in-out;
  background:var(--bmaq-primary);
}
.bmaq-question-controls input[type="radio"]:checked::before{transform:scale(1)}
.bmaq-question-controls label{
  margin-right:10px;
  color:var(--bmaq-text);
  font-weight:600;
}

/* Evidenze: sempre visibili sotto la domanda */
.bmaq-evidence{margin-top:10px}
.bmaq-evidence-help{
  margin-top:8px;
  padding:10px 12px;
  background:var(--bmaq-gray-light);
  border-left:4px solid var(--bmaq-primary);
  border-radius:8px;
  color:var(--bmaq-text);
  font-size:13px;
}

/* Evidence block hidden by default; shown only when user selects SI */
.bmaq-evidence{display:none}
.bmaq-evidence.is-visible{display:block}

/* Upload */
.bmaq-evidence-upload{margin-top:10px}
.bmaq-evidence-upload.is-disabled{opacity:.55;pointer-events:none}
.bmaq-upload-hint{font-size:12px;color:var(--bmaq-gray-dark);margin-bottom:8px}
/* Since evidence block is shown only when SI, the hint is not necessary */
.bmaq-upload-hint{display:none}
.bmaq-dropzone{
  border:2px dashed var(--bmaq-gray-dark);
  border-radius:10px;
  padding:14px;
  background:#fff;
  color:var(--bmaq-text);
  cursor:pointer;
}
.bmaq-dropzone-inner{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.bmaq-dropzone-text{font-size:13px;color:var(--bmaq-text)}
.bmaq-file-btn{
  border-radius:999px;
  padding:8px 12px;
  font-weight:700;
  border:1px solid var(--bmaq-gray-dark);
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
  cursor:pointer;
}
.bmaq-dropzone:hover .bmaq-file-btn{transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,0,0,0.08)}
.bmaq-dropzone.is-drag .bmaq-file-btn{border-color:var(--bmaq-primary)}
.bmaq-dropzone.is-drag{border-color:var(--bmaq-primary)}
.bmaq-file-list{margin-top:10px}

/* Hide the native file input UI ("Scegli file" + "Nessun file selezionato").
   Keep it off-screen so JS input.click() still opens the dialog. */
.bmaq-file-input{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.bmaq-file-item{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.06);
  border-radius:10px;
  background:#fff;
  margin-top:8px;
}
.bmaq-file-item a{font-weight:700;color:var(--bmaq-text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60%}
.bmaq-file-item a:hover{text-decoration:underline}
.bmaq-file-meta{font-size:12px;color:var(--bmaq-gray-dark)}
.bmaq-file-del{
  border-radius:999px;
  padding:6px 10px;
  font-weight:700;
  border:1px solid rgba(192,57,43,0.35);
  background:rgba(192,57,43,0.08);
  color:#c0392b;
  cursor:pointer;
}
.bmaq-file-del:hover{filter:brightness(0.98)}
.bmaq-file-del:disabled{opacity:.55;cursor:not-allowed}

/* Errori in rosso */
.bmaq-error{color:#c0392b;font-size:13px;margin-top:6px}

/* Sticky footer con help sopra e bottoni centrati */
.bmaq-footer{
  position:fixed;
  left:0; right:0; bottom:0;
  background:#fff;
  border-top:1px solid rgba(0,0,0,0.08);
  z-index:9999;
}
.bmaq-sticky-inner{
  max-width:980px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}
.bmaq-sticky-help{
  font-size:13px;
  color:var(--bmaq-text);
  text-align:center;
}
.bmaq-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
  width:100%;
}
.bmaq-btn{
  border-radius:999px;
  padding:10px 16px;
  font-weight:700;
  border:1px solid var(--bmaq-gray-dark);
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.bmaq-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
}
.bmaq-btn:active{transform:translateY(0)}
.bmaq-btn-primary{
  background:var(--bmaq-primary);
  border-color:var(--bmaq-primary);
  color:#fff;
}

.bmaq-btn-ghost{
  background:transparent;
}

/* Autosave status: smaller, lighter, subtle */
.bmaq-autosave{
  font-size:12px;
  color:var(--bmaq-gray-dark);
  min-height:14px;
}

/* Login/Register cards (wp_login_form) */
.bmaq-card{
  border:1px solid rgba(0,0,0,0.06);
  border-radius:12px;
  padding:16px;
  background:#fff;
}
.bmaq-card label{color:var(--bmaq-text);font-weight:600}
.bmaq-card input[type="text"],
.bmaq-card input[type="password"],
.bmaq-card input[type="email"]{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--bmaq-gray-dark);
  border-radius:8px;
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
}

.bmaq-card input[type="text"]::placeholder,
.bmaq-card input[type="password"]::placeholder,
.bmaq-card input[type="email"]::placeholder{color:var(--bmaq-gray-dark)}

.bmaq-card .login-remember label{font-weight:600}

.bmaq-card .login-submit input[type="submit"],
.bmaq-card button[type="submit"]{
  appearance:none;
  border-radius:999px;
  padding:10px 16px;
  font-weight:700;
  border:1px solid var(--bmaq-primary);
  background:var(--bmaq-primary);
  color:#fff;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease;
}
.bmaq-card .login-submit input[type="submit"]:hover,
.bmaq-card button[type="submit"]:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
}

.bmaq-auth-links{
  margin-top:12px;
  display:flex;
  justify-content:center;
  gap:10px;
  color:var(--bmaq-gray-dark);
}
.bmaq-auth-links a{color:var(--bmaq-primary);font-weight:700;text-decoration:none}
.bmaq-auth-links a:hover{text-decoration:underline}
.bmaq-card input::placeholder{color:var(--bmaq-gray-dark)}
.bmaq-card .login-submit input{
  width:100%;
  border-radius:999px;
  padding:10px 16px;
  font-weight:800;
  border:1px solid var(--bmaq-primary);
  background:var(--bmaq-primary);
  color:#fff;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease;
}
.bmaq-card .login-submit input:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,0,0,0.08)}
.bmaq-auth-links{margin-top:12px;display:flex;gap:8px;justify-content:center;color:var(--bmaq-gray-dark)}
.bmaq-auth-links a{color:var(--bmaq-primary);text-decoration:none;font-weight:700}
.bmaq-auth-links a:hover{text-decoration:underline}

/* -------------------------
   Register / Login forms
-------------------------- */
.bmaq-card{
  background:#fff;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:var(--bmaq-radius);
  padding:18px 16px;
}

.bmaq-form-group{margin:14px 0}
.bmaq-form-label{display:block;font-weight:700;margin:0 0 8px}

.bmaq-form-row-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width:720px){
  .bmaq-form-row-2{grid-template-columns:1fr}
}

.bmaq-input{
  width:100%;
  max-width:100%;
  padding:10px 12px;
  border:1px solid var(--bmaq-gray-dark);
  border-radius:10px;
  background:var(--bmaq-gray-light);
  color:var(--bmaq-text);
  font-size:15px;
}
.bmaq-input::placeholder{color:var(--bmaq-gray-dark)}

.bmaq-help{margin:8px 0 0;color:var(--bmaq-gray-dark);font-size:13px}

.bmaq-error-box{
  background:#fff6f6;
  border:1px solid rgba(180,0,0,0.25);
  border-radius:var(--bmaq-radius);
  padding:12px 12px;
  margin:0 0 14px;
}
.bmaq-error-box ul{margin:0 0 0 18px}

.bmaq-actions{display:flex;align-items:center;gap:12px;margin-top:14px;flex-wrap:wrap}
.bmaq-btn{border:0;border-radius:999px;padding:10px 14px;font-weight:700;cursor:pointer}
.bmaq-btn-primary{background:var(--bmaq-primary);color:#fff}
.bmaq-link{text-decoration:underline;font-weight:600;color:var(--bmaq-text)}

/* Registration privacy checkbox */
.bmaq-checkbox{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.35}
.bmaq-checkbox input{margin-top:3px}
.bmaq-privacy-accept a{text-decoration:underline}

/* Submitted / reviewed confirmation screen */
.bmaq-confirm{ margin-top: 16px; }
.bmaq-confirm-title{ margin: 0 0 8px; font-size: 20px; }
.bmaq-confirm-text{ margin: 0; opacity: .92; }

/* Avviso termini di invio scaduti */
.bmaq-message-warning{
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #f0c36d;
  border-left-width: 4px;
  border-radius: var(--bmaq-radius);
  background: #fdf6e3;
  color: #8a6100;
  font-weight: 600;
}

/* Bottone di invio disattivato a termini chiusi */
.bmaq-btn-primary:disabled{
  opacity: .55;
  cursor: not-allowed;
}
