/* Mobile layout for login page */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.page-authentication {
  overflow-x: hidden;
  min-height: 100%;
  min-height: 100dvh;
}

body.page-authentication #dtw {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body.page-authentication > #dtw > header:first-of-type .container-fluid {
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

body.page-authentication .light-header-logo {
  max-width: min(220px, 70vw);
  height: auto;
}

body.page-authentication .auth-card.card {
  box-sizing: border-box;
}

body.page-authentication .auth-footer {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

body.page-authentication .auth-footer p br {
  display: none;
}

body.page-authentication #login-form .btn,
body.page-authentication .js-cognito-social-login {
  min-height: 48px;
  touch-action: manipulation;
}

body.page-authentication #login-form .form-control {
  font-size: 16px; /* prevents iOS zoom on focus */
  min-height: 48px;
}

body.page-authentication #login-form .d-flex.justify-content-between {
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

body.page-authentication #footer {
  margin-top: auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

@media (max-width: 575.98px) {
  body.page-authentication {
    background-color: #fff;
  }

  body.page-authentication > #dtw > header:first-of-type .container-fluid {
    padding-bottom: 0.5rem;
  }

  body.page-authentication > #dtw > header:first-of-type .mt-5 {
    margin-top: 1.5rem !important;
  }

  body.page-authentication .auth-card.alert,
  body.page-authentication > .auth-card:not(.card) {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
  }

  body.page-authentication main.auth-card.card {
    width: 100%;
    max-width: 100%;
    margin-top: 0 !important;
    margin-left: 0;
    margin-right: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.5rem !important;
    background-color: #fff;
  }

  body.page-authentication header.d-sm-none .nav-tabs {
    margin: 0;
  }

  body.page-authentication header.d-sm-none .nav-link {
    padding: 0.85rem 0.5rem;
    font-size: 1rem;
  }

  body.page-authentication .js-cognito-social-login,
  body.page-authentication #email-login-toggle,
  body.page-authentication #login-btn {
    font-size: 0.95rem;
    white-space: normal;
    line-height: 1.3;
  }

  body.page-authentication #login-form .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-authentication #login-form .d-flex.justify-content-between > p {
    text-align: left !important;
    margin-bottom: 0;
    width: 100%;
  }

  body.page-authentication .auth-footer p {
    font-size: 0.75rem;
    line-height: 1.45;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.page-authentication #footer {
    padding-top: 1.5rem !important;
  }

  body.page-authentication #footer .d-flex {
    gap: 0.25rem;
  }

  body.page-authentication #footer a {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
  }
}

@media (max-width: 359.98px) {
  body.page-authentication .light-header-logo {
    max-width: 180px;
  }

  body.page-authentication main.auth-card.card {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.page-authentication header.d-sm-none .nav-link {
    font-size: 0.9rem;
  }
}

@media (min-width: 576px) {
  body.page-authentication .auth-footer p br {
    display: inline;
  }
}
