@import "_color.css";
@import "_typography.css";
@import "_mixins.css";

:root {
    --t-fast: 100ms;
    --t-base: 200ms;
    --t-slow: 400ms;
    --gap: 20px;
    --r: 5px;
    --button-r: 33px;
    --sidebar-width: 300px;
    --mobile-breakpoint-width: 900px;
    --header-height: 70px;
    --footer-height: 60px;
    --top-banner-height: 42px;
    --icon-size-small: 20px;
    --icon-size-medium: 40px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1;
}

body {
  background: white;
}

/* ============================================================================
   LAYOUT - MACRO STRUCTURE
   ============================================================================ */

/* Main grid layout */
.main {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-gap: 0;
  min-height: calc(100vh - var(--header-height));
}

.content {
  padding: calc(var(--top-banner-height) + var(--gap) * 2) calc(var(--gap) * 2) 0;
  background-color: var(--background-grey);
  min-width: 400px;
  display: flex;
  flex-direction: column;
}

.ui-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  align-items: start;
}

.ui-layout .col-left {
  min-width: 400px;
  width: 100%;
  padding-bottom: var(--footer-height); /* Leave space at the bottom of the page for the footer */
  gap: var(--gap);
  order: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
}

.ui-layout .col-right {
  order: 2;
  width: 100%;
}


.page-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: var(--footer-height);
  display: flex;
  align-items: center;
  padding: var(--gap);
  font-size: 0.875rem;
  justify-content: space-evenly;
  color: var(--primary-blue);
}

/* ============================================================================
   HEADER - MOBILE
   ============================================================================ */

.mobile-header {
  display: none;
}


/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
  position: relative;
  width: var(--sidebar-width);
  height: 100%;
  min-height: 100vh;
  background-color: var(--c-n-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.sidebar .background-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.sidebar .top-img {
  margin-bottom: 0;
  align-self: flex-start;
}

.sidebar .bottom-img {
  margin-top: 0;
  align-self: flex-end;
}

/* Logo section */
.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: calc(var(--gap) * 2) var(--gap);
}

.logo-img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.sidebar-logo-text {
  color: white;
  font-size: 3rem;
  font-weight: 400;
  text-align: center;
  margin-top: var(--gap);
  width: 100%;
}

.sidebar-middle {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: var(--gap);
}

.sidebar-protocol-link {
  color: white;
  text-decoration: underline;
  font-size: 14px;
  text-align: left;
  padding: 0 var(--gap);
  margin-bottom: var(--gap);
}

.sidebar-protocol-link:hover {
  color: var(--primary-blue);
}

/* ============================================================================
   BUTTONS - REUSABLE COMPONENTS
   ============================================================================ */

button {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.btn {
  background: white;
  border: 1px solid var(--primary-blue);
  border-radius: var(--button-r);
  color: var(--primary-blue);
  font-size: 14px;
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-base) var(--easing);
}

.btn:hover {
  background: rgba(var(--primary-blue-rgb), 0.1);
  border: 1px solid rgba(var(--primary-blue-rgb), 0.75);
  color: rgba(var(--primary-blue-rgb), 0.75);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.95);
  transition: transform 0.1s var(--easing);
}

.btn:disabled {
  border-color: var(--c-grey-2);
  color: var(--c-grey-2);
}

.btn:focus-visible {
  outline: 2px solid var(--c-b-blue);
  outline-offset: 2px;
}

.btn-blue, .btn-white:hover {
  background: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  color: white;
  width: 100%;
  max-width: calc(var(--mobile-breakpoint-width));
}

.btn.btn-warn {
  color: var(--c-orange);
  border-color: var(--c-orange);
}

.btn.btn-warn:hover {
  border: 1px solid var(--c-r-orange);
  color: var(--c-r-orange);
  background: rgba(var(--c-r-orange-rgb), 0.05);
}

.btn-download {
  color: var(--primary-blue);
  font-size: 16px;
  transition: all var(--t-base) var(--easing);
  transform: scale(1);
}

.btn-download:hover {
  background: rgba(var(--primary-blue-rgb), 0.1);
  border: 1px solid rgba(var(--primary-blue-rgb), 0.75);
  color: rgba(var(--primary-blue-rgb), 0.75);
}

.btn-download:active:hover {
  transform: scale(0.95);
}

.btn-download:not(:active) {
  transform: scale(1);
  transition: transform 0.2s var(--easing);
}

