/* General */

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background-color: #fff;
  color: #0b0b0d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 14px;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Helper classes */

.float-left {
  float: left;
}

.float-right {
  float: right;
}

.grow {
  flex-grow: 1;
}

.padded {
  padding: .75em 1em;
  overflow: auto;
}

.padded > *:first-child {
  margin-left: 0;
}

.padded > p:first-child {
  margin-top: 0;
}

.disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.btn.large,
.form-control.large {
  padding: 1em;
}

/* Typography */

h1, h2, h3, p {
  line-height: 1.5;
}

h1 {
  font-weight: 400;
  font-size: 26px;
  margin: 20px 0;
}

h2 {
  font-weight: 400;
  font-size: 20px;
  margin: 20px 0;
}

h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0;
}

h4 {
  font-weight: 500;
  font-size: 1em;
}

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

.bold {
  font-weight: 600;
  text-transform: uppercase;
}

a:not(:hover) {
  text-decoration: none;
}

a {
  color: #0060df;
}

a:active {
  color: #003eaa;
}

small {
  font-size: 12px;
}

.grey-text,
p {
  color: #666;
  font-weight: 400;
}

p {
  margin: 20px 0;
}

pre {
  border: solid 1px rgb(234, 234, 234);
  padding: 20px;
  margin: 0 0 15px 0;
  overflow: auto;
  background: #fdfdfd;
  font-family: Menlo, Consolas, monospace;
}

p.description {
  color: #0b0b0d;
}

ul {
  padding-left: 30px;
}

li {
  margin: 10px 0;
  line-height: 1.5;
}

ol {
  padding-left: 20px;
}

ol > li {
  font-weight: 700;
}

/* Layout */

.navbar-container,
.container {
  max-width: 992px;
  margin: auto;
  width: 100%;
}

.container {
  padding: 40px 20px;
}

main {
  overflow: auto;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  z-index: 0;
  /* viewport height - header height - 20px extra height (so that footer is visible) */
  min-height: calc(100vh - 100px);
}

.global-alert + main {
  /* viewport height - header height - 20px extra height (so that footer is visible) */
  min-height: calc(100vh - 155px);
}

.centered-container {
  margin: auto;
}

section:not(:last-child) {
  padding-bottom: 2em;
  margin-bottom: 2em;
  border-bottom: 1px solid #ededf0;
}

.grid {
  display: grid;
  grid-gap: 40px;
  grid-template-columns: 1fr 1fr;
}

@media screen and (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Buttons */

.btn {
  border: none;
  border-radius: 2px;
  background: #ededf0;
  padding: 6px 10px;
  color: #0c0c0d;
  text-decoration: none;
  font: inherit;
  display: inline-block;
  cursor: pointer;
  line-height: initial;
}

.btn:not(:first-child) {
  margin-left: 0.5em;
}

.btn:hover {
  background: #d7d7db;
}

.btn:hover:active {
  background: #b1b1b3;
}

.btn:focus {
  box-shadow: inset 0 0 0 2px #0a84ff, 0 0 0 3px rgba(10, 132, 255, 0.3);
  outline: none;
}

.btn-primary {
  background: #0c0c0d;
  color: #f9f9fa;
}

.btn-primary:hover {
  background: #38383d;
}

.btn-primary:hover:active {
  background: #2a2a2e;
}

.btn-error {
  background: #ff0039;
  color: #f9f9fa;
}

.btn-error:hover {
  background: #d70022;
}

.btn-error:hover:active {
  background: #a4000f;
}

/* Inputs */

.form-control-container > .form-control,
.form-control-container > .btn {
  width: 100%;
  margin: 0;
  margin-top: 0.75em;
}

.form-control {
  border: 1px solid rgba(12, 12, 13,0.3);
  padding: 5px 9px;
  border-radius: 2px;
  margin: 0 0.5em;
  font: inherit;
  transition: box-shadow 0.15s cubic-bezier(.07,.95,0,1);
}

textarea.form-control {
  display: block;
  resize: vertical;
  width: 100%;
  font-family: Menlo, Consolas, monospace;
}

.form-control:hover {
  border-color: rgba(12, 12, 13,0.5);
}

.form-control:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3);
  outline: none;
}

