/* Compliance block — declarations the user must confirm before submitting.
 *
 * Lives inside the last form-section so it inherits the section's surface.
 * Light/dark mode are NOT driven by --theme-* variables here — those vars
 * are scoped to `.theme-modern` and the compliance block can render outside
 * that scope. Use explicit colours, then override at html.dark-mode.
 */

.compliance-block {
  margin: 32px 0 8px;
  padding: 22px 24px;
  border: 1px solid #d4d4d8;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2937;
}

.compliance-title {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.compliance-title i {
  color: #0ea5e9;
  font-size: 18px;
}

.compliance-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  cursor: pointer;
  user-select: none;
  font-size: 14.5px;
  line-height: 1.55;
  color: #1f2937;
}
.compliance-checkbox + .compliance-checkbox {
  border-top: 1px solid #e5e7eb;
}
.compliance-checkbox span {
  flex: 1;
}

/* Custom checkbox: 22 px touch target, drawn from scratch so the look is
   identical light/dark and across browsers (no native chrome reliance). */
.compliance-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.compliance-checkbox input[type="checkbox"]:hover {
  border-color: #0ea5e9;
}
.compliance-checkbox input[type="checkbox"]:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}
.compliance-checkbox input[type="checkbox"]:checked {
  background: #0ea5e9;
  border-color: #0ea5e9;
}
.compliance-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  display: block;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8.5 6.5 12 13 4.5' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.compliance-checkbox--regolamento a {
  color: #0ea5e9;
  text-decoration: underline;
  font-weight: 600;
}
.compliance-checkbox--regolamento a:hover {
  color: #0284c7;
}

.compliance-notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 3px solid #0ea5e9;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13.5px;
  color: #1f2937;
}
.compliance-notice i {
  color: #0ea5e9;
  margin-right: 6px;
}
.compliance-notice strong {
  color: #0f172a;
}

/* -------------------------------------------------------------------------
 * Dark mode — colours forced explicitly. Without this, the block falls back
 * to the light literals above because --theme-text isn't always defined in
 * the compliance block's CSS scope.
 * ------------------------------------------------------------------------- */
html.dark-mode .compliance-block {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
html.dark-mode .compliance-title {
  color: #f1f5f9;
}
html.dark-mode .compliance-title i {
  color: #38bdf8;
}
html.dark-mode .compliance-checkbox {
  color: #f1f5f9;
}
html.dark-mode .compliance-checkbox + .compliance-checkbox {
  border-top-color: rgba(255, 255, 255, 0.10);
}
html.dark-mode .compliance-checkbox input[type="checkbox"] {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.30);
}
html.dark-mode .compliance-checkbox input[type="checkbox"]:hover,
html.dark-mode .compliance-checkbox input[type="checkbox"]:focus-visible {
  border-color: #38bdf8;
}
html.dark-mode .compliance-checkbox input[type="checkbox"]:checked {
  background: #38bdf8;
  border-color: #38bdf8;
}
html.dark-mode .compliance-checkbox--regolamento a {
  color: #38bdf8;
}
html.dark-mode .compliance-checkbox--regolamento a:hover {
  color: #7dd3fc;
}
html.dark-mode .compliance-notice {
  background: rgba(56, 189, 248, 0.10);
  color: #e2e8f0;
  border-left-color: #38bdf8;
}
html.dark-mode .compliance-notice i {
  color: #38bdf8;
}
html.dark-mode .compliance-notice strong {
  color: #f1f5f9;
}

@media (max-width: 600px) {
  .compliance-block { padding: 18px 16px; margin: 24px 0 8px; }
  .compliance-checkbox { font-size: 14px; padding: 12px 0; gap: 12px; }
}