.btn-show-more-cases {
  display: none;
  margin: var(--gap) auto;
  width: 80%;
}

.btn-file-select {
  color: var(--c-b-blue);
  cursor: pointer;
}

.btn-file-select svg {
  width: var(--icon-size-medium);
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin-right: calc(var(--gap) * 0.5);
  position: relative;
  top: -4px;
  transition: all var(--t-fast) var(--easing);
}

.btn-file-select svg * {
  fill: var(--c-b-blue);
}

.btn-file-select:hover {
  color: var(--c-blue);
}

.btn-file-select:hover svg {
  transform: translateY(-4px);
}

.btn-file-select:hover svg * {
  fill: var(--c-blue);
}

.in-error .btn-file-select svg * {
  fill: var(--c-red);
}

.btn-cancel {
  margin: var(--gap) 0;
}

.btn-start-analysis {
  width: 50%;
  background: var(--c-grey);
  color: white;
  border: none;
  margin: var(--gap) 0;
}

.btn-start-analysis:hover {
  background: var(--c-grey-1);
  color: var(--c-grey);
  border: none;
  transform: translateY(-1px);
}

.btn-start-analysis:active {
  transform: translateY(0);
}

.btn-start-analysis.enabled {
  background: var(--primary-blue);
  color: white;
  border: 1px solid var(--primary-blue);
}

.btn-start-analysis.enabled:hover {
  background: rgba(var(--primary-blue-rgb), 0.1);
  border: 1px solid rgba(var(--primary-blue-rgb), 0.75);
  color: rgba(var(--primary-blue-rgb), 0.75);
}

/* ============================================================================
   STATUS INDICATORS
   ============================================================================ */

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 10px;
  background: var(--c-l-grey);
  margin: 0 auto;
  position: relative;
}

.status-dot.status-complete {
  background: var(--c-green);
}

.status-dot.status-uploaded {
  background: var(--c-v-blue);
}

.status-dot.status-error {
  background: var(--c-orange);
}

.status-dot.status-error::before {
  content: '';
  display: block;
  width: var(--icon-size-small);
  height: var(--icon-size-small);
  border-radius: var(--icon-size-small);
  background: var(--c-orange);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  animation: flashAnim 1500ms infinite cubic-bezier(0.8, 0, 0.145, 1);
}

/* ============================================================================
   CARDS
   ============================================================================ */

/* Base card styles */
.card {
  background: #fff;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  padding: calc(var(--gap) * 2);
  margin-bottom: calc(var(--gap) * 2);
  box-shadow: var(--f-drop-lite);
  position: relative;
}

.card.naked-card {
  border: 1px dashed var(--c-grey-2);
  background: var(--c-body-grey);
  box-shadow: none;
}

.card.naked-card p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  margin: 0;
  white-space: nowrap;
  color: var(--c-grey-2);
}

/* Case cards */
#cases-listing {
  display: block;
  padding: var(--gap);
  clear: both;
  container-type: inline-size; /* to enable the @container query */
  grid-row: 3;
  min-height: 0;
  flex-shrink: 0;
}

#cases-listing.restrict-height {
  max-height: 1060px;
  overflow: hidden;
}

#cases-listing.restrict-height::after {
  content: '';
  display: block;
  width: 100%;
  height: 100px;
  background: linear-gradient(0deg, rgba(250, 250, 250, 1) 30%, rgba(250, 250, 250, 0) 100%);
  position: absolute;
  bottom: 0;
  left: 0;
}

.case-card {
  display: flex;
  align-items: center;
  gap: max(4px, var(--gap));
  transition: all var(--t-base) var(--easing);
  padding: var(--gap);
}

.case-card:hover {
  border-color: var(--c-grey-2);
}

.case-card p {
  margin: 0;
}

.case-card span {
  font-size: 0.75rem;
  display: block;
  margin-bottom: calc(var(--gap) * 0.25);
  color: var(--c-grey-2);
  line-height: 1;
}

.case-card .status {
  width: var(--gap);
  height: var(--gap);
  flex-shrink: 0;
}

.case-card .refname {
  flex: 1;
  min-width: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-card .created {
  width: 120px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--c-grey-2);
  text-align: right;
}

.case-card .actions {
  width: 130px;
  flex-shrink: 0;
  text-align: center;
}

.case-card .status.status-error::before {
  width: var(--icon-size-medium);
  height: var(--icon-size-medium);
  border-radius: var(--icon-size-medium);
}

