/* Brand refresh scoped to the login and dashboard pages, to match the bank-payments pay pages.
   Load it last: it overrides main.css and dashboard.css. */
:root {
  --brand-primary: #7ac1ae;
  --brand-primary-dark: #63ac98;
  --brand-deep: #366e5e;
  --brand-deep-dark: #2a584b;
  --brand-ink: #1a1d24;
  --brand-muted: #6b7280;
  --brand-line: #e7e5e4;
  --brand-field: #f7f6f5;
  --brand-warn: #c4554d;
  --brand-gradient: linear-gradient(45deg, #79beac 0%, #366e5e 100%);
  /* Small white text needs 4.5:1, also at the light end. */
  --brand-gradient-deep: linear-gradient(45deg, #45806f 0%, #2a584b 100%);

  /* main.css and dashboard.css read these, so the existing rules pick up the brand. */
  --Sage: var(--brand-primary);
  --New-Green: var(--brand-deep);
  --Dark-Green: var(--brand-deep);
  --unifi-button-border-radius: 14px;
  --unifi-control-border-radius: 14px;
}

/* background-image, because inline.css.php forces the background colour with !important.
   Fixed attachment gives the nav and the title bar one gradient with no seam. */
.navbar,
.dashboard-top-bar {
  background-image: var(--brand-gradient);
  background-attachment: fixed;
}

body.wizard a {
  color: var(--brand-deep);
}

body.wizard a:hover {
  color: var(--brand-primary-dark);
}

/* Deep, not sage: white on sage is only 2.1:1. */
.btn-primary,
.btn-danger,
body.wizard a.btn.btn-application {
  background-color: var(--brand-deep);
  border-color: var(--brand-deep);
  border-radius: 14px;
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-danger:hover,
.btn-danger:focus,
body.wizard a.btn.btn-application:hover,
body.wizard a.btn.btn-application:focus {
  background-color: var(--brand-deep-dark);
  border-color: var(--brand-deep-dark);
  color: #fff !important;
  opacity: 1;
}

/* main.css and bootstrap drop the focus ring; keyboard users need it. */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(122, 193, 174, .55);
}

/* Outlined, so the secondary action does not compete with the primary.
   body.wizard beats wizard.css's `body.wizard a.btn { color: white }`. */
body.wizard .btn-loanstatement,
body.wizard .btn-earlysettlement,
body.wizard.dashboard .btn-secondary,
body.wizard.dashboard .btn-darker {
  background-color: #fff;
  border: 2px solid var(--brand-deep);
  border-radius: 14px;
  color: var(--brand-deep) !important;
}

body.wizard .btn-loanstatement:hover,
body.wizard .btn-loanstatement:focus,
body.wizard .btn-earlysettlement:hover,
body.wizard .btn-earlysettlement:focus,
body.wizard.dashboard .btn-secondary:hover,
body.wizard.dashboard .btn-secondary:focus,
body.wizard.dashboard .btn-darker:hover,
body.wizard.dashboard .btn-darker:focus,
body.wizard.dashboard .btn-darker:active {
  background-color: var(--brand-field) !important;
  border-color: var(--brand-deep-dark);
  color: var(--brand-deep-dark) !important;
  opacity: 1;
}

/* Two base rules give the loan buttons different heights. */
.installments .btn-installments {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 16px;
  border-width: 2px;
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
}

/* The fixed 65px bar pushed "See all loans" down onto the message band. */
.dashboard-top-bar {
  border-bottom: 0;
  height: auto;
  margin-top: 12px;
  padding: 12px 0;
}

.dashboard-top-bar .col-md-12 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-top-bar h1,
.dashboard-top-bar h2 {
  margin: 0;
  font-size: 16px;
}

/* dashboard.css pushes the link down 17px and greys it when no message band follows. */
.dashboard-top-bar a.btn-link.pull-right {
  float: none !important;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.2;
  color: #fff !important;
}

.dashboard .alert-dashmsg {
  background: var(--brand-primary);
  color: var(--brand-ink);
  padding-top: 14px;
  padding-bottom: 14px;
  margin-bottom: 0;
  font-size: 15px;
}

.dashboard .alert-dashmsg p {
  color: var(--brand-ink);
}

/* Plain page headings, so the loan rows get the attention. my-loans-details.php, verify-income.php and
   documents-upload.php match them. */
.dashboard .panel-heading-dashboard.panel-page-heading,
.dashboard .well.well-summary,
.dashboard .myloans-summary .panel-heading {
  background: transparent !important;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 32px 0 16px;
  height: auto;
  max-height: none;
}

.dashboard .panel-page-heading > .panel-title.panel-title-dashboard,
.dashboard .well.well-summary > .panel-title,
.dashboard .myloans-summary .panel-heading > .panel-title,
.dashboard .headline-text h1 {
  color: var(--brand-ink);
  font-size: 28px !important;
  font-weight: 800 !important;
}

.dashboard .panel-page-heading > .panel-title.panel-title-dashboard,
.dashboard .well.well-summary > .panel-title {
  background: transparent !important;
  line-height: 1.2;
  margin: 0 !important;
}

/* loans-activeloans.php sets the grey background inline. The deep gradient keeps the white text at 4.5:1. */
.dashboard section > .panel-heading-dashboard[style] {
  background: var(--brand-gradient-deep) !important;
  border-radius: 14px !important;
}

.dashboard section > .panel-heading-dashboard[style] .panel-title-dashboard {
  background: transparent !important;
}

/* Red only for arrears, the one figure that needs action. */
div.installments div.col-md-2 {
  color: var(--brand-muted);
}

.installments .numinstallments > span,
.installments .payable > span,
.installments .balance > span {
  color: var(--brand-ink);
}

.installments .arrears > span {
  color: var(--brand-warn);
}

/* "Calculate" is an action, not a figure. */
.installments .balance > span > a {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-deep);
}

/* A centred column of figures is too long on a phone. */
@media (max-width: 991px) {
  .installments {
    margin-top: 16px;
    text-align: left;
  }

  .installments .numinstallments,
  .installments .payable,
  .installments .balance,
  .installments .arrears {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--brand-line);
    font-size: 14px;
  }

  .installments .numinstallments > span,
  .installments .payable > span,
  .installments .balance > span,
  .installments .arrears > span {
    font-size: 17px;
    font-weight: 700;
  }

  .installments .btn-installments {
    margin-bottom: 10px;
  }
}

