:root {
  --font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
  --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;

  --decorator-border: 8px;
  --white: #fff;
  --mid-gray: #383838;
  --color-1: #0086FF;
  --color-2: #80C2FF;
  --font-color: #212529;
  --bg-color: #303030;
  --color-red-50: #fef2f2;
  --color-red-800: #991b1b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
}

html, body, main {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

#root {
  min-height: 300px;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--font-color);
  background-color: var(--bg-color);
  background-image: url(/static/images/texture.png);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-font-smoothing: auto;
}

small, .small {
  font-size: 0.875em;
}

a {
  font-weight: 400 !important;
  cursor: pointer;
}

a:not([href]):not([class]), a:not([href]):not([class]):hover {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  vertical-align: middle;
}

button {
  border-radius: 0;
}

button:focus:not(:focus-visible), input:focus, input:focus-visible {
  outline: 0;
}

input,
button,
select,
optgroup,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button,
select {
  text-transform: none;
}

button,
[type=button],
[type=reset],
[type=submit] {
  -webkit-appearance: button;
  appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
  cursor: pointer;
}

::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

.d-flex {
  display: flex !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-center {
  justify-content: center !important;
}

.position-relative {
  position: relative !important;
}

.position-absolute {
  position: absolute !important;
}

.bg-white {
  background-color: #fff !important;
}

.border-bottom {
  border-bottom: 1px solid #dee2e6 !important;
}

.overflow-auto {
  overflow: auto !important;
}

.overflow-hidden {
  overflow: hidden !important;
}

.w-100 {
  width: 100% !important;
}

.w-auto {
  width: auto !important;
}

.mw-100 {
  max-width: 100% !important;
}

.h-auto {
  height: auto !important;
}

.mh-100 {
  max-height: 100% !important;
}

.lh-base {
  line-height: 1.5 !important;
}

.mx-3 {
  margin-right: 1rem !important;
  margin-left: 1rem !important;
}

.mx-4 {
  margin-right: 1.5rem !important;
  margin-left: 1.5rem !important;
}

.mx-auto {
  margin-right: auto !important;
  margin-left: auto !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-auto {
  margin-top: auto !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-5 {
  margin-bottom: 3rem !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.pb-2 {
  padding-bottom: 0.5rem !important;
}

.pt-2 {
  padding-top: 0.5rem !important;
}

.ps-3 {
  padding-left: 1rem !important;
}

.fw-bold {
  font-weight: 700 !important;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center {
  text-align: center !important;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.transition-all {
  transition: all 0.2s ease-in-out;
}

.wrapper {
  max-width: 400px;
  width: calc(100% - 40px);
  height: 500px;
  max-height: calc(100% - 40px);
}

.content {
  z-index: 1;
  max-height: 100%;
}

.decorator {
  top: calc(var(--decorator-border) * -1);
  left: calc(var(--decorator-border) * -1);
  height: calc(100% + 2 * var(--decorator-border));
  width: calc(100% + 2 * var(--decorator-border));
  background-color: var(--color-1);
}

.decorator::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: var(--color-2);
  width: 218px;
  left: calc(50% - 109px);
}

.decorator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  background-color: var(--color-2);
  height: calc(100% - 2 * 211px);
  top: 211px;
}

.header {
  padding: 0.75rem;
  box-shadow: 0 0.35rem 0.5rem rgba(0, 0, 0, 0.15);
}

.header-logo {
  height: 32px;
  margin: 0.6rem 0;
}

.mainTitle {
  color: var(--mid-gray);
  letter-spacing: 5px;
  font-size: 1.2rem;
}

.link {
  color: #fff;
  font-weight: 600 !important;
}

.title {
  color: var(--mid-gray);
  font-weight: 600;
  text-align: center;
  font-size: 1.25rem;
}

.subtitle {
  color: var(--mid-gray);
  text-align: center;
  font-size: 0.9rem;
}

.searchBar {
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.15);
}

.input {
  background-color: transparent;
  border: none;
  font-size: 1.15rem;
}

.searchIcon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid-gray);
  padding: 0.375rem 0.75rem;
}

.searchIconImage {
  width: 1.35em;
  height: 1.35em;
  display: block;
  transition: opacity 0.2s ease-in-out;
}

.searchSpinner {
  position: absolute;
  display: none;
  width: 1.5em;
  height: 1.5em;
  border: 0.2em solid rgba(128, 194, 255, 0.3);
  border-top-color: var(--color-1);
  border-radius: 50%;
  animation: searchSpinner 0.8s linear infinite;
}

.searchIcon.is-loading .searchIconImage {
  opacity: 0;
}

.searchIcon.is-loading .searchSpinner {
  display: block;
}

.searchButton {
  margin-top: 1rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: none;
  border-radius: 999px;
  background-color: var(--color-1);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.22);
  transition: box-shadow 0.2s ease;
}

