:root {
  --text: #171f2c;
  --dark_blue: #0b1f43;
  --med_blue: #0f3168;
  --lt_blue: #308ff8;
  --semi_lt_blue: color-mix(in srgb, var(--med_blue) 65%, var(--lt_blue) 35%);
  --lt_gray: #f4f6f7;
  --med_gray: #d7dadb;
  --dark_gray: #929495;
  --plus_minus: color-mix(in srgb, var(--lt_blue) 25%, var(--dark_gray) 75%);
  --font: 'system-ui';
}

button.dev {
  background: color-mix(in srgb, var(--lt_blue) 15%, var(--dark_gray) 85%);
}

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

img {
  display: block;
  min-width: 100%;
}

body {
  background-color: #fbfbff;
  color: var(--text);
  font-family: var(--font), sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

/* Cache version */

p#cache-version {
  font-size: 0.875em;
  opacity: 50%;
}

/* === HEADER ===  */

header {
  background-color: var(--dark_blue);
  margin: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

header .flex-wrapper {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

#header-logo {
  padding: 1em;
  text-align: left;
}

#header-logo img {
  display: block;
  height: 3.75em;
}

#user-info {
  color: white;
  font-size: 0.875em;
  line-height: 1.35;
  padding: 0.75em 1.5em 0.75em 0.75em;
  text-align: right;
}

#user-info form {
  font-size: 0.875em;
  margin: 0;
}

.user-fullname {
  opacity: 75%;
}
.user-email {
  opacity: 50%;
  font-style: italic;
}

/* === MAIN BODY === */

a {
  color: var(--lt_blue);
}

#ui {
  margin: 7.826875em 0 0;
}

main {
  margin: 0 auto;
  padding: 1.618em 1.25em 1em;
  position: relative;
  max-width: 57.75em;
}

/* Connectivity status */

#online-status {
  align-items: center;
  background: var(--semi_lt_blue);
  display: flex;
  gap: 0.5em;
  flex-flow: row nowrap;
  justify-content: flex-end;
  padding: 0.5em 0.75em;
}

 #status-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
}

#status-indicator {
  background-color: seagreen;
  border: 1px solid white;
  border-radius: 7px;
  height: 14px;
  margin: 0;
  padding: 0;
  width: 14px;
}

#online-status.offline #status-indicator {
  background-color: tomato;
}

@media only screen and (max-width: 600px) {
  main {
    padding: 0 0.75em 1em;
    max-width: none;
  }
  body {
    font-size: 14px;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

address {
  font-style: normal;
}

dl {
  margin: 0;
}
dt {
  font-weight: 600;
}
dd {
  margin: 0 0 0.5em;
}

/* === BUTTONS === */

button,
a.button {
  background: var(--lt_blue);
  border-radius: 1.375em;
  color: white;
  border: 0;
  display: inline-block;
  font:
    600 0.85em/2.75 'DM Sans',
    sans-serif;
  padding: 0 2.5em;
  text-decoration: none;
  transition: all 0.5s;
}

button:hover,
a.button:hover {
  background: color-mix(in srgb, var(--lt_blue) 40%, var(--med_blue) 60%);
  cursor: pointer;
}

button.sm {
  font-size: 0.75rem;
}

/* === MAIN LISTING PAGE === */

h1 {
  font-size: 1.875em;
  line-height: 1.2;
  margin: 0 0 0.5em;
  max-width: 85%;
}

h2 {
  color: #16406f;
  font-size: 1.5em;
  margin: 1.5rem 0 0;
}

h2.subtitle {
  color: color-mix(in srgb, var(--med_blue) 70%, var(--lt_gray) 30%);
  font-size: 1.125em;
  margin: -0.8em 0 1em;
}

/* === FORM === */

form#login {
  margin: 1.5em 0;
  width: 400px;
}

form#login label {
  display: block;
}

form#login input {
  width: 100%;
}

form#login div {
  margin: 0 0 0.5em;
}

form#login div input {
  font-family: 'Poppins', sans-serif;
  padding: 0.5em 0.75em;
}

form .errorlist {
  padding: 0;
}

form .errorlist li {
  background: DarkOrange;
  color: white;
  padding: 0.75em 1.25em;
  margin-bottom: 0.5em;
}

footer form {
  margin: 1em auto;
  text-align: center;
  width: 200px;
}

/* === FLASH MESSAGES === */

ul#flash-messages {
  margin: 1em 0 1em;
  padding: 0;
}

body.login ul#flash-messages {
  position: relative;
  top: -2em;
}

#flash-messages li {
  font-size: 1.125em;
  line-height: 1;
  padding: 1em;
  position: relative;
  opacity: 100%;
  text-align: center;
  transition: all 500ms ease-out;
}

#flash-messages li.faded {
  height: 0;
  padding: 0;
  opacity: 0;
}

#flash-messages li strong {
  color: #ffd;
  font-weight: 700;
}

#flash-messages li.debug {
  color: #333;
  background-color: wheat;
}

#flash-messages li.info {
  color: #333;
  background-color: skyblue;
}

#flash-messages li.success {
  color: white;
  background-color: seagreen;
}

