:root {
  --spacing: 1rem;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

body.under-construction {
  background: #f1f1f1;
  color: #333;

  main {
    display: flex;
    padding-inline: 10px;
    padding-block: 5rem;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    justify-content: center;
  }

  header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    margin-inline: auto;

    img {
      max-width: 100%;
    }
  }
}

h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
}

body:has(.under-construction) {
  background: #000;
  color: #333;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  justify-content: center;
  align-items: center;
}

.under-construction {
  text-align: center;
  color: #fff;
}

body:not(:has(.under-construction)) {
  header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background:
      linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%),
      url("/static/img/header-bg.webp") no-repeat center center;
    background-size: cover;
    align-items: center;
    justify-content: center;
    padding-block: 3rem;

    img {
      width: 384px;
      height: auto;
      max-width: calc(100% - 2 * var(--spacing));
    }

    a:hover {
      opacity: 0.8;
    }
  }

  main {
    padding-inline: var(--spacing);
  }
}

button:not([class]),
.btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 19px 20px;
  gap: 10px;
  background: #006e91;
  border-radius: 40px;
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 19px;

  &:hover {
    background: #0095d4;
  }

  &:disabled {
    opacity: 0.5;
    pointer-events: none;
  }
}

.cert-search-form {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: 40px;
  background: #fff;

  label > span:first-child {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    text-shadow: none;
    color: #000;
    transition: all 0.3s;
    pointer-events: none;
  }

  &:has(input:focus) label > span:first-child,
  &:has(input:not(:placeholder-shown)) label > span:first-child {
    top: 0;
    left: 0;
    transform: translateY(-110%);
    font-size: 12px;
    text-shadow: 0 0 5px #000;
    color: #fff;
  }

  input {
    border-radius: 40px;
    font-size: 16px;
    padding: 18px;
    border: 0;
    background: #fff;
    color: #000;
    font-style: normal;
    font-weight: 600;
    line-height: 19px;

    &::placeholder {
      color: #fff;
    }
  }
}

.alert {
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #f4f4f4;
  color: #333;
  margin-block: var(--spacing);
  padding: var(--spacing);
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;

  &.alert--danger {
    background: #980a00;
    color: #fff;
    border-color: #980a00;
  }
}

p {
  margin: 0 0 1rem 0;

  &:last-child {
    margin: 0;
  }
}

section.certification {
  display: grid;
  grid-template-areas:
    "canvas details"
    "button empty";
  margin-inline: auto;

  .certificate-canvas-container {
    aspect-ratio: 1.414/1;
    grid-area: canvas;

    canvas {
      width: 100% !important;
      height: 100% !important;
    }
  }

  .details {
    background: #eff5f9;
    padding: 3rem;
    grid-area: details;
    max-width: 400px;

    ul {
      line-height: 1.8;
    }
  }

  & > button {
    grid-area: button;
    margin-inline: auto;
  }
}

/* For smaller screens we make it flex column */
@media (max-width: 1400px) {
  section.certification {
    grid-template-areas:
      "canvas"
      "button"
      "details";
    gap: 1rem;

    .details {
      max-width: unset;
    }
  }
}

