/*
 * controleerbtwnummer.eu — front-end styling.
 *
 * Hand-written: no framework, no build step, no external requests. The
 * Montserrat typeface (400/700) is self-hosted under fonts/ (the reference
 * site loads the same face from the Google Fonts CDN; self-hosting keeps
 * the page free of external references), the banner images live under
 * files/ and the favicons under img/. The only runtime request a page
 * makes is the same-origin API call GET /api/validate/<vat>.json
 * (contract: docs/api-contract.md).
 *
 * The design mirrors the public site controleerbtwnummer.eu:
 *   - the translucent country-code strip over the EU-night banner;
 *   - the white hero title (with text-shadow) and the search form that
 *     floats over the banner (white input + blue search button);
 *   - the white CMS content block;
 *   - the light footer (navy text) with the outlined buttons and the
 *     navy copyright bar.
 * The breakpoints (1024 / 720 / 568 px) match the reference.
 */

/* --- typefaces (self-hosted Montserrat, the reference's font) -------------- */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/montserrat-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/montserrat-700.ttf') format('truetype');
}

/* --- base ------------------------------------------------------------------ */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  stroke: #878e88; /* the reference's body sets fill/stroke (icon inheritance) */
  fill: #878e88;
  font-family: 'Montserrat', 'Helvetica', 'Arial', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5em;
  color: #25211e;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #004494;
}

a:hover {
  color: #f1cc00;
  text-decoration: underline;
}

/* keyboard focus stays visible (the reference's :focus outline removal is
 * not carried over: it would hide keyboard navigation)
 */
:focus-visible {
  outline: 2px solid #254bc5;
  outline-offset: 2px;
}

img {
  border: 0;
}

.hidden {
  display: none !important;
}

/* --- typography ------------------------------------------------------------- */

/* the reference upper-cases the first letter of every heading */
h1:first-letter,
h2:first-letter,
h3:first-letter,
h4:first-letter,
h5:first-letter,
h6:first-letter {
  text-transform: uppercase;
}

h1 {
  /* margin-top keeps the UA default (0.67em): the reference only pins
   * margin-bottom, and the hero h1 (position:absolute) is offset by its
   * margin-top from the `top` value — same as the reference's 184.78px. */
  margin: 0.67em 0 1em;
  font-size: 2em;
  font-weight: 300;
  line-height: 1.2em;
}

h2 {
  margin: 2em 0 1em 0;
  font-size: 1.5em;
  font-weight: 400;
  line-height: 1.2em;
  text-transform: uppercase;
}

h3 {
  margin: 2em 0 1.5em 0;
  font-weight: 700;
}

code {
  display: block;
  margin-bottom: 10px;
  padding: 10px;
  background: #f1f1f1;
}

.title {
  font-weight: 700; /* the reference's generic .title rule (the code blocks' titles) */
}

/* --- layout utilities (the reference's grid + spacing) ---------------------- */

.container {
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
}

.clearfix::after {
  content: '';
  display: block;
  clear: both;
}

.pull-left {
  float: left;
}

.pull-right {
  float: right;
}

.txt-right {
  text-align: right;
}

/* grid rows (the reference's pure.css grid, trimmed to what is used) ------
 * The reference compiles `display: -ms-flexbox` (unrecognised by modern
 * browsers), so the rows are effectively display:block and the columns are
 * inline-block; the negative letter-spacing on the row absorbs the
 * whitespace between the inline-block columns.
 */
.row-spaced,
.row-spaced-extra {
  position: relative;
  clear: both;
  letter-spacing: -0.31em;
  text-rendering: optimizeSpeed;
}

.row-spaced {
  margin: 0 -10px;
}

.row-spaced-extra {
  margin: 0 -50px;
}