.case-card .ref {
  line-height: 1.4;
}

.case-card .processing {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--c-l-grey);
  margin: 0 auto;
  margin-top: calc(var(--gap) * 0.75);
}

.case-card .processing span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--c-v-blue);
  transition: all var(--t-base) var(--easing);
  will-change: width;
  animation: processingBar 2000ms infinite cubic-bezier(0.8, 0, 0.145, 1);
}

.case-card button {
  position: static;
}

.case-card .btn-download,
.case-card .processing,
.case-card .processing-label,
.case-card .btn-warn {
  display: none;
}

/* Login card */
.login-card {
  margin: calc(var(--gap) * 4) auto calc(var(--gap) * 4);
  width: 576px;
  position: relative;
  min-height: 400px;
  height: auto;
}

.login-card p {
  color: var(--c-black);
}

.login-card p.in-error {
  color: var(--c-red);
}

.login-card .hipcheck-logo-name {
  position: absolute;
  top: calc(var(--gap) * 2);
  right: calc(var(--gap) * 2);
  width: 120px;
  height: auto;
}

/* ============================================================================
   CASE LISTINGS AND DISPLAY OPTIONS
   ============================================================================ */

.list-display-options {
  position: relative;
  text-align: right;
  float: right;
  clear: both;
  padding: var(--gap);
  grid-row: 2;
  flex-shrink: 0;
}

.list-display-options.active {
  display: block;
}

.list-display-options span,
.list-display-options button {
  display: inline-block;
  vertical-align: middle;
}

.list-display-options span {
  font-size: 14px;
  color: var(--c-grey-1);
}

.list-display-options button {
  width: var(--icon-size-medium);
  height: var(--icon-size-medium);
  position: relative;
}

.list-display-options button:nth-of-type(1) {
  left: 5px;
}

.list-display-options button svg {
  pointer-events: none;
}

.list-display-options button.active svg * {
  stroke: var(--c-b-blue);
}

.list-display-options button:hover svg * {
  stroke: var(--c-blue);
}

.display-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.display-options span {
  font-size: 12px;
  color: var(--c-grey-1);
}

/* Table view for case cards */
.as-table {
  margin-bottom: var(--gap);
}

.as-table .case-card {
  padding: var(--gap);
  box-shadow: none;
  top: auto;
  margin: 0;
  background: none;
  border-top: none;
  line-height: normal;
}

.as-table .case-card:nth-of-type(1) {
  border-top: 1px solid var(--c-l-grey);
}

.as-table .case-card:nth-of-type(even) {
  background: rgba(0, 0, 0, 0.01);
}

.as-table .case-card span,
.as-table .processing-label.active,
.as-table .actions .processing {
  margin: 8px 0 0 0;
}

.as-table .case-card .actions .processing span {
  display: block;
}

.as-table .case-card div {
  font-size: 14px;
}

.as-table .case-card .btn-download {
  border: none;
  background: none;
  padding: 0;
  box-shadow: none;
  font-size: 14px;
  text-align: center;
  display: block;
  width: 100%;
}

.as-table .btn-warn.active {
  border: none;
  padding: 0;
  box-shadow: none;
}

.as-table .btn-warn.active:hover {
  background: none;
  color: var(--c-r-orange);
}

.as-table .case-card .status {
  width: calc(var(--gap) * 0.5);
  height: calc(var(--gap) * 0.5);
  position: relative;
  top: 2px;
}

/* ============================================================================
   CASE STATUS SECTION
   ============================================================================ */

.all-cases-status {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 0 auto;
  padding: var(--gap);
  gap: var(--gap);
  grid-row: 1;
  flex-shrink: 0;
}

.all-cases-status h1 {
  padding: 0 var(--gap);
  margin: 0;  /* override default h1 margin */
  line-height: 1; /* override default h1 line-height */
}

.all-cases-status .the-cases {
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  padding: var(--gap);
  width: 135%;
  font-size: 11px;
  white-space: nowrap;
  display: flex;
  justify-content: space-evenly;
}

.all-status-label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

.all-status-label.active {
  display: inline-block;
}

.all-status-label:last-child {
  margin-right: 0;
}

.all-status-label .status {
  margin-right: 4px;
  flex-shrink: 0;
}

