:root {
  color-scheme: light only;
  --margin: 12px;
  --input-height: 32px;
  --border: 1px solid rgb(118,118,118);
}

body {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  position: relative;
  background-color: white;
}

body.th [data-translatable] {
  font-family: "Noto Sans Thai", sans-serif;
}

header, main, footer {
  width: 100%;
  max-width: 900px;
}

header {
  padding: 0 10px;
}

#main-img {
  width: 100%;
  max-width: 600px;
  padding: 5px 0 20px;
}

main {
  padding: 12px 4px;
}

nav {
  height: 46px;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid grey;
  box-shadow: 0px 3px 40px 2px lightblue;
}

nav > button {
  height: 100%;
  border-right: 1px solid grey;
  flex-grow: 1;
  color: #001225;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

nav > button:last-of-type {
  border-right: none;
  margin-right: -1px;
}

nav > button.active {
  background-color: rgba(82,200,209,0.3);
}

section[data-content-id] {
  display: none;
}

section[data-content-id].active {
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  flex-direction: column;
}

#languages {
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 1px 1px 6px 0 rgba(150,150,150,0.85);
  position: absolute;
  top: 35px;
  left: calc(100% - 120px);
  height: 26px;
  display: flex;
  align-items: center;
  border: 1px solid grey;
  background-color: white;
  justify-content: center;
}

#languages > button {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 100%;
  font-size: 14px;
  border-right: 1px solid grey;
}

#languages > button:last-of-type {
  border-right: none;
}

#languages > button.active {
  background-color: rgb(214,236,173);
}

#captcha {
  padding: 16px 20px 16px 16px;
  margin: 24px auto 0;
  border: thin solid rgb(173, 173, 173);
  border-radius: 4px;
  background-color: aliceblue;
  font-size: 15px;
}

.captcha {
  display: flex;
  align-items: center;
}

.captcha .check {
	border-radius: 4px;
	width: 22px;
	height: 22px;
  padding: 2px;
  margin-right: 10px;
	border: thin solid grey;
  cursor: pointer;
  background-color: white;
}

.check .checkmark {
  stroke: rgb(51, 128, 0);
  stroke-dashoffset: 745.74853515625;
  stroke-dasharray: 745.74853515625;
  -webkit-animation: dash 1s ease-out forwards;
          animation: dash 1s ease-out forwards;
}

@-webkit-keyframes dash {
  0% {
    stroke-dashoffset: 745.74853515625;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes dash {
  0% {
    stroke-dashoffset: 745.74853515625;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

#feedback {
  border-radius: 4px;
  padding: 12px;
  background-color: white;
  border: var(--border);
}

#feedback-btn {
  height: 54px;
  width: 200px;
  margin: 12px auto;
}

.grecaptcha-badge {
  visibility: hidden;
}

#contacts {
  padding: 0 12px;
}

#contacts input[type="text"] {
  width: 100%;
  max-width: 300px;
}

#contacts label {
  margin-top: 20px;
}

dialog[open] {
  opacity: 1;
  visibility: visible; 
  transform: translate(-50%, -50%);
}

dialog {
  opacity: 0;
  visibility: hidden;
  top: 50%;
  left: 50%;
  transition:
  opacity 0.25s ease-out,
  overlay 0.25s ease-out allow-discrete,
  display 0.25s ease-out allow-discrete;
}

.dialog {
  min-width: 280px;
  width: 380px;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  font-size: 18px;
  line-height: 26px;
  padding: 18px 24px;
}

.dialog-btn {
  padding: 8px;
  width: 90px;
  margin: 12px 0 0 auto;
}

#feedback.error {
  border: thin solid rgba(255,0,0,0.6);
  border-color: rgba(255,0,0,0.6);
}

#feedback-dialog {
  text-align: center;
  width: 320px;
}

#feedback-dialog-btn {
  margin: 20px auto 0;
}

@starting-style {
  dialog[open] {
    opacity: 0;
  }
}

dialog::backdrop {
  background-color: rgb(0 0 0 / 0%);
  transition:
    display 0.25s allow-discrete,
    overlay 0.25s allow-discrete,
    background-color 0.25s;
}

dialog[open]::backdrop {
  background-color: rgba(0,0,0,.8);
}

@starting-style {
  dialog[open]::backdrop {
    background-color: rgba(0,0,0,0);
  }
}

@media (min-width: 350px) {
  nav > button {
    font-size: 16px;
  }
}

@media (min-width: 420px) {
  main {
    padding: 20px;
  }

  header {
    padding: 0 20px;
  }

  nav > button {
    height: 50px;
  }
}

@media (min-width: 768px) {
  main {
    padding: 30px;
  }

  #main-img {
    width: 100%;
  }

  nav {
    height: 52px;
  }

  nav > button {
    font-size: 20px;
  }

  #languages {
    left: 50%;
    transform: translateX(calc(300px - 50%));
  }
}
