@import '~normalize.css/normalize';
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto&display=swap');

$color-primary:        #2980b9;
$color-grey:           #333;
$color-light-grey:     #e4e4e4;
$heading-font-family:  'Roboto', sans-serif;
$body-font-family:     'Open Sans', sans-serif;

@function spacing($n, $unit: 'px') {
  @return #{$n * 8}#{$unit};
}

main {
  margin: 0 5%;
  font-family: $body-font-family;
  color: $color-grey;
  font-size: 14px;
}

section {
  margin-bottom: spacing(5);
}

.header {
  width: 90%;
  padding: 0 5%;
  min-height: spacing(6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: fixed;
  background: #fff;
  border-bottom: 1px solid $color-light-grey;
}

.masthead {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: spacing(40);

  &__title {
    font-family: $heading-font-family;
    font-size: 2.5em;
    margin-bottom: spacing(2);
  }

  &__badge {
    margin-bottom: spacing(3);
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid $color-light-grey;
  margin-bottom: spacing(2);

  .table__cell {
    border-bottom: 1px solid $color-light-grey;
    padding: spacing(2) spacing(3);
    text-align: center;
    line-height: 1.4;

    &--header {
      text-transform: uppercase;
      font-size: 0.8em;
      font-weight: 700;
    }
  }

  &__buttons {
    margin-top: spacing(2);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
  }
}

.button {
  background-color: $color-primary;
  border-width: 2px;
  border-color: $color-primary;
  border-radius: 3px;
  padding: spacing(1) spacing(2);
  color: #fff;
  user-select: none;
  transition: all 250ms;
  cursor: pointer;
  text-decoration: none;

  &:hover,
  &:focus {
    background-color: darken($color-primary, 15%);
    border-color: darken($color-primary, 15%);
  }

  &--secondary {
    background-color: transparent;
    color: $color-primary;

    &:hover,
    &:focus {
      background-color: $color-primary;
      border-color: $color-primary;
      color: #fff;
    }
  }

  &--text {
    &,
    &:hover,
    &:focus {
      background-color: transparent;
      border-color: transparent;
      color: $color-primary;
    }
  }

  &--small {
    padding: spacing(0.5) spacing(1);
    font-size: 0.8em;
  }
}

.button + .button {
  margin-left: 10px;
}

.subheading {
  font-family: $heading-font-family;
  font-size: 1.5em;
  margin: 0;
  margin-bottom: spacing(1);
}

.content {
  text-align: left;
  margin: 0;
  margin-bottom: spacing(2);
}

.input-group {
  margin-bottom: spacing(1);
}

.input {
  width: 100%;
  padding: spacing(1.5) spacing(2);
  margin: spacing(1) 0;
  display: inline-block;
  border: 1px solid darken($color-light-grey, 10%);
  border-radius: 4px;
  box-sizing: border-box;

  &--checkbox {
    width: auto;
  }
}

.modal {
  position: fixed;
  z-index: 1;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0,0.4);

  &__content {
    background-color: #fefefe;
    margin: auto;
    padding: spacing(3);
    border: 1px solid $color-light-grey;
    width: 80%;
  }

  &__close {
    color: $color-grey;
    float: right;
    font-size: spacing(3);
    font-weight: bold;

    &:hover,
    &:focus {
      color: darken($color-grey, 10%);
      text-decoration: none;
      cursor: pointer;
    }
  }

  &__footer {
    display: flex;
    justify-content: flex-end;
  }
}