#flash-messages li.warning {
  color: white;
  background-color: darkorange;
}

#flash-messages li.error {
  color: white;
  background-color: crimson;
}

.dismiss-flash {
  text-shadow: var(--text) 1px 1px 1px;
  cursor: pointer;
  font-size: 1.618em;
  line-height: 1;
  position: absolute;
  right: 0.5em;
  top: 8px;
}

/* Statuses */

.status {
  border-radius: 4px;
  font-size: 0.75em;
  padding: 0.35em 0.875em;
}

.status.pending {
  background: var(--med_gray);
  color: var(--text);
}

.status.completed,
button#patient-completed {
  background: seagreen;
  color: white;
}

button#patient-completed:disabled {
  cursor: not-allowed;
  opacity: 50%;
}

.status.lost,
button#patient-lost {
  background: color-mix(in srgb, var(--text), var(--dark_gray));
  color: white;
}

/* Patient show */

#patient_info_wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 4%;
  list-style: none;
}

@media only screen and (max-width: 600px) {
  #patient_info_wrapper {
    flex-wrap: wrap;
  }
  #patient_info_wrapper > * {
    margin: 1em 0;
  }
}

#patient_info_wrapper table {
  width: auto;
}

#patient-actions {
  align-items: center;
  border-bottom: 1px solid var(--med_gray);
  border-top: 1px solid var(--med_gray);
  display: flex;
  flex-flow: row nowrap;
  gap: 0.75em;
  justify-content: flex-start;
  margin: 1em 0;
  padding: 1em 0;
}

span.form-icon {
  cursor: pointer;
  display: inline-block;
  line-height: 1;
  margin-right: 10px;
  padding-bottom: 5px;
  text-align: center;
  width: 48px;
}

span.form-icon svg {
  width: 100%;
}

span.form-icon span {
  font-size: 0.75em;
}

span.form-icon a {
  display: block;
  text-decoration: none;
}

span.form-icon
span.form-icon a {
  color: var(--lt_blue);
}

span.form-icon.completed,
span.form-icon.completed a {
  color: seagreen;
}

span.form-icon.disabled,
span.form-icon.disabled a {
  color: var(--dark_gray);
  cursor: not-allowed;
}

span.form-icon {
  border-bottom: 2px solid var(--lt_blue);
}

span.form-icon.disabled {
  border-bottom: 2px solid transparent;
}

span.form-icon.completed {
  border-bottom: 2px solid seagreen;
}

#acknowledgements {
  margin-top: -2em;
}

.ack_field {
  display: flex;
  margin: 1.25em 0;
  flex-flow: row nowrap;
  gap: 10px;
  justify-content: flex-start;
}

.total_for_sig {
  color: color-mix(in srgb, var(--dark_gray) 60%, var(--text) 40%);
  font-size: 1.35em;
}

.total_for_sig .currency {
  font-weight: 600;
  color: var(--med_blue);
}

/* === CUSTOMER SIGNATURE LINK === */

#customer-link {
  position: absolute;
  right: 10px;
  top: 0;
  width: 24px;
}

#customer-link img {
  cursor: pointer;
  opacity: 50%;
  transition: opacity 0.5s linear;
}

#customer-link img:hover {
  opacity: 100%;
}

#copy-success {
  color: white;
  border-radius: 50%;
  background-color: seagreen;
  display: none;
  line-height: 2;
  width: 2em;
  text-align: center;
  position: absolute;
  top: -4px;
  right: 42px;
}

/* Effects */

.shown {
  opacity: 1;
}

.hide {
  opacity: 0;
  transition: opacity 1s;
}

/* Toast */

.toast {
  background: #a00;
  border-radius: 10px;
  color: white;
  font-size: 0.825em;
  padding: 1.5em 2.5em;
  position: fixed;
  left: 50%;
  max-width: 50%;
  top: 50px;
  transform: translate(-50%, 0);
  z-index: 15;
}

.toast h4 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.toast-msg p {
  margin: 0;
}

.toast-close {
  font-size: 2em;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  opacity: 50%;
  text-shadow: -1px 1px black;
  top: 0.42rem;
  right: 0.75rem;
  transition: opacity 0.5s;
}

.toast-close:hover {
  opacity: 100%;
}

#error-log {
  background: white;
  border: 1px solid #aaa;
  margin: 1em 1.25em;
  padding: 1em;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  text-align: left;
}

/* === Pagination === */

nav.pagination {
  display: flex;
  justify-content: left;
}

ul.pagination {
  display: flex;
  flex-direction: row;
  font-size: 0.875em;
  padding-left: 0;
  list-style-type: none;
}

.pagination li {
  border: 1px solid #ccc;
  padding: 0;
  margin: 0 0 0 -1px;
}

.pagination li a,
.pagination li span {
  display: block;
  padding: 0.5em 0.85em;
}

.pagination a {
  color: var(--med_blue);
  text-decoration: none;
}
.pagination a:hover {
  background-color: #e8e8e8;
}

.pagination-current {
  border-color: var(--dark_blue);
  background-color: var(--dark_blue);
  color: white;
}

.pagination-disabled {
  color: #999;
}