.row-spaced > [class*='col'],
.row-spaced-extra > [class*='col'] {
  display: inline-block;
  vertical-align: top;
  letter-spacing: normal;
  word-spacing: normal;
  text-rendering: auto; /* the reference's column rule resets the row's
                          * text-rendering:optimizeSpeed for all content */
  position: relative;
  min-height: 1px;
  padding: 0 10px;
  box-sizing: border-box;
}

.row-spaced-extra > [class*='col'] {
  padding: 0 50px;
}

.col-1,
.col-1-1,
.col-sm-1-1,
.col-md-1-1,
.col-lg-1-1,
.col-xl-1-1 {
  width: 100%;
}

@media (min-width: 48em) {
  .col-md-1-2 {
    width: 50%;
  }
}

/* spacing utilities — after the grid so .mb1 wins over the .row-spaced
 * margin shorthand (the reference's effective margin: 0 -10px 15px) */
.mt3 {
  margin-top: 3em;
}

.mb1 {
  margin-bottom: 1em;
}

.mb3 {
  margin-bottom: 3em;
}

/* --- buttons ------------------------------------------------------------------ */

.btn {
  display: inline-block;
  vertical-align: middle; /* pure's base .btn: the footer's .txt-right column
                           * would otherwise right-align the button text */
  text-align: center;
  padding: 0.5em 1.5em;
  border: 1px solid transparent;
  border-radius: 0;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
  user-select: none;
  cursor: pointer;
  line-height: normal; /* .btn,input{line-height:normal} in the reference */
  transition: background 0.1s ease-out;
}

.btn:hover,
.btn:active {
  color: #fff;
  text-decoration: none !important;
}

.btn.btn-primary {
  background: #004494;
  color: #fff;
  fill: #fff; /* the search icon inherits the fill + stroke (pure's .btn-primary) */
  stroke: #fff;
  font-weight: 700;
}

/* the footer's outlined buttons */
footer .btn.btn-primary,
footer .btn.btn-secondary {
  width: 100%;
  max-width: 350px;
  margin: 7px;
  margin-bottom: 10px;
  background: none;
  border: 2px solid #254bc5;
  color: #254bc5;
  font-weight: 700;
}

footer .btn.btn-secondary {
  border-color: #0c1b4a;
  color: #0c1b4a;
}

/* --- header: the country-code strip over the banner -------------------------- */

.site-header {
  position: relative;
}

.header-up {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 1, 29, 0.65); /* #00011da6 */
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.24); /* #ffffff3d */
}

.assets {
  margin: 0;
  padding-left: 0;
  font-size: 0.8em;
  list-style: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assets li {
  display: inline-block;
  padding: 5px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.28); /* #ffffff47 */
}

.assets li:last-child {
  border-right: none;
}

/* --- banner -------------------------------------------------------------------- */

.banner {
  max-height: 400px;
  overflow: hidden;
}

.page-home .banner {
  max-height: none;
}

.banner img {
  /* inline (not display:block), like the reference: the line box under the
   * image adds ~6.5px, so the .banner div is slightly taller than the img */
  width: 100%;
}

/* --- hero title (white, over the banner) --------------------------------------- */

main > h1 {
  position: absolute;
  top: 160px;
  width: 100%;
  color: #fff;
  font-size: 37px;
  font-weight: 700;
  text-align: center;
  text-shadow: 2px 2px 15px #000;
}

/* --- the search form floating over the banner --------------------------------- */

.frm-vat {
  position: absolute;
  top: 300px;
  width: 700px;
  left: 50%;
  left: calc(50% - 350px);
  border-radius: 10px;
  overflow: hidden;
}

.frm-vat input {
  width: calc(100% - 70px);
  height: 60px;
  padding: 15px 30px;
  margin: 0;
  font-family: inherit;
  font-size: 1.2em;
  color: #25211e;
  background: #fff;
  border: none;
  outline: none;
  box-sizing: border-box;
}

.frm-vat .btn-search {
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 60px;
  padding: 0;
  font-size: 1.4em;
  line-height: 60px;
  text-align: center;
  background: #004494;
}