.all-status-label span {
  display: inline-block;
  vertical-align: middle;
  font-size: 14px;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-container {
  margin: 0 auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: transparent;
  border: none;
  border-radius: var(--r);
}

.form-container.form-active {
  background-color: #FFF;
  border: 1px solid var(--c-l-grey-2);
}

.initial-state {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.form-content {
  width: 100%;
}

.form-content.show {
  display: block;
}

.form-section {
  margin-bottom: var(--gap);
  width: 100%;
}

.form-section .form-control {
  margin-bottom: var(--gap);
}

.form-control:last-child {
  margin-bottom: 0;
}

.form-control {
  position: relative;
  display: block;
  margin-bottom: var(--gap);
  width: 100%;
}

.form-control label {
  display: block;
  margin-bottom: calc(var(--gap) * 0.5);
  color: var(--secondary-text);
  text-align: left;
}

.form-control label .optional {
  color: var(--c-b-blue);
}

.input-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.input-wrapper input,
.input-wrapper textarea {
  padding-right: 50px;
  box-sizing: border-box;
}

.input-wrapper textarea {
  resize: both;
}

.input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 15px;
  width: 20px;
  height: 20px;
  pointer-events: none; /* Prevent icon from interfering with input */
}

.form-control .validation {
  font-size: 0.75rem;
  color: var(--c-red);
  display: none;
  position: absolute;
  padding-top: calc(var(--gap) * 0.5);
  top: 100%;
  right: 0;
}

.form-control .note {
  font-size: 0.75rem;
  position: absolute;
  padding-top: calc(var(--gap) * 0.5);
  top: 100%;
  right: 0;
}

.form-control:focus-within label {
  color: var(--c-black);
}

.form-control.in-error {
  margin-bottom: calc(var(--gap) * 3);
}

.form-control.in-error .validation {
  display: block;
}

.form-control.in-error input[type="text"] {
  border-color: var(--c-red);
}

.form-control.in-error label {
  color: var(--c-red);
}

.form-control.in-error .note {
  padding-top: calc(var(--gap) * 1.5);
}

.form-control .btn-start {
  width: 100%;
  padding: 21px var(--gap) 21px;
  max-height: none;
}

.form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: var(--gap);
}

.form-actions {
  width: 100%;
  display: flex;
  gap: var(--gap);
}

.form-actions .btn {
  flex: 1;
}

/* Form elements */
select,
textarea,
input[type="text"],
input[type="password"] {
  font-size: 1rem;
  line-height: 1;
  outline: none;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  display: block;
  width: 100%;
  opacity: 1;
  background: #fff;
  padding: 17px calc(var(--gap) * 1.25);
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  color: var(--c-black);
  border-color: var(--c-grey);
}

select:disabled,
textarea:disabled,
input[type="text"]:disabled,
input[type="password"]:disabled {
  background: var(--c-body-grey);
}

select::placeholder,
textarea::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--c-grey-2);
}

select {
  appearance: none;
  padding: 21px calc(var(--gap) * 1.25);
}

.analysis-confirmation {
  width: 100%;
  margin-bottom: var(--gap);
}

.case-summary {
  background: #fff;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  padding: calc(var(--gap) / 2);
}

.case-summary h2 {
  color: var(--secondary-text);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0;
}

.case-notes-section h3 {
  color: var(--planner-bg);
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  margin-bottom: 0;
}

.case-notes-display {
  position: relative;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  padding: var(--gap) / 2;
  background: white;
  margin-bottom: calc(var(--gap) / 2);
  min-height: 60px;
  max-height: 80px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  text-align: left;
}

.case-notes-display.expanded {
  max-height: none;
}

.notes-content {
  color: var(--planner-bg);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: calc(var(--gap) / 4) var(--gap);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expand-notes-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.expand-notes-btn:hover {
  transform: scale(1.1);
}

.expand-icon {
  width: 16px;
  height: 16px;
}

.upload-status-panel {
  background: #fff;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  padding: calc(var(--gap));
  text-align: center;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.status-title {
  color: var(--c-green);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-subtitle {
  color: var(--c-green);
  font-size: 18px;
  font-weight: 600;
}

.processing-message {
  color: var(--c-grey-1);
  font-size: 14px;
}

.processing-message p {
  margin: 0;
  line-height: 1.4;
}

/* ============================================================================
   FILE UPLOAD
   ============================================================================ */

#files {
  display: none;
}

/* Upload sections */
.upload-section {
  margin-bottom: var(--gap);
  color: var(--planner-bg);
  width: 100%;
}

.upload-section h3 {
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--planner-bg);
}

.upload-description {
  color: var(--planner-bg);
  font-size: 14px;
  margin: 0 0 calc(var(--gap) / 2) 0;
}

.upload-img-counter-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: calc(var(--gap) / 2);
}

