/* The Dark Factory demonstrator stylesheet.
 *
 * GOV.UK Design System-inspired (typography, colour, layout).
 * NOT a government service. Pages carrying this stylesheet are
 * formally-verified Ada/SPARK demonstrators released by
 * The Dark Factory Ltd under Apache-2.0.
 *
 * Targets Gnoga's actual DOM:
 *   body
 *     > div  (View_Type, position:fixed 760px wide)
 *         > div  (disclaimer banner, inline yellow)
 *         > div  (title block)
 *         > form
 *             label, input, br, ...
 *         > div  (result reason)
 *         > div  (result amount/start)
 *         > div  (footer)
 *
 * The first override is the load-bearing one: make View_Type's fixed-
 * position 760px container into a normal-flow, max-width 960, centered
 * block. After that we can style content normally.
 */

* { box-sizing: border-box; }

html { background: #f3f2f1; }
body {
  margin: 0;
  padding: 0;
  background: #f3f2f1;
  font-family: "GDS Transport", arial, helvetica, sans-serif;
  font-size: 19px;
  line-height: 1.4;
  color: #0b0c0c;
}

/* === 1. Reclaim Gnoga's View_Type fixed-position container === */
body > div:first-of-type {
  position: static !important;
  width: 100% !important;
  max-width: 960px !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 30px 60px 30px !important;
  background: #ffffff;
  box-shadow: 0 0 0 1px #b1b4b6;
}

/* Add a service-header band ABOVE the view container via body::before */
body::before {
  content: "THE DARK FACTORY";
  display: block;
  background: #0b0c0c;
  color: #ffffff;
  padding: 15px 30px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.5px;
  border-bottom: 5px solid #1d70b8;
  max-width: 960px;
  margin: 0 auto;
}

/* === 2. Disclaimer banner (View > first child) — strip the inline yellow */
body > div:first-of-type > div:first-of-type {
  background: #ffffff !important;
  color: #0b0c0c !important;
  border: 0 !important;
  border-left: 10px solid #b1b4b6 !important;
  padding: 15px 20px !important;
  margin: 30px 0 30px 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.4;
}

/* Phase tag prepended above the disclaimer text */
body > div:first-of-type > div:first-of-type::before {
  content: "DEMONSTRATOR — NOT A GOVERNMENT SERVICE";
  display: block;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #0b0c0c;
}

/* === 3. Headings === */
h1, h2, h3 {
  color: #0b0c0c;
  font-weight: 700;
  margin: 0 0 20px 0;
  line-height: 1.11;
}
h2 { font-size: 36px; }
h3 { font-size: 24px; }
p  { margin: 0 0 20px; }

/* === 4. Form layout — label ABOVE input, GOV.UK style === */
form { margin: 30px 0; }
form br { display: none; }   /* kill Gnoga's auto-inserted line breaks */

label {
  display: block;
  font-weight: 700;
  font-size: 19px;
  margin: 20px 0 5px 0;
  color: #0b0c0c;
  min-width: 0;
  width: auto;
}

input[type="number"],
input[type="text"],
input[type="date"] {
  display: block;
  font: inherit;
  padding: 5px 8px;
  border: 2px solid #0b0c0c;
  background: #ffffff;
  color: #0b0c0c;
  border-radius: 0;
  margin: 0 0 5px 0;
  width: 100%;
  max-width: 350px;
  height: 40px;
}

input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0 10px 0 0;
  vertical-align: middle;
  accent-color: #0b0c0c;
}

input:focus,
button:focus,
a:focus {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
  box-shadow: inset 0 0 0 2px #0b0c0c;
}

/* === 5. Submit button — GOV.UK green === */
input[type="submit"],
button[type="submit"] {
  display: inline-block;
  padding: 10px 20px;
  background: #00703c;
  color: #ffffff;
  border: 2px solid transparent;
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 #002d18;
  margin-top: 30px;
  margin-bottom: 30px;
  width: auto;
  height: auto;
  position: relative;
}
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: #005a30;
}
input[type="submit"]:focus,
button[type="submit"]:focus {
  background: #ffdd00;
  color: #0b0c0c;
  border-color: #0b0c0c;
  box-shadow: 0 2px 0 #0b0c0c;
  outline: 3px solid transparent;
}
input[type="submit"]:active,
button[type="submit"]:active {
  top: 2px;
  box-shadow: none;
}

/* === 6. Links === */
a {
  color: #1d70b8;
  text-decoration: underline;
  text-underline-offset: 0.1em;
  text-decoration-thickness: 1px;
}
a:visited { color: #4c2c92; }
a:hover {
  color: #003078;
  text-decoration-thickness: 3px;
}
a:focus {
  outline: 3px solid transparent;
  background: #ffdd00;
  color: #0b0c0c;
  box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
  text-decoration: none;
}

/* === 7. Result panel — make outputs prominent === */
body > div:first-of-type > div:nth-of-type(n+3):not(:last-of-type) {
  /* result rows: bigger, with light grey separator */
  padding: 15px 0;
  border-bottom: 1px solid #b1b4b6;
  font-size: 21px;
}
body > div:first-of-type > div:nth-of-type(n+3):not(:last-of-type) strong {
  font-weight: 700;
}

/* === 8. Horizontal rule (footer separator) === */
hr {
  border: 0;
  border-top: 1px solid #b1b4b6;
  margin: 40px 0 20px 0;
}

/* === 9. Commercial-enquiries footer — quieter === */
body > div:first-of-type > div:last-of-type small em {
  font-style: normal;
  font-size: 16px;
  color: #505a5f;
  line-height: 1.5;
}
body > div:first-of-type > div:last-of-type small strong {
  color: #0b0c0c;
  font-weight: 700;
}
body > div:first-of-type > div:last-of-type small a {
  color: #1d70b8;
  text-decoration: underline;
}

/* === 10. Footer outside the white container — Crown-copyright shape === */
body::after {
  content: "© The Dark Factory Ltd, Sunderland · Formally-verified Ada/SPARK 2014 demonstrator · Apache-2.0";
  display: block;
  max-width: 960px;
  margin: 20px auto 30px auto;
  padding: 15px 30px;
  font-size: 14px;
  color: #505a5f;
  border-top: 1px solid #b1b4b6;
}