.frm-vat .btn-search:hover {
  background: rgba(0, 68, 148, 0.73); /* #004494ba */
}

/* the search icon: the reference renders the sprite symbol with an outline
 * stroke (stroke:inherit + stroke-width:2px), so the button markup uses the
 * same <use> reference (public/svg/awesome.svg) as the reference site */
svg.icon {
  fill: inherit;
  stroke: inherit;
  stroke-width: 2px;
  height: 1em;
  width: 1em;
  display: inline-block;
  position: relative;
  top: 0.2em;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
}

/* the reference's placeholder: smaller + uppercase (all inputs) */
::placeholder {
  font-size: 0.7em;
  text-transform: uppercase;
}

/* --- the result box (loading / error / valid) ---------------------------------- */

.frm-vat .result {
  position: relative;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.7); /* #ffffffb3 */
}

.result .name {
  font-weight: 700;
}

.result .vat {
  margin-bottom: 10px;
  font-style: italic;
}

.frm-vat .result.error {
  color: #fff;
  background: rgba(181, 0, 0, 0.84); /* #b50000d6 */
}

.frm-vat .result.loading {
  height: 60px;
}

.frm-vat .result.loading::before {
  content: ' ';
  position: absolute;
  top: 50%;
  top: calc(50% - 34px);
  left: 50%;
  left: calc(50% - 30px);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.6);
  border: 5px solid #fff;
  border-top: 5px solid #254bc5;
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes spin {
  0% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .frm-vat .result.loading::before {
    animation: none;
  }
}

/* --- CMS content ----------------------------------------------------------------- */

.cms-page .container {
  background: #fff;
}

.cms > :first-child {
  margin-top: 0;
}

.cms > :last-child {
  margin-bottom: 0;
}

/* --- footer ---------------------------------------------------------------------- */

footer {
  padding: 1.5em 0 0 0;
  background: #f1f1f1;
  color: #0c1b4a;
}

footer .copyright {
  margin-top: 2em;
  padding: 10px 0;
  font-size: 0.8em;
  color: #fff;
  background: #0c1b4a;
}

.copyright a {
  color: #fff;
  text-decoration: underline;
  font-weight: 700;
}

.copyright a:hover {
  color: inherit;
  opacity: 0.9;
}

/* --- the cookie information toast (the reference's noty notice) ------------------- */

.cookie-notice {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  max-width: 340px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  background: #1f2d3d;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cookie-notice--show {
  opacity: 1;
}

.cookie-notice--hide {
  opacity: 0;
}

.cookie-notice__icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border-radius: 50%;
  background: #4d94ff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.cookie-notice__close {
  flex: none;
  margin-left: 10px;
  padding: 0;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  color: #9fb2c4;
  background: none;
  border: none;
  cursor: pointer;
}

.cookie-notice__close:hover {
  color: #fff;
}

/* --- breakpoints (the reference's 1024 / 720 / 568 px) ---------------------------- */

@media (max-width: 64em) {
  main > h1 {
    top: 80px;
  }

  .frm-vat {
    top: 190px;
  }

  .container {
    padding: 0 30px;
  }
}

@media (max-width: 45em) {
  .frm-vat {
    top: 170px;
    width: 550px;
    left: calc(50% - 275px);
  }

  .page-home main > h1 {
    top: 60px;
  }

  .col-buttons {
    margin-top: 20px;
    text-align: center;
  }

  .banner {
    max-height: 250px;
  }
}

@media (max-width: 35.5em) {
  main > h1 {
    padding: 0 10px;
    box-sizing: border-box;
  }

  .frm-vat {
    top: 200px;
    width: calc(100% - 20px);
    left: 0;
    margin: 0 10px;
  }

  footer .copyright {
    text-align: center;
  }

  footer .pull-right {
    float: none;
    margin-top: 20px;
  }

  footer .pull-left {
    float: none;
  }
}
