*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
button {
  color: inherit;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

main {}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.container {
  position: relative;
  margin: 0 auto;
  max-width: 1096px;
  padding: 20px;

  &.small-container {
    max-width: 800px;
  }
}

button, [role="button"] {
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  display: inline-block;
  background: #39f;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  border: solid 1px #039;
  font-size: 0.9em;
  line-height: 1.5;
}

button.warning, [role="button"].warning {
  background: #f39;
  border-color: #903;
}

button.link, [role="button"].link {
  background: none;
  border: none;
  padding: none;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  display: inline;
  color: #039;
}

a {
  color: #05a;
  text-decoration: underline dotted;
}

fieldset {
  border: none;
  padding: 0;
}

fieldset.vertical-form {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 8px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Oswald;
}

.padded-touch-target {
  border-radius: 999px;
  padding: 24px;
}

.center-xy {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.display-none {
  display: none;
}

.display-inline {
  display: inline;
}

.qsl-card, .raised-box {
  border: solid 1px #666;
  box-shadow: 8px 8px 0 #eee;
  display: box;
  left: -8px;
  list-style-type: none;
  padding: 20px;
  position: relative;
  top: -8px;
}

.qsl-card {
  h2 {
    display: inline-block;
    float: right;
    margin-left: 16px;
    margin-bottom: 16px;
  }

  .qsl-message {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  }

  &.burned-card {
    h2 {
      text-decoration: line-through;
    }
  }

  .card-owner-controls {
    position: absolute;
    bottom: -12px;
    right: 20px;

    button, [role="button"] {
      position: relative;

      .shadowed {
        position: absolute;
        top: 50%;
        height: 50%;
        left: 0;
        width: 100%;
        box-shadow: 8px 8px 0 #eee;
        border-bottom-right-radius: 999px;
        border-bottom-left-radius: 999px;
        z-index: -1;
      }
    }
  }
}

.virtual-qsl-card {
  border-style: dashed;
  box-shadow: none;
  top: 0;
  left: 0;
}

.qsl-found-form {
  position: relative;
  margin: 2em auto 0;
  max-width: 520px;

  .qsl-card {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;

    textarea {
      border: none;
      flex-basis: 280px;
      flex-grow: 1;
      min-height: 240px;
      resize: none;
    }
  }

  button {
    position: relative;
    display: block;
    margin: 8px;
  }
}

ul.qsl-cards {
  padding: 20px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 320px);
  grid-auto-rows: minmax(180px, auto);
  gap: 24px;
}

nav {
  background: #eee;

  .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  ul {
    list-style-type: none;
    padding: 0;
    display: flex;

    >li {
      margin-right: 24px;
      &:last-child {
        margin-right: 0;
      }
    }
  }
}

.user-widget {
  display: flex;
  align-items: center;

  .username {
    margin-right: 8px;
  }
}

.login-form {
  position: relative;
  margin: 40px auto;
  max-width: 640px;

  form >* {
    margin-bottom: 16px;
    &:last-child {
      margin-bottom: 0;
    }
  }
}

.error {
  display: block;
  background: #fca;
  color: #420;
  padding: 8px;
}

.success {
  display: block;
  background: #afc;
  color: #042;
  padding: 8px;
}

.language-picker {
  .language-picker-input {
    background: #fff;
    border-radius: 999px;
    border: solid 1px #357;
    display: flex;
    align-items: stretch;

    .select-wrapper {
      position: relative;
      cursor: pointer;

      select {
        position: relative;
        appearance: none;
        cursor: pointer;
        border: none;
        background: none;
        font-size: 0.9em;
        font-family: inherit;
        padding-top: 4px;
        padding-bottom: 4px;
        padding-left: 8px;
        padding-right: 20px;
        color: #000;
        line-height: 1.5;
      }

      .select-caret {
        position: absolute;
        right: 8px;
        opacity: 0.75;
        color: #000;
      }
    }

    button {
      border: none;
      background: #357;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}
