:root {

  --font-body: monospace;
  --font-title: monospace;

  /*
  As a guideline, color variants should 
  have the following tints:  
  -light  90%
  -color  50%
  -dark   30%
  */

  /* The base color, or a variant of it, 
  appears in 60% of the layout. It's the background, 
  rules, hovers, buttons, etc. */

  --base-light: #fafafa;
  --base: #eee;
  --base-dark: #d9d9d9;

  /* The primary color, or a variant of it, 
  appears in 30% of the layout. It is used for 
  buttons, highlights, form elements, etc. . */

  --primary-light: #B2E5FF;
  --primary: #007ACE;
  --primary-dark: #104977;

  /* The accent color, or a variant of it,
  should appear sparingly, only in once or twice
  per page, to highlight calls to action. */

  --accent-light: #B2E5FF;
  --accent: #007ACE;
  --accent-dark: #104977;

  /* Errors need to stand out, but should
  be rarely used. */

  --error-light: #FFF2F2;
  --error: #D98989;
  --error-dark: #b34141;

  /* The forground color is used for text and
  icons. The -light variant is used over *-dark
  colors, and the -dark variant is used over 
  *-light colors and is the main font color. 
  The base --forground color is a midtone. */

  --forground-light: #fafafa;
  --forground: #a6a6a6;
  --forground-dark: #424242;

  --forground-on-primary-light: var(--forground-dark);
  --forground-on-primary: var(--forground-light);
  --forground-on-primary-dark: var(--forground-light);

  --forground-on-accent-light: var(--forground-dark);
  --forground-on-accent: var(--forground-light);
  --forground-on-accent-dark: var(--forground-light);

  --forground-on-error-light: var(--forground-dark);
  --forground-on-error: var(--forground-light);
  --forground-on-error-dark: var(--forground-light);

  
  /* Contextual colors */

  --rule: var(--base-dark);
}

html, body {
  color: var(--forground-dark);
  padding: 0;
  margin: 0;
}


hr,
.hr {
  height: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 8px 0 7px;
}


/*
Typography
*/

body {
  font-size: 13px;
  line-height: 16px;
  font-family: var(--font-body); 
  background-color: var(--base);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title); 
}

h1 {
  padding: 0;
  margin: 16px 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: normal;

  user-select: none;
}

@media (min-width:900px) {
  h1 {
    font-size: 40px;
  }
} 

section > h1:first-child {
  margin-top: 0;
}

h2 {
  padding: 0;
  margin: 32px 0 12px;

  font-family: var(--font-title); 
  font-size: 20px;
  line-height: 24px;
  font-weight: normal;

  user-select: none;
}

p, h3, h4, h5 {
  font-size: 13px;
  line-height: 16px;
  font-weight: normal;
  padding: 0;
  margin: 12px 0;
}

li {
  font-size: 13px;
  line-height: 16px;
  font-weight: normal;
}

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


/* Page Headers */

.header {
  display: flex;
  align-items: flex-end;
}

.header + hr,
.header + .hr {
  margin: 0px 0 24px;
}

.header h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 64px;
  margin: 0;
}


/* Banners */

.banner {
  display: block;
  padding: 13px 16px 11px;
  margin: 16px 0;
  
  background-color: var(--base-dark);
  border-radius: 8px;

  font-family: inherit;
  font-weight: normal;
  font-size: 13px;
  line-height: 16px;
  color: var(--forground-light);
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  user-select: none;
}

.banner.error {
  background-color: var(--error-dark);
}


/*
Forms
*/

/* .input */

.input {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 11px 16px 9px;
  border: 1px solid var(--base-dark);
  margin: 16px 0;
  
  background-color: var(--base-light);
  border-radius: 8px;

  font-family: inherit;
  font-weight: normal;
  font-size: 13px;
  line-height: 16px;
  color: var(--forground-dark);
}

.input[type=date] {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 16px 0;
  height: 40px;
  vertical-align: bottom;
}

.input:disabled,
.input.disabled {
  border-color: var(--base-light);
  border-radius: 0;
  cursor: text;
}

select.input {
  -webkit-appearance: none;
  appearance: none;
  padding: 12px 16px 10px;
}

