body {
  font-family: "GDS Transport", Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 400;
  color: #0b0c0c;
  background: #f3f2f1;
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: 0;
}

.container {
  max-width: 840px;
  margin: 0 auto;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 16px #0001;
  padding: 0 16px 32px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.logo-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 8px 0;
}
.bsc-logo {
  height: 64px;
  max-width: 220px;
  margin: 0 auto 0.5em auto;
  display: block;
}

.page {
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.page.active {
  display: block;
  opacity: 1;
  pointer-events: all;
}

.card, .agreement, #consent-page {
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  padding: 32px 24px 28px 24px;
  margin-bottom: 32px;
}

/* GOV.UK Heading styles */
h1, h2, h3, h4, h5, h6 {
  color: #0b0c0c;
  font-family: inherit;
  font-weight: 700;
  margin-top: 0;
  line-height: 1.11111;
}
h1 { font-size: 2.625rem; margin-bottom: 36px; } /* 42px */
h2 { font-size: 2rem;    margin-bottom: 30px; } /* 32px */
h3 { font-size: 1.5rem;  margin-bottom: 18px; } /* 24px */
h4, h5, h6 { font-size: 1.25rem; margin-bottom: 12px; }

label {
  display: block;
  margin: 5px 0 5px 0;
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  color: #0b0c0c;
  line-height: 1.25;
}

input[type="text"], input[type="email"], input[type="date"], textarea {
  font-family: inherit;
  font-size: 19px;
  line-height: 1.31579;
  color: #0b0c0c;
  background-color: #fff;
  border: 2px solid #0b0c0c;
  border-radius: 0;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 6px 12px;
  margin-bottom: 0;
  appearance: none;
  box-shadow: none;
  transition: box-shadow 0.2s;
  letter-spacing: 0;
}
input:focus, textarea:focus {
  border-color: #1d70b8;
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}
input[readonly] {
  background: #f3f2f1 !important;
  color: #888;
}

/* Spacing for input groups */
.govuk-form-group,
.form-group,
label + input, 
label + textarea {
  margin-bottom: 24px;
}

/* GOV.UK fieldset and legend styles */
fieldset {
  border: 2px solid #0b0c0c;
  border-radius: 0;
  padding: 28px 18px 18px 18px;
  margin-bottom: 36px;
  background: #fff;
}
legend {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0b0c0c;
  margin-bottom: 0.6em;
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
}

@media (max-width: 700px) {
  fieldset {
    padding: 16px 3vw 10px 3vw;
    margin-bottom: 24px;
  }
  legend {
    font-size: 1.15rem;
    padding: 0;
  }
}

/* Signature fields */
.signature-value, .signature-field {
  font-family: 'Pacifico', cursive, 'Comic Sans MS', 'Brush Script MT', cursive;
  font-size: 24px;
  color: #003366;
  background: #f9f9f9;
  border: 2px dashed #aaccff;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin-top: 3px;
  width: 100%;
  box-sizing: border-box;
}

/* GOV.UK-style "click to sign" button */
.signature-click {
  display: inline-block;
  background: #f3f2f1;
  color: #0b0c0c;
  border: 2px solid #1d70b8;
  border-radius: 0;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  padding: 10px 22px 7px 22px;
  margin-left: 0.5em;
  margin-top: 2px;
  min-width: 160px;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  box-shadow: none;
  position: relative;
  vertical-align: middle;
}
.signature-click:focus {
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}
.signature-click:hover {
  background: #e8f0fa;
  color: #003078;
  border-color: #003078;
}
.signature-click.signed {
  background: #e6ffe6;
  color: #1d70b8;
  border-color: #4c2c92;
  cursor: default;
}
.signature-click.signed:focus,
.signature-click.signed:hover {
  background: #d7f7d7;
  color: #003078;
  border-color: #003078;
}

.signature-click::before {
  content: "\270D ";
  color: #1d70b8;
  font-size: 1.1em;
  margin-right: 3px;
  vertical-align: middle;
  display: inline-block;
}
.signature-click.signed::before {
  content: "\2714 ";
  color: #22863a;
  margin-right: 5px;
}

/* Consent Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  font-size: 18px;
  margin: 20px 0;
  gap: 15px;
  font-family: inherit;
  color: #0b0c0c;
}
input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.25);
  accent-color: #1d70b8;
}

button, input[type="submit"], a.button {
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  display: inline-block;
  width: auto;
  padding: 10px 22px 7px 22px;
  margin-top: 18px;
  margin-bottom: 10px;
  background-color: #1d70b8;
  color: #fff !important;
  border: none;
  border-radius: 0;
  box-shadow: 0 2px 0 #003078;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
}

button:hover, input[type="submit"]:hover, a.button:hover {
  background-color: #003078;
  color: #fff !important;
}

button:focus, input[type="submit"]:focus, a.button:focus {
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}

button:active, input[type="submit"]:active, a.button:active {
  top: 2px;
  box-shadow: none;
}

button:disabled, input[type="submit"]:disabled, a.button[disabled] {
  opacity: 0.5;
  background-color: #b1b4b6 !important;
  color: #fff !important;
  box-shadow: none;
  cursor: not-allowed;
}

.button--warning, .govuk-button--warning {
  background-color: #ffdd00;
  color: #0b0c0c !important;
  box-shadow: 0 2px 0 #ffbf47;
}

.button--warning:hover, .govuk-button--warning:hover {
  background-color: #fff2b1;
  color: #0b0c0c !important;
}

.button--warning:focus, .govuk-button--warning:focus {
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}

/* Agreement Scroll Box */
.agreement-fulltext {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 12px;
  border: 1.5px solid #b1b4b6;
  border-radius: 8px;
  background-color: #fff;
  padding: 16px;
  margin-bottom: 0;
  position: relative;
  font-family: inherit;
  color: #0b0c0c;
}