/* my-loans-details.php puts the buttons in the heading. */
.dashboard .myloans-summary .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard .myloans-summary .panel-heading > .panel-title {
  margin: 0;
}

/* Settlement quote and Email statement sat edge to edge. */
.dashboard .myloans-summary form.text-right .btn + .btn {
  margin-left: 8px;
}

/* .dashboard .panel-default below removes panel borders; the bureau score keeps its card. */
.dashboard .myloans-summary-details .bureau-score .panel-default {
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  background: #fff;
}

.dashboard .myloans-summary-details .bureau-score .panel-heading {
  display: block;
  margin: 0;
  padding: 0 24px;
}

.dashboard .myloans-summary-details .bureau-score .panel-title {
  font-size: 17px !important;
  margin: 24px 0 16px;
  border-bottom: 1px solid var(--brand-line);
}

.dashboard .myloans-summary-details .bureau-score .panel-title span {
  color: var(--brand-deep);
}

.dashboard .myloans-summary-details .bureau-score .panel-body i {
  border-color: var(--brand-primary);
  color: var(--brand-deep);
}

.dashboard .myloans-summary-details .well-ref-num {
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  box-shadow: none;
  color: var(--brand-ink);
}

/* The labels were red, which is reserved for arrears. */
.dashboard .form-loan-details .control-label,
.dashboard .myloans label {
  color: var(--brand-muted);
}

.dashboard .form-loan-details .form-control[readonly] {
  background-color: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  box-shadow: none;
  color: var(--brand-ink);
}

/* The outline framed a heading that now sits on the page. */
.dashboard .panel-default {
  border: 0;
  box-shadow: none;
}

div.table-loans table td {
  color: var(--brand-ink);
}

/* The labels are already in sentence case. */
div.table-loans table.text-uppercase {
  text-transform: none;
}

div.table-loans.visible-xs td .pull-left {
  color: var(--brand-muted);
}

/* Warm stripes to match the page; dashboard.css uses a cool grey. */
.dashboard .table-striped > tbody > tr:nth-child(odd) {
  background-color: transparent;
}

.dashboard .table-striped > tbody > tr:nth-child(even) {
  background-color: #efedeb;
}

.dashboard .table > thead > tr > th {
  border-bottom: 2px solid var(--brand-line);
  color: var(--brand-muted);
}

/* The empty header row left a gap and a stray line above the first loan. */
.dashboard .table-responsive.visible-xs thead {
  display: none;
}

/* Faded nav links read as disabled, so underlines mark hover and the current page. */
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #fff;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #fff;
  background-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* main.css paints the open phone menu red. */
#dunami-collapse.navbar-collapse.collapse.in,
#dunami-collapse.navbar-collapse.collapsing,
#dunami-collapse.navbar-collapse.collapse.in ul.nav.navbar-nav,
#dunami-collapse.navbar-collapse.collapsing ul.nav.navbar-nav {
  background: var(--brand-deep-dark);
}