.input input::placeholder,
.input::placeholder,
select.input:invalid {
  color: var(--forground);
}

.input:focus {
  outline: none;
  box-shadow: 0 0 4px var(--primary);
}

.input:has(:focus) { /* only works on safari */
  outline: none;
  box-shadow: 0 0 4px var(--primary);
}

.input.error {
  background-color: var(--error-light);
  border-color: var(--error);
}

.input.inline {
  margin: 0 8px;
}

.inline.inline:first-child {
  margin-left: 0;
}

.inline.inline:last-child {
  margin-right: 0;
}

.input input:focus {
  outline: none;
}

/* input wrappers can be used to wrap inputs in order 
to add prefixes or suffixes */

.input.wrapper {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  padding: 0;
  color: var(--forground);
}

.input.wrapper input {
  display: block;
  appearance: none;
  flex: 1;
  width: 100%;
  padding: 11px 16px 9px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: normal;
  font-size: 13px;
  line-height: 16px;
  color: var(--forground-dark);
}

.input.wrapper select {
  display: block;
  appearance: none;
  flex: 1;
  width: 100%;
  padding: 12px 16px 10px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: normal;
  font-size: 13px;
  line-height: 16px;
  color: var(--forground-dark);
}

.input.wrapper input:focus,
.input.wrapper select:focus {
  outline: none;
}

/* .checkbox and .radio */

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

.check.disabled {
  opacity: 0.3;
}

.checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--base-light);
  border: 1px solid var(--base-dark);
  border-radius: 8px;
  cursor: pointer;
}

.checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary-dark);
}

.check .checkbox + span {
  display: block;
  padding: 3px 0 0 8px;
}

/* .button 
40px high to match inputs
*/

.button {
  display: inline-block;
  padding: 11px 16px 11px;
  border: 1px solid transparent;
  margin: 16px 0;
  
  background-color: var(--primary);
  border-radius: 8px;

  font-family: inherit;
  font-weight: normal;
  font-size: 13px;
  line-height: 16px;
  color: var(--forground-light);
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  user-select: none;
}

.button:hover {
  background-color:  var(--primary-light);
}

.button.secondary {
  padding: 12px 32px 10px;
  background-color: var(--base-light);
  border-color: var(--base-dark);
  color: var(--forground);
}

.button.secondary.active,
.button.secondary:hover {
  background-color: var(--base-dark);
  color: var(--forground-dark);
}

.button.tertiary {
  margin: 0;
  background-color: transparent;
  color: var(--forground-dark);
}

.button.tertiary.active,
.button.tertiary:hover {
  background-color: var(--primary);
  color: var(--forground-light);
}

.button.inline {
  margin: 0 8px 0 0;
}

.button.inline:last-child {
  margin: 0;
}

.button.accent {
  background-color: var(--accent);
  color: var(--forground-light);
}

.button.accent:hover {
  background-color: var(--accent-light);
}

.button.big {
  font-size: 18px;
  line-height: 24px;
}

.header .button {
  margin: 0 0 3px;
  background-color: transparent;
  color: var(--forground-dark);
}

.header .button:hover {
  background-color: var(--primary);
  color: var(--forground-light);
}

.button:disabled,
.button:disabled:hover,
.button.disabled,
.button.disabled:hover {
  background-color: var(--base-dark);
  color: var(--forground);
  cursor: default;
}

/* Links */

.link {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

/* .label */

.label {
  display: block;
  color: var(--forground);
  font-size: 13px;
  font-weight: normal;
  line-height: 16px;
  padding: 0;
  margin: 16px 0 4px 0;

  user-select: none;
}

.label + .input,
.label + .value,
.label + .value > .input {
  margin-top: 0;
}

.label + .value .input {
  margin-bottom: 0;
}

.label + .value {
  margin-bottom: 16px;
}


/* Use .field to wrap an input or and remove it's margins */

.field > .input {
  margin: 0;
}


/* .hint */

.hint {
  font-size: 12px;
  line-height: 14px;
  color: var(--forground);
}

.hint + .hint,
.input + .hint {
  margin: -10px 0 16px 2px;
}