.searchButton:hover,
.searchButton:focus-visible {
  background-color: #0064c6;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.searchButton:disabled {
  background-color: rgba(19, 86, 153, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.searchButtonIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.searchButtonIconImage {
  width: 1.25em;
  height: 1.25em;
  display: block;
}

@media screen and (max-width: 520px) {

  .searchButton {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .searchButtonIconImage {
    width: 1.1em;
    height: 1.1em;
  }
}

@media screen and (min-width: 768px) {
  .searchButton {
    font-size: 1.1rem;
  }

  .modalAction {
    font-size: 1.25rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .searchSpinner {
    animation: none;
  }
}

.legend {
  color: var(--mid-gray);
  font-size: 0.8rem;
  text-align: center;
}

.legend a {
  color: inherit;
  text-decoration: underline;
}

.legend .legend-extended {
  display: none;
}

.errorMessage {
  display: none;
  position: absolute;
  color: var(--color-red-800);
  background-color: var(--color-red-50);
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: center;
  margin-top: -1.5rem;
  width: 100%;
}

.errorMessage.is-visible {
  display: block;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.75);
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 1000;
}

.modalOverlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modalContent {
  width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  padding: 0;
}

.modalBody {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1.75rem;
}

.modalImage {
  width: 100%;
  max-height: min(70vh, 900px);
  object-fit: contain;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.45);
}

.modalClose {
  position: absolute;
  top: clamp(0.75rem, 3vw, 2rem);
  right: clamp(0.75rem, 3vw, 2rem);
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--font-color);
  padding: 0.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.modalClose:hover,
.modalClose:focus-visible {
  background: rgba(255, 255, 255, 0.65);
}

.modalCloseIcon {
  width: 1.5em;
  height: 1.5em;
  display: block;
}

.modalActions {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 2rem;
}

.modalAction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 1 1 240px;
  max-width: 320px;
  border: none;
  background-color: var(--color-1);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem 2.75rem;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.2s ease;
}

.modalAction:hover,
.modalAction:focus-visible {
  background-color: #0064c6;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
}

.modalActionIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modalActionIconImage {
  width: 1.25em;
  height: 1.25em;
  display: block;
}

.modalActionSave {
  background-color: var(--white);
  color: var(--color-1);
  border: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.modalActionSave:hover,
.modalActionSave:focus-visible {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-1);
}
@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
    background-color: var(--white) !important;
    background-image: none !important;
  }
  body > *:not(#successModal) {
    display: none !important;
  }
  #successModal {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #successModal::before,
  #successModal::after {
    display: none !important;
  }
  .modalContent,
  .modalBody {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .modalBody > *:not(#stickerImageToPrint), #successModal button {
    display: none !important;
  }
  #stickerImageToPrint {
    display: block !important;
    position: static !important;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100vh;
    box-shadow: none !important;
    page-break-before: avoid;
    page-break-after: avoid;
  }
  @page {
    size: 3in 1.5in;   /* width height */
    margin: 0;         /* edge-to-edge if the printer allows it */
  }
}

@media screen and (max-width: 640px) {
  .modalBody {
    gap: 1.25rem;
  }

  .modalImage {
    border-width: 4px;
  }

  .modalAction {
    flex: 1 1 100%;
    justify-content: center;
  }

  .modalActions {
    gap: 1rem;
    margin-top: 1.5rem;
  }
}

@media screen and (min-height: 870px) and (min-width: 620px) {
  :root {
    --decorator-border: 15px;
  }

  .mx-md-5 {
    margin-right: 3rem !important;
    margin-left: 3rem !important;
  }

  .wrapper {
    width: 550px;
    max-width: 90%;
    height: 650px;
    max-height: 90%;
  }

  .searchBar {
    height: 50px;
  }

  .searchButton {
    margin-top: 1.5rem;
    padding: 0.7rem 1.5rem;
  }

  .searchTitle {
    font-size: 1.75rem;
  }

  .input {
    font-size: 1.25rem;
  }

  .pt-md-3 {
    padding-top: 0.75rem !important;
  }

  .legend .legend-extended {
    display: inline;
  }

  .errorMessage {
    font-size: 1rem;
    padding: 0.75rem 0.5rem;
  }

  .header {
    padding: 1rem;
  }

  .header-logo {
    height: 40px;
    margin: 0.8rem 0;
  }

  .mainTitle {
    font-size: 1.5rem;
  }

}

@media screen and (min-height: 1058px) and (min-width: 700px) {
  :root {
    --decorator-border: 20px;
  }

  .mx-md-5 {
    margin-right: 3rem !important;
    margin-left: 3rem !important;
  }

  .wrapper {
    width: 600px;
    max-width: 90%;
    height: 650px;
    max-height: 90%;
  }

  .searchTitle {
    font-size: 2rem;
  }

  .input {
    font-size: 1.35rem;
  }

  .pt-md-3 {
    padding-top: 1rem !important;
  }

  .header {
    padding: 1rem;
  }

  .header-logo {
    height: 49px;
    margin: 1rem 0;
  }

  .mainTitle {
    font-size: 1.75rem;
    letter-spacing: 7px;
  }

}