.upload-img-counter-container .upload-img-counter {
  color: var(--planner-bg);
  font-weight: 700;
  line-height: normal; /* override paragraph line-height */
  margin: 0; /* override paragraph margin */
}

.upload-complete-container {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--c-green);
  font-weight: 700;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  margin-bottom: var(--gap);
  padding: var(--gap);
}

.upload-complete-inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.upload-item {
  margin-bottom: var(--gap);
}

.upload-item:last-child {
  margin-bottom: 0;
}

.upload-label {
  font-size: 14px;
  color: var(--primary-blue);
  font-weight: 700;
}

.upload-label-uploaded {
  color: var(--c-green);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-icon-small, .tick-icon {
  width: 21px;
  height: 21px;
}

.upload-box {
  border: 2px dashed var(--c-l-grey);
  border-radius: var(--r);
  padding: var(--gap);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--gap) * 0.75);
}

.upload-box:hover, .upload-box.drag-over, .upload-box:has(.file-input:focus-visible) {
  border-color: var(--c-b-blue);
  background: rgba(var(--c-blue-rgb), 0.02);
}

.upload-box.uploading {
  border-color: var(--c-v-blue);
}

.upload-box.error {
  border-color: var(--c-red);
}

.upload-box.uploaded {
  border: 1px solid var(--c-green);
}

.upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--c-v-blue);
  transition: width 0.3s;
  border-radius: 0 0 var(--r) var(--r);
}

.upload-status {
  color: var(--c-green);
  align-items: center;
  display: flex;
  gap: 6px;
  padding-bottom: 4px;
}

.upload-box.uploading .upload-status {
  color: var(--c-v-blue);
}

.upload-box.uploaded .upload-status {
  color: var(--c-green);
}

.upload-box.error .upload-status {
  color: var(--c-red);
}

.upload-box .upload-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-box .upload-icon {
  width: 30px;
  height: 30px;
  background-color: var(--c-l-grey);
  border-radius: 15px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-box span {
  display: block;
  color: var(--planner-bg);
  font-size: 14px;
}

.upload-box .file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.upload-box .file-input:focus {
  outline: none;
}

.tooltip-icon {
  position: relative;
  cursor: help;
  z-index: 6; /* in front of file-input */
}

.upload-box-uploaded {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--c-green);
  border-radius: var(--r);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: calc(var(--gap) / 2);
  position: relative;
  width: 100%;
  min-height: 120px;
  gap: 20px;
}

.upload-content-uploaded {
  display: flex;
  flex-direction: row;
  gap: var(--gap);
  padding: var(--gap);
  width: 100%;
  border: 1px solid var(--c-l-grey);
  border-radius: var(--r);
  position: relative;
}

.upload-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: var(--r);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--c-body-grey);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r);
}

.upload-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.upload-name, .upload-size {
  color: var(--planner-bg);
  text-align: left;
  flex: 1;
}

.upload-header-uploaded {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--c-green);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 0;
  width: 100%;
}

.upload-header-uploaded img,
.upload-header-uploaded .tick-icon,
.upload-status .hip-icon {
  width: 20px;
  height: 20px;
  color: var(--c-green)
}

.upload-remove-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--secondary-text);
  font-size: 24px;
  background: none;
  border: none;
  transition: color var(--t-base);
}

.upload-remove-btn:hover {
  color: var(--c-red);
}

.upload-header.uploaded {
  position: relative;
}

/* ============================================================================
   BANNERS AND NOTIFICATIONS
   ============================================================================ */

.top-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  background: var(--c-body-grey);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 400px;
  z-index: 10;
}

.user-status-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  gap: var(--gap);
  width: fit-content;
  flex-shrink: 0;
  order: 2;
}

.user-status-banner .authentication-status {
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  line-height: normal;
}

.user-status-banner .log-out-btn {
  padding: 8px 16px;
  font-size: 16px;
  line-height: 26px;
}

.info-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 9px;
  background: var(--background-blue);
  gap: 8px;
  height: var(--top-banner-height);
  flex: 1;
  min-width: 0;
  order: 1;
}