.form-control.disabled,
.form-control:disabled {
  pointer-events: none;
  background: #f5f5f5;
}

/* Header and footer shared code */

.brand-logo {
  text-decoration: none;
  color: inherit;
  display: block;
}

.brand-logo img {
  width: 40px;
  margin-right: 1em;
  vertical-align: middle;
}

.brand-logo span {
  vertical-align: middle;
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.link-list-wrapper ul,
.link-list-wrapper ul li,
.link-list-wrapper ul li a {
  list-style: none;
  color: inherit;
  display: inline-block;
  margin: 0;
  padding: 0;
}

.link-list-wrapper ul li a {
  font-size: 13px;
  text-decoration: none;
  color: #666;
  text-transform: uppercase;
  transition: color 0.2s ease;
  font-weight: 400;
}

.link-list-wrapper ul li a:hover {
  color: #0b0b0d;
}

/* Navigation bar */

.navbar {
  background: #fff;
  z-index: 1;
}

.navbar-container {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  min-height: 80px;
  line-height: 80px;
}

.navbar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  box-shadow: 0 4px 16px rgba(12,12,13,.1);
}

.navbar .icon.menu,
.menu-toggle {
  display: none;
}

.navbar .brand-logo {
  height: 100%;
  padding-left: 20px;
}

.navbar ul {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  text-align: right;
}

.navbar ul li{
  display: flex;
}

.navbar ul li a {
  padding: 0 20px;
  display: flex;
  align-items: center;
}

/* Footer */

.footer {
  border-top: solid 1px #eee;
  background: #fafafa;
  z-index: 0;
}

.footer .footer-inner-container {
  display: flex;
}

.footer .footer-link-container {
  flex: 1;
}

.footer-link-list ul li a {
  padding: 1.25em 0 1em 1em;
}

.footer .brand-logo {
  padding: 1.25em 0;
}

.footer-logo-container {
  text-align: right;
}

.footer-logo-container .footer-logo-tagline {
  font-style: italic;
  line-height: 1.5;
}

@media screen and (max-width: 992px) {
  .navbar .menu-toggle:not(:checked) + ul {
    display: none;
  }

  .navbar .icon.menu {
    display: block;
    cursor: pointer;
    padding: 0 20px;
    margin-left: auto;
  }

  .link-list-wrapper ul {
    min-width: 100%;
    line-height: 1;
  }

  .link-list-wrapper ul li {
    text-align: left;
    display: block;
  }

  .navbar .menu-toggle:checked + ul,
  .navbar ul li {
    display: block;
  }

  .navbar ul li:hover {
    background: #f8f8f8;
  }

  .navbar ul li.active {
    background: #f8f8f8;
    font-weight: 600;
  }

  .navbar ul li a {
    color: #0b0b0d;
    border-bottom: solid 1px #eee;
    display: block;
    line-height: 50px;
    font-size: 14px;
  }

  .footer .footer-inner-container {
    flex-direction: column;
  }

  .footer .footer-link-container {
    display: flex;
    flex-wrap: wrap;
  }

  .footer-link-container .footer-link-list {
    margin-bottom: 30px;
    flex: 1 0;
    min-width: 150px;
  }

  .footer-link-container .footer-link-list ul {
    padding-top: 10px;
  }

  .footer-link-container .footer-link-list li a {
    padding: 10px 0;
    display: block;
  }

  .footer-logo-container {
    text-align: left;
  }
}

@media screen and (max-width: 768px) {
  .navbar .brand-logo span {
    display: none;
  }
}

/* Tabs */

.tab-nav, .tab-nav li {
  list-style: none;
  margin: 0;
}

.tab-nav {
  padding: 0 1em;
}

.tab-nav li {
  display: inline-block;
  margin: 0 1em;
  padding: 0;
}

.tab-nav li:first-child {
  margin-left: 0;
}

.tab-nav li:last-child {
  margin-right: 0;
}

.tab-nav li a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  padding: .5em 0;
  position: relative;
  text-align: center;
  overflow: hidden;
  height: 100%;
  vertical-align: bottom;
}

