body,
input,
textarea,
button,
select,
option {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
}

button,
input[type="submit"],
.button {
  border: 2px solid black;
  background: powderblue;
  border-radius: 0.25em;
  padding: 0.5em 1em;
  color: black;
  text-decoration: none;
}

button:hover,
input[type="submit"]:hover,
button:focus,
input[type="submit"]:focus,
.button:hover,
.button:focus {
  background-color: skyblue;
  cursor: pointer;
}

button:active,
input[type="submit"]:active,
.button:active {
  box-shadow: inset 0 0 0.5em rgba(0,0,0,0.2);
}

body {
  padding: 2em;
}

h1 {
  padding-bottom: 0.2em;
  border-bottom: 2px solid black;
  margin-bottom: 1em;
}

/* Utilities */

.hide {
  display: none;
}

/* Forms */

label,
input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
textarea,
button {
  margin: 0.5em 0 0;
  display: block;
}

label + * {
  margin-top: 1em;
}

label p {
  color: grey;
  font-size: 0.8em;
  margin: 0.5em 0;
}

input[type="text"],
input[type="datetime-local"],
input[type="number"],
textarea {
  border: 1px solid lightgrey;
  background: white;
  width: 20em;
  max-width: 100%;
  padding: 0.5em;
}

.help {
  font-size: 0.8em;
  color: grey;
}

textarea {
  height: 10em;
}


/* Tables */

table {
  border-collapse: collapse;
  text-align: right;
}

table th {
  font-weight: bold;
}

table th,
table td {
  padding: 0.5em 1em;
  vertical-align: top;
  border-bottom: 1px solid lightgrey;
}

table th:first-child,
table td:first-child {
  font-weight: bold;
  text-align: left;
}

table.ballot-confirm {
  text-align: left;
  margin-bottom: 2em;
}

table.ballot-confirm th:first-child,
table.ballot-confirm th:last-child,
table.ballot-confirm td:first-child,
table.ballot-confirm td:last-child {
  white-space: nowrap;
}

.vote form button {
  margin: 2em 0;
}


/* Error */

.error {
  background: gold;
  padding: 1em;
  border-radius: 0.25em;
}


/* Notice */

.notice {
  background: powderblue;
  padding: 0.5em 1em;
  margin: 2em 0;
  border-radius: 0.25em;
}


/* Info message */

.info {
  background: #EEE;
  padding: 1em;
  margin-top: 3em;
  border-radius: 0.25em;
}

.info h2 {
  margin-top: 0;
}

.info > *:last-child {
  margin-bottom: 0;
}


/* Layout */

.row {
  display: flex;
}
.row .column:first-child {
  flex-shrink: 0;
}
.row .column + .column {
  margin-left: 4em;
}
.column > h2:first-child {
  margin-top: 0;
}


/* Nav */

nav a {
  margin-right: 1em;
}


/* Elected */

.elected th {
  position: relative;
}
.elected th:after {
  content: '\2713';
  position: absolute;
  right: 0;
}

.elected + tr:not(.elected) th,
.elected + tr:not(.elected) td {
  border-top-color: lightgrey;
  border-top-style: double;
}

/* Ballot page */
.vote {
  max-width: 35em;
  margin: 0 auto;
}

/* Code Generator */

.generate-codes input[type="number"] {
  display: inline-block;
  width: 3em;
  padding: 0.25rem;
  font-size: 0.8rem;
}
.generate-codes button {
  font-size: 0.8rem;
  display: inline-block;
}