@media (max-width: 767px) {
  #dunami-collapse.navbar-collapse {
    border-top: 0;
    box-shadow: 0 16px 32px rgba(0, 3, 3, .28);
  }

  #dunami-collapse ul.nav.navbar-nav {
    margin: 8px 0 16px !important;
  }

  #dunami-collapse .navbar-nav > li > a {
    float: none;
    margin-left: 0;
    padding: 14px 24px;
    font-size: 16px;
    text-align: left;
    border-left: 4px solid transparent;
  }

  #dunami-collapse .navbar-nav > li + li > a {
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  #dunami-collapse .navbar-nav > .active > a,
  #dunami-collapse .navbar-nav > .active > a:hover,
  #dunami-collapse .navbar-nav > .active > a:focus {
    text-decoration: none;
    border-left-color: var(--brand-primary);
    background-color: rgba(255, 255, 255, .06);
  }

  #dunami-collapse .navbar-nav > li > a:hover {
    text-decoration: none;
    background-color: rgba(255, 255, 255, .06);
  }

  /* The spacer only makes room for the desktop chat icon. */
  #dunami-collapse .chat-icon-dashboard-spacer {
    display: none;
  }
}

.ajax-dropdown {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(0, 3, 3, .18);
  padding: 8px;
}

.ajax-dropdown .btn-default {
  border: 0;
  border-radius: 10px;
  color: var(--brand-ink);
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-weight: 600;
}

.ajax-dropdown .btn-default:hover,
.ajax-dropdown .btn-default:focus {
  background: var(--brand-field);
  color: var(--brand-deep);
}

/* verify-income.php and documents-upload.php: match the application wizard's cards. */
.dashboard .headline-text h1 {
  margin: 24px 0 8px;
}

/* verify-income.php greys its intro inline at #A6A6A6, which is 2.4:1 on the page. */
.dashboard .card-unifi-form .card-body > span[style] {
  color: var(--brand-muted) !important;
  font-size: 15px;
}

.dashboard .card-unifi-form .card-title {
  font-size: 17px;
  font-weight: 800;
  margin-top: 8px;
}

/* Long labels overflowed the button on a phone. */
.dashboard .btn-full-width {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 52px;
  padding: 12px 20px !important;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  font-size: 15px !important;
}

.dashboard .card-unifi-form .card-text + .btn-full-width,
.dashboard .card-unifi-form .card-text + a.btn {
  margin-bottom: 16px;
}

.dashboard .card-unifi-form .btn-full-width + .standard-spacing-1-line {
  height: 10px;
}

/* Flex column keeps the footer at the bottom on short pages. 78px is the body's top margin from header-dashboard.php. */
body.wizard.dashboard {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 78px);
  background: var(--brand-field);
  color: var(--brand-ink);
}

body.wizard.dashboard > * {
  flex-shrink: 0;
}

/* A flex item with auto side margins shrinks to its content, and bootstrap gives .container no width
   below 768px. */
@media (max-width: 767px) {
  body.wizard.dashboard > .container {
    width: 100%;
  }
}

body.wizard.dashboard > .main-footer {
  margin-top: auto;
}

/* In iframe mode, login.php forces white with !important. */
body.login,
body.wizardotp {
  background-color: var(--brand-field);
}

/* login.php colours this link inline. */
.unifi-login .card-footer a {
  color: var(--brand-deep) !important;
}

/* main.container limits this to full-page mode; iframe mode has none. One field does not need the full width. */
body.login main.container {
  max-width: 480px;
  /* inline.css.php shadows the container too, which doubled the card's shadow. */
  box-shadow: none;
}

body.login main.container .card.unifi-login {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 3, 3, .28);
}

body.login main.container .card-body.card-login {
  padding: 40px 36px 8px;
}

body.login main.container .card-footer.card-login {
  padding: 16px 36px 32px;
  background: transparent;
  border: 0;
}

@media (max-width: 575px) {
  body.login main.container {
    padding: 0 16px;
  }

  body.login main.container .card-body.card-login {
    padding: 32px 20px 8px;
  }

  body.login main.container .card-footer.card-login {
    padding: 12px 20px 28px;
  }
}

/* Match the login card. inline.css.php styles the container, so the shadow goes there. */
body.wizardotp main.container {
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 3, 3, .28);
  overflow: hidden;
}

body.wizardotp main.container .card {
  border-radius: 24px;
}

body.login .form-control,
body.wizardotp .form-control {
  background-color: var(--brand-field);
  border: 2px solid var(--brand-line);
}

body.login .form-control:focus,
body.wizardotp .form-control:focus {
  background-color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(122, 193, 174, .28);
}

/* nav.php shows Logout to everyone who is not an agent, also before they log in. */
body.login #btnLogoutWP {
  display: none;
}

.main-footer {
  background-color: var(--brand-ink);
}
