html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(69, 145, 255, .35);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background: #111827;
  color: #e5eaf1;
  color-scheme: dark;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.lookup-panel,
.results-panel {
  background: #1b2535;
  border: 1px solid #344156;
  border-radius: .75rem;
  box-shadow: 0 .5rem 1.5rem rgba(7, 12, 22, .25);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.login-panel {
  max-width: 28rem;
  margin: clamp(2rem, 8vh, 5rem) auto 0;
}

.app-navbar {
  background: #182235;
  border-bottom: 1px solid #344156;
}

.top-panel-grid {
  display: grid;
  grid-template-areas:
    "manual logo"
    "import logo";
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 2rem;
  align-items: start;
}

.manual-lookup-zone {
  grid-area: manual;
  min-width: 0;
}

.manual-submit {
  margin-top: 1rem;
}

.import-zone {
  grid-area: import;
  width: min(100%, 21rem);
  padding: 1rem;
  background: #172131;
  border: 1px solid #344156;
  border-radius: .6rem;
}

.import-zone form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.import-zone #import-submit {
  align-self: flex-start;
  margin-top: auto;
}

.import-zone h2 {
  color: #e5eaf1;
  font-weight: 700;
}

.import-zone .form-text,
.import-validation {
  font-size: .78rem;
  line-height: 1.35;
}

.import-file-input {
  max-width: 19rem;
  font-size: .78rem;
}

.import-help {
  margin-top: .35rem;
}

.logo-zone {
  grid-area: logo;
  display: flex;
  justify-content: flex-end;
}

.payway-logo {
  display: block;
  width: clamp(9.375rem, 15vw, 11.25rem);
  height: auto;
  max-width: 100%;
  flex: 0 1 auto;
}

@media (min-width: 1400px) {
  .top-panel-grid {
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem) auto;
    grid-template-rows: auto auto auto auto auto auto auto;
    column-gap: 2rem;
    row-gap: 0;
    align-items: start;
  }

  .manual-lookup-zone,
  .manual-lookup-zone > form {
    display: contents;
  }

  .manual-title,
  .manual-validation,
  .date-grid,
  .manual-date-help,
  .manual-operations-block,
  .manual-operation-validation,
  .manual-submit {
    grid-column: 1;
  }

  .manual-title {
    grid-row: 1;
  }

  .manual-validation {
    grid-row: 2;
  }

  .date-grid {
    grid-row: 3;
  }

  .manual-date-help {
    grid-row: 4;
  }

  .manual-operations-block {
    grid-row: 5;
  }

  .manual-operation-validation {
    grid-row: 6;
  }

  .manual-submit {
    grid-row: 7;
    justify-self: start;
  }

  .import-zone {
    grid-column: 2;
    grid-row: 1 / 6;
    display: flex;
    width: 100%;
    height: 100%;
    margin-top: 0;
    flex-direction: column;
  }

  .logo-zone {
    grid-column: 3;
    grid-row: 1;
  }
}

.form-label {
  color: #e5eaf1;
  font-weight: 600;
}

.form-control {
  background-color: #111a28;
  border-color: #46546a;
  color: #f0f3f7;
}

.form-control::placeholder {
  color: #8290a4;
}

.form-control:focus {
  background-color: #131e2e;
  border-color: #4591ff;
  color: #fff;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(.8);
}

.form-text,
.text-secondary {
  color: #aeb8c7 !important;
}

.date-grid,
.operation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(10rem, 1fr));
  gap: .75rem;
}

.date-grid {
  margin-bottom: .25rem;
}

.operation-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-primary {
  background-color: #2878dc;
  border-color: #3988e8;
}

.btn-primary:hover {
  background-color: #3485e8;
  border-color: #4a95ef;
}

.table {
  --bs-table-color: #e4e9f0;
  --bs-table-bg: #1b2535;
  --bs-table-border-color: #3b485c;
  --bs-table-striped-color: #e4e9f0;
  --bs-table-striped-bg: #202c3e;
  --bs-table-hover-color: #f4f7fb;
  --bs-table-hover-bg: #263449;
}

.table thead th {
  background: #151f2f;
  color: #cbd4e1;
  border-bottom-color: #46546a;
}

.alert-danger {
  background-color: #40232b;
  border-color: #72404c;
  color: #ffc4ce;
}

.text-danger {
  color: #ff9da9 !important;
}

.badge.text-bg-success {
  background-color: #237455 !important;
  color: #e7fff5 !important;
}

.badge.text-bg-secondary {
  background-color: #4a586d !important;
  color: #f0f3f7 !important;
}

.badge.text-bg-danger {
  background-color: #9b3d4d !important;
  color: #fff1f3 !important;
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 1.5rem;
  background: rgba(12, 19, 31, .78);
  backdrop-filter: blur(2px);
}

.processing-overlay.is-visible {
  display: grid;
}

.processing-card {
  width: min(100%, 27rem);
  padding: 2rem;
  text-align: center;
  background: #1b2535;
  border: 1px solid #46546a;
  border-radius: .75rem;
  box-shadow: 0 1rem 3rem rgba(7, 12, 22, .45);
}

.processing-spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
  border: .3rem solid #344156;
  border-top-color: #4591ff;
  border-radius: 50%;
  animation: processing-spin .8s linear infinite;
}

.processing-title {
  margin-bottom: .5rem;
  color: #f0f3f7;
  font-size: 1.2rem;
  font-weight: 700;
}

.processing-text {
  margin-bottom: 0;
  color: #aeb8c7;
}

@keyframes processing-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .processing-spinner {
    animation-duration: 1.6s;
  }
}

@media (max-width: 991.98px) {
  .date-grid,
  .operation-grid {
    grid-template-columns: repeat(2, minmax(10rem, 1fr));
  }
}

@media (max-width: 575.98px) {
  .top-panel-grid {
    grid-template-areas:
      "manual"
      "import"
      "logo";
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .import-zone {
    width: 100%;
  }

  .logo-zone {
    justify-content: flex-start;
  }

  .payway-logo {
    width: 9.375rem;
  }

  .date-grid,
  .operation-grid {
    grid-template-columns: 1fr;
  }
}

.validation-summary-valid,
.field-validation-valid {
  display: none;
}