.info-banner .info-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.info-banner span {
  color: var(--primary-blue);
  font-size: 9px;
  font-weight: 400;
  line-height: normal;
}

/* ============================================================================
   CONTENT SECTIONS
   ============================================================================ */

.cases-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 calc(var(--gap) * 2) calc(var(--gap) * 4);
}

.tips-section {
  background-color: rgba(var(--primary-blue-rgb), 0.18);
  color: var(--c-blue);
  border: 1px solid var(--primary-blue);
  border-radius: 5px;
  padding: var(--gap);
  margin: calc(var(--gap) * 2) auto;
  text-align: left;
  width: 100%;
}

.tips-section h3 {
  margin: 0 0 var(--gap) 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-blue);
}

.tips-section ul {
  margin: 0 0 var(--gap) 0;
  padding-left: calc(var(--gap) * 1.5);
  color: var(--c-blue);
}

.tips-section li {
  color: var(--c-blue);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: calc(var(--gap) * 0.5);
}

.tips-section .protocol-link {
  color: var(--c-r-blue);
  text-decoration: underline;
  font-size: 14px;
}

.tips-section .protocol-link:hover {
  color: var(--c-b-blue);
}

/* ============================================================================
   SPECIAL PAGES
   ============================================================================ */

body.login-page {
  background-image: url('../img/hipcheck-background-login-page.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: bottom right;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

body.login-page .navigator-logo {
  position: fixed;
  bottom: calc(var(--gap) * 3);
  left: calc(var(--gap) * 3);
  width: 91px;
  height: auto;
  z-index: 1;
}

.do-btn-wiggle {
  animation: btnWiggle 500ms cubic-bezier(0.8, 0, 0.145, 1);
}


/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

#user-bar {
  color: var(--c-grey-1);
  font-size: 14px;
}


/* ============================================================================
   ANIMATIONS AND KEYFRAMES
   ============================================================================ */

@keyframes flashAnim {
  0% {
    transform: translateX(-50%) translateY(-50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) translateY(-50%) scale(1);
    opacity: 0.25;
  }
  100% {
    transform: translateX(-50%) translateY(-50%) scale(0);
    opacity: 0;
  }
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes processingBar {
  0% {
    width: 0;
  }
  50% {
    width: 100%;
  }
  75% {
    width: 100%;
    opacity: 0;
  }
  100% {
    width: 0;
    opacity: 0;
  }
}

@keyframes btnWiggle {
  0% {
    transform: translateX(0px);
  }
  25% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(10px);
  }
  75% {
    transform: translateX(-4px);
  }
  100% {
    transform: translateX(0px);
  }
}

/* ============================================================================
   MEDIA QUERIES
   ============================================================================ */

/* Container queries */
@container (max-width: 500px) {
  .case-card {
    grid-template-columns: var(--gap) 1fr 200px;
  }

  .case-card .created {
    display: none;
  }
}

/* Use space-between when all items fit on one line */
@container (min-width: 600px) {
  .case-card {
    justify-content: space-between;
  }

  .case-card .created,
  .case-card .actions {
    margin-left: 0;
  }
}

[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-sizing: border-box;
}

[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 100;
  pointer-events: none;
}

.js-tooltip {
  position: absolute;
  background: var(--c-b-blue);
  color: white;
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: 12px;
  max-width: 250px;
  z-index: 6;  /* above the top-banner */
  pointer-events: none;
}

/* Height-based media queries */
@media all and (max-height: 600px) {
  .sidebar-content p {
    display: none;
  }
}

@media all and (max-height: 420px) {
  .sidebar-content .hipcheck-logo-name {
    display: none;
  }
}

@media all and (max-height: 250px) {
  body.login-page .navigator-logo {
    display: none;
  }
}

@media all and (max-width: 1400px) {
  /* display col-right and col-left underneath each other instead of beside each other on narrower screens */
  .content {
    grid-template-rows: auto 1fr;
  }

  .ui-layout {
    display: flex;
    flex-direction: column;
  }

  .ui-layout .col-right {
    order: 1;
  }

  .ui-layout .col-left {
    order: 2;
    display: flex;
    flex: 1;
    max-width: 100%;
    min-height: 0;
  }

  .page-footer {
    left: var(--gap);
    right: var(--gap);
    max-width: calc(100% - var(--gap) * 2);
  }
}

@media all and (max-width: 1000px) and (max-height: 800px) {
  body.login-page .navigator-logo {
    display: none;
  }
}

/* Phone and Tablet Styling */
@media all and (max-width: 900px) {
  .main {
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
  }

  .sidebar,
  .sidebar-content,
  .sidebar-protocol-link {
    display: none;
  }

  .content {
    padding: 0;
    flex: 1;
    margin-top: 0;
    display: flex;
    flex-direction: column;
  }

  .ui-layout {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .ui-layout .col-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
  }

  .page-footer {
    left: var(--gap);
    right: var(--gap);
  }

  .login-card .hipcheck-logo-name {
    display: none;
  }

  .login-card {
    max-width: 80%;
  }

  .form-container {
    padding-left: var(--gap);
    padding-right: var(--gap);
  }

  .top-banner {
    position: relative;
    left: 0;
    right: 0;
    top: var(--header-height);
    padding: var(--gap);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    height: auto;
    flex-shrink: 0;
    order: -1;
    box-sizing: border-box;
  }

  .user-status-banner {
    display: none;
  }

  .info-banner {
    width: 100%;
    order: 2;
    flex: none;
    overflow: hidden;
    padding: 8px var(--gap);
  }

  .mobile-header {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--c-n-blue);
    z-index: 20;
    min-width: 400px;
  }

  .mobile-header .header-left {
    position: absolute;
    top: 12px;
    left: 17px;
    display: flex;
    width: 113px;
    height: 38.325px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
  }

  .mobile-header .header-logo {
    width: 100%;
    height: auto;
  }

  .mobile-header .header-title {
    position: absolute;
    top: 7.5px;
    left: 138px;
    color: #fff;
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    white-space: nowrap;
  }

  .mobile-header .header-right {
    position: absolute;
    top: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: calc(32px + var(--gap));
  }

  .mobile-header .header-right img {
    height: var(--header-height);
    width: auto;
  }

  .mobile-header .header-bg-image {
    height: var(--header-height);
    width: auto;
    margin: 0 var(--gap);
  }

  .mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: var(--header-height);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 4px;
    z-index: 21;
  }

  .mobile-menu-button span {
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
  }

  .mobile-menu-button:hover span {
    background-color: var(--c-grey);
  }

  .mobile-menu-button.active span {
    display: none;
  }

  .mobile-menu-button.active::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('../img/close.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  .mobile-menu-button:focus-visible {
    outline: 2px solid white;
    outline-offset: -4px;
  }

  .mobile-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--c-n-blue);
    display: none;
    z-index: 20;
    padding: var(--gap);
  }

  .mobile-nav-menu.active {
    display: block;
  }

  .mobile-nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: calc(var(--gap) / 2);
  }

  .mobile-nav-menu a {
    display: flex;
    align-items: center;
    gap: var(--gap);
    color: white;
    background-color: transparent;
    text-decoration: none;
    padding: calc(var(--gap) / 2) var(--gap);
    border-radius: var(--button-r);
    font-size: 14px;
    font-weight: 400;
    transition: all var(--t-base) ease;
    cursor: pointer;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-menu a:active {
    color: var(--c-n-blue);
    background-color: white;
    transform: translateY(1px);
  }

  .mobile-nav-menu .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
    transition: filter var(--t-base) ease;
  }

  .mobile-nav-menu a:active .nav-icon {
    filter: brightness(0) invert(0);
  }

  @media (hover: hover) and (pointer: fine)  {
    .mobile-nav-menu a:hover {
      color: var(--c-n-blue);
      background-color: white;
    }

    .mobile-nav-menu a:hover .nav-icon {
      filter: brightness(0) invert(0);
    }
  }

  .mobile-user-section {
    display: flex;
    flex-direction: column;
    padding-top: calc(2 * var(--gap, 1rem));
    align-items: center;
  }

  .mobile-nav-menu .mobile-logout-btn {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    border-radius: var(--button-r);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    width: 50%;
    margin-bottom: var(--gap);
  }

  .mobile-nav-menu .mobile-logout-btn:hover,
  .mobile-nav-menu .mobile-logout-btn:active {
    background: var(--primary-blue);
    color: white;
  }

  .mobile-authentication-status {
    text-align: center;
    font-size: 0.875rem;
    color: var(--c-l-grey-1);
  }
}

/* Hide the image of the hip in the header on very narrow screens */
@media all and (max-width: 450px) {
  .mobile-header .header-bg-image {
    display: none;
  }
}