.tab-nav li a::after {
  content: "";
  transition: transform 1s cubic-bezier(.07,.95,0,1);
  transform: scale(0);
  display: block;
  background: #0a84ff;
  height: 1px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
}

.tab-nav li.selected a {
  color: #0a84ff;
}

.tab-nav li.selected a::after {
  transform: none;
}

.global-tab-nav {
  margin-bottom: 2em;
  border-bottom: 1px solid #ededf0;
  text-align: center;
  font-size: 1.1em;
}

.global-tab-nav li {
  margin: 0 1.5em;
}

.global-tab-nav li a {
  margin-bottom: -1px;
}

.tab-panel iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.tab-panels .tab-panel:not(.selected) {
  display: none;
}

/* Panels */

.panel {
  box-shadow: 0 2px 8px rgba(12,12,13,.1);
  margin: 20px 0;
  border-radius: 2px;
}

.panel-icon {
  width: 32px;
  height: 32px;
  margin: 0 0.75em;
}

.panel-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.panel > .panel-heading,
.panel > .panel-section {
  border-bottom: 1px solid #ededf0;
}

.panel-heading > * {
  vertical-align: middle;
  display: inline-block;
}

.panel-body {
  background: #fcfcfc;
}

/* Cards */

.card {
  box-shadow: 0 2px 8px rgba(12,12,13,.1);
  border-radius: 2px;
  display: flex;
}

.card-image {
  width: 64px;
  height: 64px;
  margin: 20px 0 20px 20px;
}

.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.card-content h2 {
  margin-top: 10px;
}

.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  line-height: 3;
}

@media screen and (max-width: 992px) {
  .card {
    display: block;
  }
  .card-content {
    display: block;
  }
  .card-image {
    float: left;
    margin-right: 20px;
  }
  .card p {
    clear: left;
  }
}

/* Status icons */

.status-icon {
  border-radius: 100%;
  border: 1px solid rgba(0,0,0,0.1);
  width: 10px;
  height: 10px;
  display: inline-block;
}

.status-icon.primary {
  background: #0a84ff;
}

.status-icon.success {
  background: #30e60b;
}

.status-icon.error {
  background: #ff0039;
}

.status-icon.warning {
  background: #ff9400;
}

/* Editable labels */

.editable-value > * {
  margin: 0;
  vertical-align: middle;
  display: inline-block;
}

.editable-label:not(.editing) .editable-editor,
.editable-label.editing .editable-value {
  display: none;
}

.editable-editor {
  width: 100%;
  display: flex;
}

.editable-editor > input {
  flex: 1;
}

.editable-toggle {
  margin-left: 10px;
  cursor: pointer;
}

/* Alerts */

.global-alert {
  order: -1;
  z-index: 2;
}

.alert {
  padding: 15px;
}

.alert > span {
  vertical-align: middle;
}

.alert > .icon::before {
  width: 1em;
  height: 1em;
  margin-right: .5em;
}

.alert.alert-warning {
  background: #fff8b2;
  color: #715100;
}

/* Icons */

.icon::before,
.form-control-feedback::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.8;
  vertical-align: middle;
}

.icon.white::before {
  filter: invert(1);
}

.icon.edit::before {
  background-image: url(../img/icons/edit.svg);
}

.icon.menu::before {
  background-image: url(../img/icons/menu.svg);
}

.icon.link::before {
  background-image: url(../img/icons/link.svg);
}

.icon.warning::before {
  background-image: url(../img/icons/warning.svg);
}

/* Icon buttons */

.icon-button {
  padding: 10px;
  opacity: .4;
}

.icon-button:hover {
  opacity: 1;
}

/* Form control feedback */

.ajax-form {
  position: relative;
}

.form-control-feedback {
  border: none;
  background: none;
  box-shadow: none;
  position: absolute;
  top: 0.5em;
  right: 0.5em;
}

.ajax-form:not(.success):not(.error) .form-control-feedback {
  display: none;
}

.ajax-form.pending .form-control-feedback::before {
  content: "...";
}

.ajax-form.success .form-control-feedback::before {
  background-image: url(../img/icons/check.svg);
}

.ajax-form.error .form-control-feedback::before {
  background-image: url(../img/icons/error.svg);
}