.scroll-indicator {
  width: 100%;
  text-align: center;
  font-size: 18px;
  color: #445;
  background: none;
  padding-bottom: 6px;
  margin-top: 7px;
  z-index: 3;
  position: relative;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s;
  font-family: inherit;
}
.scroll-indicator.at-bottom {
  opacity: 0;
  pointer-events: none;
}

.status {
  color: #1d70b8;
  margin-top: 14px;
  font-size: 1.1em;
  font-family: inherit;
}

.agreement-checkboxes {
  margin: 24px 5px;
  padding-left: 0;
}

.agreement-checkboxes__item {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  padding-left: 0;
}

.agreement-checkboxes__input {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  margin: 0 16px 0 0;
  cursor: pointer;
  vertical-align: middle;
  accent-color: #1d70b8;
  border: 2px solid #0b0c0c;
  border-radius: 0;
  background: #fff;
  appearance: none;
  outline: none;
  transition: box-shadow 0.1s;
}

.agreement-checkboxes__input:focus {
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}

.agreement-checkboxes__input:checked {
  background-color: #1d70b8;
  border-color: #1d70b8;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 9l4 4 6-7' stroke='%23fff' stroke-width='3' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 80% 80%;
}

.agreement-checkboxes__label {
  display: inline-block;
  font-size: 19px;
  font-family: inherit;
  font-weight: 600;
  color: #0b0c0c;
  line-height: 2.0;
  cursor: pointer;
  user-select: none;
  margin-top: 0;
}

@media (max-width: 700px) {
  .agreement-checkboxes__label {
    font-size: 16px;
  }
  .agreement-checkboxes__input {
    width: 34px;
    height: 34px;
  }
}

.agreement-fields {
  margin-bottom: 20px;
}

.agreement-inline {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.agreement-inline input.signature-value {
  flex: 1 1 220px;
  min-width: 0;
  height: 56px;         /* Match the button */
  padding: 0 16px;
  font-size: 18px;
  margin-bottom: 0;
  box-sizing: border-box;
  border: 2px solid #0b0c0c;
  background: #f3f2f1;
}

.agreement-inline .signature-click {
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  background-color: #1d70b8;
  color: #fff !important;
  border: none;
  border-radius: 0;
  box-shadow: 0 2.5px 0 #003078;
  min-width: 180px;
  height: 54px;
  padding: 0 36px 0 28px;   /* More left for emoji, more right for symmetry */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
  outline: none;
  letter-spacing: 0;
}

.agreement-inline .signature-click:focus {
  outline: 3px solid #ffdd00;
  box-shadow: 0 0 0 4px #ffdd00;
}

.agreement-inline .signature-click:hover {
  background-color: #003078;
  color: #fff !important;
}

.agreement-inline .signature-click.signed {
  background-color: #22863a;
  color: #fff !important;
  box-shadow: 0 2.5px 0 #154b27;
  cursor: default;
}

/* Red border for empty required fields */
.agreement-fields input[required]:not([data-optional="1"]).required-warning,
.agreement-fields .signature-value[required]:not([data-optional="1"]).required-warning {
  border: 2.5px solid #d4351c !important;
  box-shadow: 0 0 2px #d4351c30;
}

/* Green border for filled required fields */
.agreement-fields input[required]:not([data-optional="1"]).required-ok,
.agreement-fields .signature-value[required]:not([data-optional="1"]).required-ok {
  border: 2.5px solid #00703c !important;
  box-shadow: 0 0 2px #00703c30;
}

a {
  color: #1d70b8;
  text-decoration: underline;
}
a:visited { color: #4c2c92; }
a:hover   { color: #003078; }
a:focus   { outline: 3px solid #ffdd00; background: #ffdd00; color: #0b0c0c; }

/* Mobile adjustments */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .container, .card, .agreement, #consent-page { max-width: 99vw; padding: 3vw 1vw; }
  .logo-bar { padding: 12px 0 6px 0; }
  .bsc-logo { max-width: 140px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }
  input[type="text"], input[type="email"], input[type="date"], textarea {
    font-size: 17px;
    min-height: 36px;
  }
  label {
    font-size: 17px;
  }
  legend {
    font-size: 1.1rem;
  }
  .card, .agreement, #consent-page { padding: 12vw 4vw; }
    .agreement-inline {
    flex-direction: column;
    gap: 12px;
  }
  .agreement-inline .signature-click,
  .agreement-inline input.signature-value {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

@media (min-width: 480px) {
  h1 { font-size: 2.625rem; }
  .card, .agreement, #consent-page { padding: 32px; }
  input, textarea { font-size: 19px; }
}