/* ── Google Font ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

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

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  background: #ffffff;
  color: #000;
}

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.supernova { background: #ffffff; }

.form-all {
  max-width: 752px;
  margin: 0 auto;
  background: #f3f3f3;
  padding-bottom: 40px;
}

/* ── Cover image ──────────────────────────────────────────────────────────── */
.form-cover-wrapper {
  max-width: 752px;
  margin: 0 auto 32px;
}
.form-cover-wrapper img { width: 100%; height: auto; display: block; }

/* ── Section headers ──────────────────────────────────────────────────────── */
.form-header-group {
  background-color: #0b4d8b;
  padding: 20px 38px;
  margin: 0 0 4px;
}
.form-header-group h2 {
  color: #ffffff;
  font-size: 1.5em;
  font-weight: 600;
}

/* ── Form list & lines ────────────────────────────────────────────────────── */
.form-section { list-style: none; padding: 0 38px; }

.form-line {
  margin-top: 12px;
  margin-bottom: 12px;
  page-break-inside: avoid;
}

/* ── Labels ───────────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #000;
}
.form-required { color: #f23a3c; margin-left: 2px; }

.form-sub-label {
  display: block;
  font-size: 12px;
  color: #57647e;
  margin-top: 3px;
}

/* ── Inputs & Textareas ───────────────────────────────────────────────────── */
.form-textbox,
.form-textarea,
.form-dropdown {
  width: 100%;
  background: #ffffff;
  border: 1px solid #c3cad8;
  border-radius: 6px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 15px;
  color: #000;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-textbox { height: 40px; }
.form-textarea { padding: 10px 12px; resize: vertical; min-height: 100px; }

.form-textbox:hover, .form-textarea:hover, .form-dropdown:hover {
  border-color: rgba(195,202,216,0.5);
  box-shadow: 0 0 0 2px rgba(195,202,216,0.25);
}
.form-textbox:focus, .form-textarea:focus, .form-dropdown:focus {
  border-color: #c3cad8;
  box-shadow: 0 0 0 3px rgba(195,202,216,0.25);
}

/* ── Half-width inputs ────────────────────────────────────────────────────── */
.half { max-width: 310px; }

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.form-dropdown {
  height: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2357647E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Two-column layout ────────────────────────────────────────────────────── */
.form-col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Radio & Checkbox ─────────────────────────────────────────────────────── */
.form-radio-group, .form-checkbox-group { display: flex; flex-direction: column; gap: 6px; }

.form-radio-item, .form-checkbox-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.form-radio-item input, .form-checkbox-item input {
  width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
  accent-color: #2367ef;
}

/* ── Matrix table ─────────────────────────────────────────────────────────── */
.form-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.form-matrix th {
  background: #e8ecf2;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  border: 1px solid #c3cad8;
}
.form-matrix td {
  padding: 6px 8px;
  border: 1px solid #c3cad8;
  background: #fff;
}
.form-matrix td input {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  background: transparent;
}
.form-matrix tr:nth-child(even) td { background: #f8f9fb; }

/* ── Divider ──────────────────────────────────────────────────────────────── */
.form-divider {
  border: none;
  border-bottom: 1px solid #f3f3fe;
  margin: 8px 0;
}

/* ── Signature ────────────────────────────────────────────────────────────── */
.signature-wrapper {
  border: 1px solid #c3cad8;
  border-radius: 6px;
  background: #fff;
  position: relative;
  width: 310px;
}
.signature-wrapper canvas { display: block; border-radius: 6px; cursor: crosshair; }
.signature-controls { display: flex; gap: 8px; padding: 6px 8px; }
.btn-clear-sig {
  font-size: 13px;
  color: #333;
  background: #e4e8f0;
  border: 1px solid #c3cad8;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 14px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-clear-sig:hover {
  background: #d4d8e0;
}

/* ── Submit button ────────────────────────────────────────────────────────── */
.form-buttons-wrapper { display: flex; justify-content: center; margin-top: 24px; }
.submit-button {
  min-width: 180px;
  height: 48px;
  background: #2367ef;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.submit-button:hover { background: #1a52cc; }
.submit-button:active { transform: scale(0.98); }
.submit-button:disabled { background: #9bb0e0; cursor: not-allowed; }

/* ── Validation error ─────────────────────────────────────────────────────── */
.form-line.has-error .form-textbox,
.form-line.has-error .form-textarea,
.form-line.has-error .form-dropdown,
.form-line.has-error .signature-wrapper {
  border-color: #f23a3c;
  box-shadow: 0 0 3px #f23a3c;
}
.form-line.has-error .form-radio-group,
.form-line.has-error .form-checkbox-group,
.form-line.has-error .form-matrix {
  border: 1px solid #f23a3c;
  box-shadow: 0 0 3px #f23a3c;
  padding: 8px;
  border-radius: 6px;
}
.error-msg {
  color: #f23a3c;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}
.form-line.has-error .error-msg { display: block; }

/* ── Success / Error banners ──────────────────────────────────────────────── */
#form-result {
  display: none;
  max-width: 752px;
  margin: 24px auto;
  padding: 20px 32px;
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
}
#form-result.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#form-result.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Consent text ─────────────────────────────────────────────────────────── */
.consent-text {
  background: #fff;
  border-left: 4px solid #0b4d8b;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* ── Address group ────────────────────────────────────────────────────────── */
.address-group { display: flex; flex-direction: column; gap: 8px; }
.address-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-section { padding: 0 16px; }
  .form-header-group { padding: 16px; }
  .form-col-2, .form-col-3, .address-row { grid-template-columns: 1fr; }
  .half, .signature-wrapper { width: 100%; }
  .signature-wrapper canvas { width: 100% !important; }
}
